Commit 55252ab7 authored by Gao Xiang's avatar Gao Xiang
Browse files

erofs: fix erofs_get_meta_page locking due to a cleanup

After doing more drop_caches stress test on
our products, I found the mistake introduced by
a very recent cleanup [1].

The current rule is that "erofs_get_meta_page"
should be returned with page locked (although
it's mostly unnecessary for read-only fs after
pages are PG_uptodate), but a fix should be
done for this.

Fixes: 618f40ea

 ("erofs: use read_cache_page_gfp for erofs_get_meta_page")
Reviewed-by: default avatarChao Yu <>

Signed-off-by: default avatarGao Xiang <>
parent 6927cc05
......@@ -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))
return page;
static int erofs_map_blocks_flatmode(struct inode *inode,
Supports Markdown
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