aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQu Fuping <fs@ercist.iscas.ac.cn>2005-06-04 18:43:29 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-04 20:12:59 -0400
commit854715be73b221596c7127d4042e1120d4539e19 (patch)
treedb0ddc9d2b9db5de1a75df627ca4a0c28600e64a
parentd3045064054a93d303094cfb96d980cc3c82a64c (diff)
[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 <fs@ercist.iscas.ac.cn> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/mpage.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/mpage.c b/fs/mpage.c
index b92c0e64aefa..bb9aebe93862 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -79,8 +79,11 @@ static int mpage_end_io_write(struct bio *bio, unsigned int bytes_done, int err)
79 if (--bvec >= bio->bi_io_vec) 79 if (--bvec >= bio->bi_io_vec)
80 prefetchw(&bvec->bv_page->flags); 80 prefetchw(&bvec->bv_page->flags);
81 81
82 if (!uptodate) 82 if (!uptodate){
83 SetPageError(page); 83 SetPageError(page);
84 if (page->mapping)
85 set_bit(AS_EIO, &page->mapping->flags);
86 }
84 end_page_writeback(page); 87 end_page_writeback(page);
85 } while (bvec >= bio->bi_io_vec); 88 } while (bvec >= bio->bi_io_vec);
86 bio_put(bio); 89 bio_put(bio);