aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-08-31 17:00:59 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-14 08:06:19 -0800
commit63762a2387882e4ff8ae77133b331abef8e6f555 (patch)
treee0e1d09a2c9bfaa070b78375e3064baba0ca4f1f /fs
parente4670b394dd5cdfc5fda17e3ec94c444dcaecac2 (diff)
ext4: Restore wbc->range_start in ext4_da_writepages()
(cherry picked from commit de89de6e0cf4b1eb13f27137cf2aa40d287aabdf) To solve a lock inversion problem, we implement part of the range_cyclic algorithm in ext4_da_writepages(). (See commit 2acf2c26 for more details.) As part of that change wbc->range_start was modified by ext4's writepages function, which causes its callers to get confused since they aren't expecting the filesystem to modify it. The simplest fix is to save and restore wbc->range_start in ext4_da_writepages. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 04c5a355efd..ce895662802 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2750,6 +2750,7 @@ static int ext4_da_writepages(struct address_space *mapping,
long pages_skipped;
int range_cyclic, cycled = 1, io_done = 0;
int needed_blocks, ret = 0, nr_to_writebump = 0;
+ loff_t range_start = wbc->range_start;
struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb);
trace_ext4_da_writepages(inode, wbc);
@@ -2918,6 +2919,7 @@ out_writepages:
if (!no_nrwrite_index_update)
wbc->no_nrwrite_index_update = 0;
wbc->nr_to_write -= nr_to_writebump;
+ wbc->range_start = range_start;
trace_ext4_da_writepages_result(inode, wbc, ret, pages_written);
return ret;
}