mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
erofs: handle 48-bit blocks_hi for compressed inodes
Combine i_nb.blocks_hi with i_u.blocks_lo when computing inode->i_blocks for compressed inodes, mirroring the startblk_hi handling for unencoded inodes a few lines above. Also evaluate the shift in u64 to avoid truncation. Fixes:efb2aef569("erofs: add encoded extent on-disk definition") Fixes:1d191b4ca5("erofs: implement encoded extent metadata") Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
This commit is contained in:
parent
c37460cd9b
commit
803d09a554
|
|
@ -191,8 +191,9 @@ static int erofs_read_inode(struct inode *inode)
|
|||
err = -EFSCORRUPTED;
|
||||
goto err_out;
|
||||
} else {
|
||||
inode->i_blocks = le32_to_cpu(copied.i_u.blocks_lo) <<
|
||||
(sb->s_blocksize_bits - 9);
|
||||
inode->i_blocks = (le32_to_cpu(copied.i_u.blocks_lo) |
|
||||
((u64)le16_to_cpu(copied.i_nb.blocks_hi) << 32)) <<
|
||||
(sb->s_blocksize_bits - 9);
|
||||
}
|
||||
|
||||
if (vi->datalayout == EROFS_INODE_CHUNK_BASED) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user