aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQu Fuping <qufuping@ercist.iscas.ac.cn>2005-07-15 11:36:08 -0400
committerDave Kleikamp <shaggy@austin.ibm.com>2005-07-15 11:36:08 -0400
commit3d9b1cdd2455017c6aa25bc2442092b81438981f (patch)
tree0f0bf8deaeabc2d14fbded203392ec5bf7dc37ad
parent56d1254917d9f301a8e24155cd3f2236e642cb7d (diff)
JFS: fsync wrong behavior when I/O failure occurs
This is half of a patch that Qu Fuping submitted in April. The first part was applied to fs/mpage.c in 2.6.12-rc4. jfs_fsync should return error, but it doesn't wait for the metadata page to be uptodate, e.g.: jfs_fsync->jfs_commit_inode->txCommit->diWrite->read_metapage-> __get_metapage->read_cache_page reads a page from disk. Because read is async, when read_cache_page: err = filler(data, page), filler will not return error, it just submits I/O request and returns. So, page is not uptodate. Checking only if(IS_ERROR(mp->page)) is not enough, we should add "|| !PageUptodate(mp->page)" Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
-rw-r--r--fs/jfs/jfs_metapage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 8cb803b54bc1..02add5d8ff89 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -640,7 +640,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
640 } else { 640 } else {
641 page = read_cache_page(mapping, page_index, 641 page = read_cache_page(mapping, page_index,
642 (filler_t *)mapping->a_ops->readpage, NULL); 642 (filler_t *)mapping->a_ops->readpage, NULL);
643 if (IS_ERR(page)) { 643 if (IS_ERR(page) || !PageUptodate(mp->page)) {
644 jfs_err("read_cache_page failed!"); 644 jfs_err("read_cache_page failed!");
645 return NULL; 645 return NULL;
646 } 646 }