From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6513436DA0B for ; Mon, 22 Jun 2026 07:43:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782114197; cv=none; b=XP+iAXIO+HctbYZ2uQYunu+CEmgytHVOrSoaCMWKL8ZlpLCyvR6MG7P6+OQXDrrBOODOl11C3VGqEMBXBsapm645TFU44+MvFRxvFO3kxSQKk8+ZgTG6BVGMTuGUcv8d9ID9WpWR4S17T1bkRdpiX0R8XmH6XERm9FgaS5Q8xcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782114197; c=relaxed/simple; bh=Ml32vz1ecARNemyBlyTImtIalRE23FIFwr/y4WBOw/I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oucE2WOY8cJiZCS1PMNXQ2HCc73ykjGUx+A/bVjvJeZNYIXE0AZhk/VtXp4poV8am6uR8Hn2QqNxNPUNVDhAhT2IGFyTgUEIkiWGz2QnY9lJiiGzeeGk0HqOLHaMHvpj/l0Ihv0MHlN8bprgUEHMbBv5vZMvpsnDW9PDIWmAKaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=N4y+Sy1a; arc=none smtp.client-ip=115.124.30.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="N4y+Sy1a" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1782114186; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=J2fYnqjCDE8tBTCVScf641JKO8z0KyHfKnYhzc9QNPs=; b=N4y+Sy1ap8pzOQCSr4oboFbSx+ckkPP9CYXvHRvBUmn5bbs8xt5vtBzqrekZFR98Xr15GahcSxPv2D+qeMYroQG+2pITTFJK3h/9Yz9q5RxMC/P43/2gnhzDN51fkIGFPE1QHxXsFOz7L5LW/nOMhbCgCCSBH2mQU2XLJI7bYRg= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032089153;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0X5K7Vyu_1782114184; Received: from 30.221.130.114(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0X5K7Vyu_1782114184 cluster:ay36) by smtp.aliyun-inc.com; Mon, 22 Jun 2026 15:43:05 +0800 Message-ID: <5cccd50c-cb18-4fb3-bce0-77bed389d00f@linux.alibaba.com> Date: Mon, 22 Jun 2026 15:43:04 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] erofs: handle 48-bit blocks_hi for compressed inodes To: Zhan Xusheng , Gao Xiang Cc: Chao Yu , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, Zhan Xusheng References: <20260622073410.2934415-1-zhanxusheng@xiaomi.com> From: Gao Xiang In-Reply-To: <20260622073410.2934415-1-zhanxusheng@xiaomi.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Xusheng, On 2026/6/22 15:34, Zhan Xusheng wrote: > 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: 2e1473d5195f ("erofs: implement 48-bit block addressing for unencoded inodes") It's not the right fix, it should be efb2aef569b3 since the pcluster layout only allows 32-bit addresssing for now. > Signed-off-by: Zhan Xusheng > --- > fs/erofs/inode.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c > index a188c570087a..cf2f00e13cae 100644 > --- a/fs/erofs/inode.c > +++ b/fs/erofs/inode.c > @@ -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 = ((u64)le16_to_cpu(copied.i_nb.blocks_hi) << 32 | > + le32_to_cpu(copied.i_u.blocks_lo)) << > + (sb->s_blocksize_bits - 9); I hope it could be: 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); to explicitly use "()" and avoid overly long lines. Thanks, Gao Xiang > } > > if (vi->datalayout == EROFS_INODE_CHUNK_BASED) {