Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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>

authored by

Qu Fuping and committed by
Linus Torvalds
854715be d3045064

+4 -1
+4 -1
fs/mpage.c
··· 79 79 if (--bvec >= bio->bi_io_vec) 80 80 prefetchw(&bvec->bv_page->flags); 81 81 82 - if (!uptodate) 82 + if (!uptodate){ 83 83 SetPageError(page); 84 + if (page->mapping) 85 + set_bit(AS_EIO, &page->mapping->flags); 86 + } 84 87 end_page_writeback(page); 85 88 } while (bvec >= bio->bi_io_vec); 86 89 bio_put(bio);