aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorCurt Wohlgemuth <curtw@google.com>2011-02-26 12:25:52 -0500
committerTheodore Ts'o <tytso@mit.edu>2011-02-26 12:25:52 -0500
commite0fd9b90765f604374c42de8ac59d6584afce264 (patch)
tree04a44bed155b4d99e81d366145934d801036f5e8 /fs/ext4
parent5a54b2f199fdf19533f96c3e285b70c6729e1e4a (diff)
ext4: mark multi-page IO complete on mapping failure
In mpage_da_map_and_submit(), if we have a delayed block allocation failure from ext4_map_blocks(), we need to mark the IO as complete, by setting mpd->io_done = 1; Otherwise, we could end up submitting the pages in an outer loop; since they are unlocked on mapping failure in ext4_da_block_invalidatepages(), this will cause a bug check in mpage_da_submit_io(). I tested this by injected failures into ext4_map_blocks(). Without this patch, a simple fsstress run will bug check; with the patch, it works fine. Signed-off-by: Curt Wohlgemuth <curtw@google.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c6c6b7fcb455..fd369dbce6af 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2314,6 +2314,9 @@ static void mpage_da_map_and_submit(struct mpage_da_data *mpd)
2314 /* invalidate all the pages */ 2314 /* invalidate all the pages */
2315 ext4_da_block_invalidatepages(mpd, next, 2315 ext4_da_block_invalidatepages(mpd, next,
2316 mpd->b_size >> mpd->inode->i_blkbits); 2316 mpd->b_size >> mpd->inode->i_blkbits);
2317
2318 /* Mark this page range as having been completed */
2319 mpd->io_done = 1;
2317 return; 2320 return;
2318 } 2321 }
2319 BUG_ON(blks == 0); 2322 BUG_ON(blks == 0);