Skip to content

Commit 0b96d9b

Browse files
committed
erofs: fix block count report when 48-bit layout is on
Fix incorrect shift order when combining the 48-bit block count. Fixes: 2e1473d ("erofs: implement 48-bit block addressing for unencoded inodes") Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c99fab6 commit 0b96d9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/erofs/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ static int erofs_read_superblock(struct super_block *sb)
323323
sbi->islotbits = ilog2(sizeof(struct erofs_inode_compact));
324324
if (erofs_sb_has_48bit(sbi) && dsb->rootnid_8b) {
325325
sbi->root_nid = le64_to_cpu(dsb->rootnid_8b);
326-
sbi->dif0.blocks = (sbi->dif0.blocks << 32) |
327-
le16_to_cpu(dsb->rb.blocks_hi);
326+
sbi->dif0.blocks = sbi->dif0.blocks |
327+
((u64)le16_to_cpu(dsb->rb.blocks_hi) << 32);
328328
} else {
329329
sbi->root_nid = le16_to_cpu(dsb->rb.rootnid_2b);
330330
}

0 commit comments

Comments
 (0)