Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1011800lqj; Mon, 3 Jun 2024 07:45:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGRu/3wMpN5eVaC66fAGbxaS05gSdA7UiaoDDBgg6r+EBE4DLQ1viiYyYuFX5Gsfv7vpr0pCWvBFLlVCTy9W0RGZ4G2W/IZOuIEq4vmA== X-Google-Smtp-Source: AGHT+IHon+HazXMVjXVtggQZPQ8I/o68jqYAgSzLj+TQH69cSi8wOsH95VDXZgNtwzW3kV+Z54Ve X-Received: by 2002:a05:6358:7d92:b0:18a:e062:ff55 with SMTP id e5c5f4694b2df-19b483c6690mr1269013755d.0.1717425915703; Mon, 03 Jun 2024 07:45:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717425915; cv=pass; d=google.com; s=arc-20160816; b=EFjwwfgx01s9avOnQdTH0+oGhMbZ24L3HIv3d9r88ey6fxQnucZf0PJKz12LBUYQWI o5GnCNXgvw4VWzFiMyAtwrQdQaq6/u2sk3/HobUqs2r6pPLaYOfP/+oUEDesemMQssSt 5foQ1lsCwo5GtHMtMg97vrvNM9fHGZtb2SYdcXfGv90/rZKHlTMbuRZvj6RGUoGGjFS1 9eqtX23ueWE/Qsmv19pJvLuo5rOw0IOu7Nb3SukQGVGN7F90Ax/c4MpvSjkmSuAMsF16 ebZrp8XZa739pJOTZKJz39dtxQMkqAFXLkT2MTqyf97wfnDmfZ7KAtoBDat9HFFfu6Gf xhrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject; bh=L+uqSfc91//66BWdWOPVm7XUNnFHwid3ACe/jD/P0Ik=; fh=L3PQw/sDNVqL7+Dk7hdPqK3pZ11REqGLfT6DRoUjXwU=; b=uP0vmf2GxpTTi2Aksl2LfMBx8zfqdv6rcbvtI9+JyECoakgWF/FFdNhYGRZhsr7CJS MknK+AOqsFPsq/mS+Ik8tUNNo1ndMMU4UHapsCDVTu8VpgUEY03KJ+RoeMGtGvrlkc6R 9xzOOonLpnfrx7MYpflJf/CYiE5tdnxWbHZXAS9RgUb4kM6WvTBSiTxFWBjdF/MfbShL F1GcSlXX2jvwgC5R4tVZBh23lX/mvDoUFiHI7K2WgmUT+K+4V0ktrwQZBgjP6AK++bFz 1+Zf9ogIjVWscg8oK+Svo4rnREZmb6CRmUsLdpft7SwsCzPC1N8jWO8HDjHFDiCqFjaH it8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-199301-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199301-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540fb193si6916933a12.63.2024.06.03.07.45.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 07:45:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199301-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-199301-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199301-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B6F87B24E1B for ; Mon, 3 Jun 2024 14:35:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D341212FB1B; Mon, 3 Jun 2024 14:35:42 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (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 26C1A12EBE6; Mon, 3 Jun 2024 14:35:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717425342; cv=none; b=NbzTF9GRVegzYBzvCWL9Q/IdVZe8uVYLfIGjxv7Jj0txtVAG6Mym0XDWpXSSsT0hKNkbZubyiW65B/wTZvbtLl/uETx0zYW2VLsHhrDWiLxmpb2u5CrjnML7w4oFJEZH3X4mVSUiBvwHftKKqgv2+Ny/xFu/uHsJnTcGe2Szud8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717425342; c=relaxed/simple; bh=aS7WNKyb79nHjkRKjId2BNPG35Iq9xA2er2JeQ/uKJA=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=rrwMWhg7LKqQcxGxJGo0dLnpMv/m7sXE8eSbNNuijnyJH0BfoNhTKZEKzhPGuUb0xAohwUEUqN5tPkdsQJuu2Wg//wIqCGRRZVK7a77PIYjxVP21PfObFWQlCOUfgnlScHotdyegcWcR+gUHmo/82vAWlCl/PPin9Ro/D+bmqEg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VtGV96W3Vz4f3jkk; Mon, 3 Jun 2024 22:35:29 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 2D4441A0170; Mon, 3 Jun 2024 22:35:36 +0800 (CST) Received: from [10.174.179.80] (unknown [10.174.179.80]) by APP2 (Coremail) with SMTP id Syh0CgDnCg621F1mAppQOw--.29601S3; Mon, 03 Jun 2024 22:35:36 +0800 (CST) Subject: Re: [RFC PATCH v4 6/8] xfs: correct the truncate blocksize of realtime inode To: Christoph Hellwig Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, djwong@kernel.org, brauner@kernel.org, david@fromorbit.com, chandanbabu@kernel.org, jack@suse.cz, willy@infradead.org, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com References: <20240529095206.2568162-1-yi.zhang@huaweicloud.com> <20240529095206.2568162-7-yi.zhang@huaweicloud.com> From: Zhang Yi Message-ID: <67a811e0-6723-3bb6-5f74-a66610b884a0@huaweicloud.com> Date: Mon, 3 Jun 2024 22:35:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CM-TRANSID:Syh0CgDnCg621F1mAppQOw--.29601S3 X-Coremail-Antispam: 1UD129KBjvdXoWrury3tryDtr4xWw18Jr4xJFb_yoWxZrc_ua y5Ar92g3WkWFn5Aa17Cr15GF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 05:52:04PM +0800, Zhang Yi wrote: >> + if (xfs_inode_has_bigrtalloc(ip)) >> + first_unmap_block = xfs_rtb_roundup_rtx(mp, first_unmap_block); > > Given that first_unmap_block is a xfs_fileoff_t and not a xfs_rtblock_t, > this looks a bit confusing. I'd suggest to just open code the > arithmetics in xfs_rtb_roundup_rtx. For future proofing my also > use xfs_inode_alloc_unitsize() as in the hunk below instead of hard > coding the rtextsize. I.e.: > > first_unmap_block = XFS_B_TO_FSB(mp, > roundup_64(new_size, xfs_inode_alloc_unitsize(ip))); > Sure, makes sense to me. Thanks, Yi.