Commit 11ab8319 authored by Dave Kleikamp's avatar Dave Kleikamp Committed by Jeff Layton

JFS: do not ignore return code from write_one_page()

There are a couple places where jfs calls write_one_page() where clean
recovery is not possible.  In these cases, the file system should be
marked dirty.  To do this, it is now necessary to store the superblock in
the metapage structure.

Link: http://lkml.kernel.org/r/db45ab67-55c7-08ff-6776-f76b3bf5cbf5@oracle.comSigned-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
Cc: Jeff Layton <jlayton@redhat.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
parent 2b69c828
...@@ -664,6 +664,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, ...@@ -664,6 +664,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
INCREMENT(mpStat.pagealloc); INCREMENT(mpStat.pagealloc);
mp = alloc_metapage(GFP_NOFS); mp = alloc_metapage(GFP_NOFS);
mp->page = page; mp->page = page;
mp->sb = inode->i_sb;
mp->flag = 0; mp->flag = 0;
mp->xflag = COMMIT_PAGE; mp->xflag = COMMIT_PAGE;
mp->count = 1; mp->count = 1;
...@@ -711,7 +712,8 @@ void force_metapage(struct metapage *mp) ...@@ -711,7 +712,8 @@ void force_metapage(struct metapage *mp)
get_page(page); get_page(page);
lock_page(page); lock_page(page);
set_page_dirty(page); set_page_dirty(page);
write_one_page(page); if (write_one_page(page))
jfs_error(mp->sb, "write_one_page() failed\n");
clear_bit(META_forcewrite, &mp->flag); clear_bit(META_forcewrite, &mp->flag);
put_page(page); put_page(page);
} }
...@@ -756,7 +758,8 @@ void release_metapage(struct metapage * mp) ...@@ -756,7 +758,8 @@ void release_metapage(struct metapage * mp)
set_page_dirty(page); set_page_dirty(page);
if (test_bit(META_sync, &mp->flag)) { if (test_bit(META_sync, &mp->flag)) {
clear_bit(META_sync, &mp->flag); clear_bit(META_sync, &mp->flag);
write_one_page(page); if (write_one_page(page))
jfs_error(mp->sb, "write_one_page() failed\n");
lock_page(page); /* write_one_page unlocks the page */ lock_page(page); /* write_one_page unlocks the page */
} }
} else if (mp->lsn) /* discard_metapage doesn't remove it */ } else if (mp->lsn) /* discard_metapage doesn't remove it */
......
...@@ -38,6 +38,7 @@ struct metapage { ...@@ -38,6 +38,7 @@ struct metapage {
/* implementation */ /* implementation */
struct page *page; struct page *page;
struct super_block *sb;
unsigned int logical_size; unsigned int logical_size;
/* Journal management */ /* Journal management */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment