From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57A803806C8 for ; Mon, 22 Jun 2026 08:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782115908; cv=none; b=Wf5NpoQLq8t14Che8F/6nGz0sr5SRcVwPvnCo+YzRsaSYjoZKEpQ1e99q8TQB6NvbKStRSEJvgvO5/ELAkXiUrJiky95RIgIPDSt3Ukm/hcTnILToJlC6DZ4MdnkPafWTt7qV4zZU9HVTfyc1SrMaWFTUxMR7cFBPp8jfYGazwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782115908; c=relaxed/simple; bh=PCi+2ayPayrYfkd92d6Wy2QebWeL0k/2+8cLxqRNHko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mJfa5IsgxSc1lmjK7Je/BWIHxQqBWgg5VdaZQtIQGbLwPNF1lJcJr+F9zUe9TqZgrjEdhWNsIX3A+tjRBeTK5/nigQJkKKM9WexUY9lI9pgt5oFIZThkKlvSjaRQgjvbL2hkcJt+dp846bVGfXS0ROdb1lG/p5v4L0qwiLMEDFc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XkbOrtvZ; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XkbOrtvZ" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-845369f60faso2315605b3a.3 for ; Mon, 22 Jun 2026 01:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782115907; x=1782720707; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HXYpuDPGj98fITESmoSR7ZVa8CqipenLDj5cFiLsFH0=; b=XkbOrtvZVI66qjFT5T16D3koonT5hIGIE/wZpJ0ZdnKxuqQikQ6guMoqzt+srPi7G/ h7rJa6w1oLCT1VCOFlXi2JQlPguT692CEv0FWf5274JyMrW2SeDJIey+JQD+8RXpnvsy cZLgOViTAg6UipgkJp1pFyeuh96MAnWgFwTOMPxdiQdFHffLuOoyd3LhcfI3DnNaGdZ0 R34vScWk3+cnYTIPlp5B8KW1OFpLhL5JWJtPACDFsW0u2SRFcvikutBzn5hS4BstCoSM c8mQcg1K6yLTSJ9YVo5LCFZIh0onfFv+3iTYe5YHQukf6IOF8i05M0cgxehJaTDH+uQH 1GPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782115907; x=1782720707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HXYpuDPGj98fITESmoSR7ZVa8CqipenLDj5cFiLsFH0=; b=GOKeBuZwqE2XSDPpHR+7GvfLhEUU4RPv/Bg86+WO3ATyfFlDRcY92Ye3JgbfzuOTmC mEUXEyilK/XHYb7rY1NTH7rFULs5OCwWAOm+V44SInqZt4urU+2Gq5Z3N8y3xdSOlGtB rWtQENhGrPXJtqTv4nDiu5KE8K9UumnmnGSz7ohUV1G8NUKM91CR+nvmprTii1KIFKNV kbMppinSWPr9srLA/+Q18HGqmOjtBIyx4ppoGTYJGlwttOHKtnymTO0WcfMyqheX5dj4 i54LPLpLrYSwTrrVvdE3JBPtkAD3FNNWMKTOdJRFkVzM95aPGmLCqAkxI4IZvshaTP+h rRiw== X-Forwarded-Encrypted: i=1; AFNElJ8XB7a3bIcRVfkac37x/uvHntCU/1sHPfwPT1STz+HHrOYDRPYIim+wejVq5OVdOPrkgZaycsYdxikVpOs=@vger.kernel.org X-Gm-Message-State: AOJu0YwMY6YXDNP3X6DR7Kqx33VjMZuOfZJJZBNkiehfxoaNRjHWSXxq iBVlmIfY1Kea33sMsQy06FUnI4vljBr/OCTW8Y7q0WnD9txStE3+0car X-Gm-Gg: AfdE7cmaCpKlDA6IS5d7yYX2bKMRlAzqkdCLwSCup8EgQI5U2MJ2s3qjDn+V4XEAoW1 l0zynrCamimELBvgBEvlrjEgwHrYwh5xS693ZzaWATWMWmNKQJvWgmVy+kj5DmfjzSG7IL52WqN e3XkT6biQBfVA2DvwpvVJkdiMAu5kZr5wDuvJ6zoGdNowydSaywbRbTJJzvS0f2XFIWOBK4I4+t BVWKcsle6Cfz38tKSgqy6hIjLRPMvh3RmhUQxbWMkkCRprcFTj+I9iB3+vR15Fb6Y+LzEuYuwl2 HF3oxrrGVlEQSq4zem2LQ8suucD5D67pzh0hiQCPhwnHXgWogUzytgTBTlbXtSLeLz5quMB3L3e fEyOMIZcL/l9jArgZgU4Qk+BPhf1gwNKqDKwn4bPrb8cI2GtoxRES3eBMHioAWPEDHxE7NystS8 +Ogq89r0mTl1paAKwvwXu1M5s= X-Received: by 2002:a05:6a00:124f:b0:841:89a4:5f86 with SMTP id d2e1a72fcca58-8455088e289mr17450673b3a.21.1782115906596; Mon, 22 Jun 2026 01:11:46 -0700 (PDT) Received: from osman.mioffice.cn ([43.224.245.178]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84564e7696dsm8686514b3a.37.2026.06.22.01.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2026 01:11:45 -0700 (PDT) From: Zhan Xusheng X-Google-Original-From: Zhan Xusheng To: Gao Xiang Cc: Gao Xiang , Chao Yu , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, Zhan Xusheng Subject: [PATCH v2] erofs: handle 48-bit blocks_hi for compressed inodes Date: Mon, 22 Jun 2026 16:11:36 +0800 Message-ID: <20260622081136.2953243-1-zhanxusheng@xiaomi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <5cccd50c-cb18-4fb3-bce0-77bed389d00f@linux.alibaba.com> References: <5cccd50c-cb18-4fb3-bce0-77bed389d00f@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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)) << + (sb->s_blocksize_bits - 9); } if (vi->datalayout == EROFS_INODE_CHUNK_BASED) { -- 2.43.0