]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:12 +0000 (15:45 -0700)
commit3185cb31340d892a789e7f05d22c441e3c3fb43d
tree8400f88169b3d5b6bdc06638e8dcd254185d0b17
parentca2601c7ac68cbf9fed64e85b33616ed4e201e02
ext4: fix crashes in dioread_nolock mode

Orabug: 23330874

[ Upstream commit 74dae4278546b897eb81784fdfcce872ddd8b2b8 ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 62adae8f26b918f4403129e355d81301a629b6a2)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/ext4/inode.c