]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:44 +0000 (15:45 -0700)
commitce2d8bf9508e231afecbb9054b94650fc030a2d3
treea79b3e27e733583632a2a0bf66f4b40ae50829d0
parent88080088ce54f35a8e8b7e9994c4f5d43c39be0c
ext4: move unlocked dio protection from ext4_alloc_file_blocks()

Orabug: 23331010

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>
Reviewed-by: Mingming Cao <mingming.cao@oracle.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 9621787d69783fc23d14e1332377d7170d6928ed)

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