author: Gao Xiang <gaoxiang25@huawei.com> 2019-09-22 02:43:55 +0800
committer: Gao Xiang <gaoxiang25@huawei.com> 2019-10-01 04:54:33 +0800
commit: 55252ab72b774119afedfdc6d1f142ffa2a9b818
parent: 6927cc05c2b067d4ca8ab6aeaa3b4544bea26ef8
Commit Summary:
Diffstat:
1 file changed, 7 insertions, 3 deletions
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index 8a9fcbd0e8ac..fc3a8d8064f8 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -34,11 +34,15 @@ static void erofs_readendio(struct bio *bio)
struct page *erofs_get_meta_page(struct super_block *sb, erofs_blk_t blkaddr)
{
- struct inode *const bd_inode = sb->s_bdev->bd_inode;
- struct address_space *const mapping = bd_inode->i_mapping;
+ struct address_space *const mapping = sb->s_bdev->bd_inode->i_mapping;
+ struct page *page;
- return read_cache_page_gfp(mapping, blkaddr,
+ page = read_cache_page_gfp(mapping, blkaddr,
mapping_gfp_constraint(mapping, ~__GFP_FS));
+ /* should already be PageUptodate */
+ if (!IS_ERR(page))
+ lock_page(page);
+ return page;
}
static int erofs_map_blocks_flatmode(struct inode *inode,