Browse files

[PATCH] mpage_end_io_write() I/O error handling fix

When fsync() runs wait_on_page_writeback_range() it only inspects pages which
are actually under I/O (PAGECACHE_TAG_WRITEBACK).  If a page completed I/O
prior to wait_on_page_writeback_range() looking at it, it is supposed to have
recorded its I/O error state in the address_space.

But mpage_mpage_end_io_write() forgot to set the address_space error flag in
this case.

Signed-off-by: Qu Fuping <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
  • Loading branch information...
Qu Fuping Linus Torvalds
Qu Fuping authored and Linus Torvalds committed Jun 4, 2005
1 parent d304506 commit 854715be73b221596c7127d4042e1120d4539e19
Showing with 4 additions and 1 deletion.
  1. +4 −1 fs/mpage.c
@@ -79,8 +79,11 @@ static int mpage_end_io_write(struct bio *bio, unsigned int bytes_done, int err)
if (--bvec >= bio->bi_io_vec)
- if (!uptodate)
+ if (!uptodate){
+ if (page->mapping)
+ set_bit(AS_EIO, &page->mapping->flags);
+ }
} while (bvec >= bio->bi_io_vec);

0 comments on commit 854715b

Please sign in to comment.