]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ext4: move unlocked dio protection from ext4_alloc_file_blocks()
authorJan Kara <jack@suse.com>
Mon, 7 Dec 2015 19:29:17 +0000 (14:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 May 2016 21:48:53 +0000 (14:48 -0700)
commite096ade68c13011ba6548a542c1fc00e14555f5c
tree853b4be002e5416b00179fa40bd2997480c52a3a
parent0b680de452570274716c2c9990903acea525f0d0
ext4: move unlocked dio protection from ext4_alloc_file_blocks()

commit 17048e8a083fec7ad841d88ef0812707fbc7e39f upstream.

Currently ext4_alloc_file_blocks() was handling protection against
unlocked DIO. However we now need to sometimes call it under i_mmap_sem
and sometimes not and DIO protection ranks above it (although strictly
speaking this cannot currently create any deadlocks). Also
ext4_zero_range() was actually getting & releasing unlocked DIO
protection twice in some cases. Luckily it didn't introduce any real bug
but it was a land mine waiting to be stepped on.  So move DIO protection
out from ext4_alloc_file_blocks() into the two callsites.

Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/extents.c