linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ext4: mark multi-page IO complete on mapping failure
@ 2011-02-18 21:31 Curt Wohlgemuth
  2011-02-18 21:31 ` [PATCH 2/2] ext4: fix ext4_da_block_invalidatepages() to handle page range properly Curt Wohlgemuth
  2011-02-26 18:54 ` [PATCH 1/2] ext4: mark multi-page IO complete on mapping failure Ted Ts'o
  0 siblings, 2 replies; 4+ messages in thread
From: Curt Wohlgemuth @ 2011-02-18 21:31 UTC (permalink / raw)
  To: linux-ext4; +Cc: Curt Wohlgemuth

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>
---
 fs/ext4/inode.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 9f7f9e4..1cff229 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)
 		/* invalidate all the pages */
 		ext4_da_block_invalidatepages(mpd, next,
 				mpd->b_size >> mpd->inode->i_blkbits);
+
+		/* Mark this page range as having been completed */
+		mpd->io_done = 1;
 		return;
 	}
 	BUG_ON(blks == 0);
-- 
1.7.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-26 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-18 21:31 [PATCH 1/2] ext4: mark multi-page IO complete on mapping failure Curt Wohlgemuth
2011-02-18 21:31 ` [PATCH 2/2] ext4: fix ext4_da_block_invalidatepages() to handle page range properly Curt Wohlgemuth
2011-02-26 18:54   ` Ted Ts'o
2011-02-26 18:54 ` [PATCH 1/2] ext4: mark multi-page IO complete on mapping failure Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).