Skip to content

Commit

Permalink
JFS: fsync wrong behavior when I/O failure occurs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Qu Fuping authored and Dave Kleikamp committed Jul 15, 2005
1 parent 56d1254 commit 3d9b1cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/jfs/jfs_metapage.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
} else {
page = read_cache_page(mapping, page_index,
(filler_t *)mapping->a_ops->readpage, NULL);
if (IS_ERR(page)) {
if (IS_ERR(page) || !PageUptodate(mp->page)) {
jfs_err("read_cache_page failed!");
return NULL;
}
Expand Down

0 comments on commit 3d9b1cd

Please sign in to comment.