diff --git a/fs/erofs/data.c b/fs/erofs/data.c index e228a2d52aaf87e4f0f0e4e9268c58b5ae372c94..99c5da8e633852664e5c4f1273e4c5161c3fb8b0 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -458,6 +458,7 @@ static sector_t erofs_bmap(struct address_space *mapping, sector_t block) struct erofs_map_blocks map = { .m_la = blknr_to_addr(block), }; + erofs_off_t offset = map.m_la; if (EROFS_I(inode)->datalayout == EROFS_INODE_FLAT_INLINE) { erofs_blk_t blks = i_size_read(inode) >> LOG_BLOCK_SIZE; @@ -467,7 +468,7 @@ static sector_t erofs_bmap(struct address_space *mapping, sector_t block) } if (!erofs_map_blocks(inode, &map)) - return erofs_blknr(map.m_pa); + return erofs_blknr(map.m_pa + offset - map.m_la); return 0; }