]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ext4: Implement range_cyclic in ext4_da_writepages instead of write_cache_pages
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 24 Feb 2009 17:14:47 +0000 (12:14 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Mar 2009 00:32:41 +0000 (17:32 -0700)
commitc4925e4c65904e5c52cd3a3e5e9b1873eec340c0
tree53bc3d560c3d8d355dbf17c6f38015ba55d0edc3
parent6da0e051ce63fd4351830c1ce31a9c6d8e9ffa92
ext4: Implement range_cyclic in ext4_da_writepages instead of write_cache_pages

(cherry picked from commit 2acf2c261b823d9d9ed954f348b97620297a36b5)

With delayed allocation we lock the page in write_cache_pages() and
try to build an in memory extent of contiguous blocks.  This is needed
so that we can get large contiguous blocks request.  If range_cyclic
mode is enabled, write_cache_pages() will loop back to the 0 index if
no I/O has been done yet, and try to start writing from the beginning
of the range.  That causes an attempt to take the page lock of lower
index page while holding the page lock of higher index page, which can
cause a dead lock with another writeback thread.

The solution is to implement the range_cyclic behavior in
ext4_da_writepages() instead.

http://bugzilla.kernel.org/show_bug.cgi?id=12579

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/inode.c