]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix crashes in dioread_nolock mode
authorJan Kara <jack@suse.cz>
Fri, 19 Feb 2016 05:33:21 +0000 (00:33 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 19 Feb 2016 05:33:21 +0000 (00:33 -0500)
commit3a983264929f9603870eda0f9c56cd5072647a75
tree1f8933f3ec2715cdfcbac993cf0409e884caf11c
parent08a51d5abd1ba57f2c8e8dac0fb996ba60eecf63
ext4: fix crashes in dioread_nolock mode

Competing overwrite DIO in dioread_nolock mode will just overwrite
pointer to io_end in the inode. This may result in data corruption or
extent conversion happening from IO completion interrupt because we
don't properly set buffer_defer_completion() when unlocked DIO races
with locked DIO to unwritten extent.

Since unlocked DIO doesn't need io_end for anything, just avoid
allocating it and corrupting pointer from inode for locked DIO.
A cleaner fix would be to avoid these games with io_end pointer from the
inode but that requires more intrusive changes so we leave that for
later.

Cc: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c