From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (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 D84EA38F624 for ; Mon, 22 Jun 2026 08:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782117405; cv=none; b=uypDjClMo9I2Q7H85B30W3+Wd1re86H0Y9OGRBYCyGfSNJ35aAircPYQ5osGP8eDnvmBOHNanOBd68k/L0CXz8qjYAEerrQazqt4/SKYpT9P4igHyq4dkGQM8S2XeYwZFICtOqboibNNSLbAoSHv+EHoZuy5tq06n3C0nxl8HP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782117405; c=relaxed/simple; bh=WfmU09ed9gCTuz4M2Z6fQradhyt+CwHJZ4ZtzKxYu8U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pduNERQKlj0epQkIul9HXCPBOP0DBwk9yjtIKtNKTTMNm3TcU6uYTzbk72k5XmbGSaCoQrbKGhl5qQT7l9vDkXyHnwb4BwJiE1rOMxwC2sQt63qNzSY+Ip0+Jau8z4v65ukQ7g1SXIKFZ2I9q+lbVBcefCsOfQk28f4e9yimyxE= 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=UQ3h7Q00; arc=none smtp.client-ip=115.124.30.132 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="UQ3h7Q00" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1782117399; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=7BH7itEF3mRjlqM+FpQ6A2AOLeIQy2CEWqh5t3jQ15k=; b=UQ3h7Q00es0Yx4+t4iZmsRa3cUjtBjUByFj8vZg4D4APPB5SF11RxQv5fDFR3eauEA0R6bHp+m977yyiKT/lV0gLDegGXwLado4mrC7ny/GYhoClni7WDwMnX+jJ6u83xxNLdqQ5ln28UYvbeOaaaHJVLMFk2dVGjGtrLIEA9Pk= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037009110;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0X5KMEH2_1782117398; Received: from 30.221.130.114(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0X5KMEH2_1782117398 cluster:ay36) by smtp.aliyun-inc.com; Mon, 22 Jun 2026 16:36:39 +0800 Message-ID: Date: Mon, 22 Jun 2026 16:36:38 +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 v2] erofs: handle 48-bit blocks_hi for compressed inodes To: Zhan Xusheng Cc: Gao Xiang , Chao Yu , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, Zhan Xusheng References: <5cccd50c-cb18-4fb3-bce0-77bed389d00f@linux.alibaba.com> <20260622081136.2953243-1-zhanxusheng@xiaomi.com> From: Gao Xiang In-Reply-To: <20260622081136.2953243-1-zhanxusheng@xiaomi.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2026/6/22 16:11, 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: efb2aef569b3 ("erofs: add encoded extent on-disk definition") > Signed-off-by: Zhan Xusheng > --- > v2: > - Fix the Fixes: tag to efb2aef569b3 ("erofs: add encoded extent > on-disk definition"), the commit that introduced blocks_hi for > compressed inodes (Gao Xiang) > - Reorder to "blocks_lo | (blocks_hi << 32)" with explicit parentheses > and shorter lines (Gao Xiang) > > 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..dc0e3d6bb2b1 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 = (le32_to_cpu(copied.i_u.blocks_lo) | > + ((u64)le16_to_cpu(copied.i_nb.blocks_hi) << 32)) << I will change this line to ((u64)le16_to_cpu(copied.i_nb.blocks_hi) << 32)) << to avoid overly long lines (since such alignment is not strictly necessary but overly long lines should be avoided), otherwise it looks good to me, Reviewed-by: Gao Xiang Thanks, Gao Xiang