summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2025-08-07 16:20:19 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-20 18:40:51 +0200
commitf5462fabede98fcc21f6e078484743ef1184bb4a (patch)
treeff994b5b2f77e3dc46170ae0b62f0bf4f7a63807
parent7e1e6cc71b3c6472485fab01232a9586017cc45c (diff)
erofs: fix block count report when 48-bit layout is on
[ Upstream commit 0b96d9bed324a1c1b7d02bfb9596351ef178428d ] Fix incorrect shift order when combining the 48-bit block count. Fixes: 2e1473d5195f ("erofs: implement 48-bit block addressing for unencoded inodes") Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20250807082019.3093539-1-hsiangkao@linux.alibaba.com Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/erofs/super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index e1e9f06e8342..799fef437aa8 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -313,8 +313,8 @@ static int erofs_read_superblock(struct super_block *sb)
sbi->islotbits = ilog2(sizeof(struct erofs_inode_compact));
if (erofs_sb_has_48bit(sbi) && dsb->rootnid_8b) {
sbi->root_nid = le64_to_cpu(dsb->rootnid_8b);
- sbi->dif0.blocks = (sbi->dif0.blocks << 32) |
- le16_to_cpu(dsb->rb.blocks_hi);
+ sbi->dif0.blocks = sbi->dif0.blocks |
+ ((u64)le16_to_cpu(dsb->rb.blocks_hi) << 32);
} else {
sbi->root_nid = le16_to_cpu(dsb->rb.rootnid_2b);
}