ext4: fix ext4_end_io_dio() racing against fsync()
authorTheodore Ts'o <tytso@mit.edu>
Mon, 12 Dec 2011 15:53:02 +0000 (10:53 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Dec 2011 20:58:33 +0000 (12:58 -0800)
commit6415da6d18a55702cee3f01662733d0501635bbc
treee475b41774ea3f1310d0c28843bc6a26a6286946
parentd7587810a40aee32ec6bdfc2d4bce7ba9fd03c3e
ext4: fix ext4_end_io_dio() racing against fsync()

commit b5a7e97039a80fae673ccc115ce595d5b88fb4ee upstream.

We need to make sure iocb->private is cleared *before* we put the
io_end structure on i_completed_io_list.  Otherwise fsync() could
potentially run on another CPU and free the iocb structure out from
under us.

Reported-by: Kent Overstreet <koverstreet@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/inode.c