Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1138717lqt; Tue, 19 Mar 2024 14:01:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMHUe8XESX7YeQlyNy9jghlu/7hmV2ZREaCnoReS3Uzk2o19RwxxEF08OGTJsLaST66YUFfPEZWIGDjcIH7dAevJqJm7gB0+oNUgU8kw== X-Google-Smtp-Source: AGHT+IEVXTV2BRtirFQ0zd1LjNAFpS/uXDd8ZYMzsqsxg/1x+6GmuaaUy1+YYTnBDyxO1Fd5GwrI X-Received: by 2002:a05:6402:1cd0:b0:568:b5d3:2b89 with SMTP id ds16-20020a0564021cd000b00568b5d32b89mr9763891edb.31.1710882116134; Tue, 19 Mar 2024 14:01:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710882116; cv=pass; d=google.com; s=arc-20160816; b=qs18oT897axJ86rQaemeMl8y9LsUeTi7f/ok4sXzoytIcCU1j1CHfTnCSVcDrwL85H bKQKXVyyBT/8ID+4UGe9WTDoGuFLdTuPqOapouRH9/ptE/z1iFHOWVgnI1kkvg4QjBap YE4A1EX3WBnIzb5tAu+sfQH/pJDMivVaGxvtziLLhJVQPaxmQFnux/dvnhnTC4scAaYG u+rTyUp8qAhzzDHMw+SQCdG4CbOAx4+Qy5PEk+eu8jK9pITD3WXU0U2rSaXedNjpxBsv bp0tSXNqGJzzaODFyNvp6rFMDR9Q9h07A/ewJG9PqjaCcuC8lQ6Rx6+D8KTvD7tBdy5O kTpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aJ7w6RAvJZMqA+99dEWbk5wPqNzDLK64D1vsCdq6Mr8=; fh=iF7TKcfyCKMcEoyn3ycxUxdPqyR/HBZimjCvuok7M6s=; b=VBDFoNYa0Udq3jeyl1d0Ky1EoqDJ3Zs5LGwv9wkU8282Qcw+HD1UlRJKRyXSJj8jHI JfOW+jJygeMAyR1UGuu6nGjPoTk4PxIlTxMqn1d7Td9bApbzv4wj2+JR7rj1692J5HbF G69z6hPoEiQHeGPFC+yooVbvPPn+5Cjo/Og34LEtJj2nxXlt5M9QIxqgSFbdYexI1v3x TBmiSOzVXV+bKYe7UggIjB4baag+3F5x3rc01wOC5YE3Iti6GjTzFCvac33IlzXVv1Kt /nf/Sueo8j9ANViXkckDUO27LA3z/hBVM8tsjNnaBR3u14JisOqs5zU1BN85kEcYhKTX dAyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N3cEqb4U; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-108132-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z15-20020a05640240cf00b00568c4e419e0si3395539edb.324.2024.03.19.14.01.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 14:01:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108132-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N3cEqb4U; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-108132-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0245D1F216E2 for ; Tue, 19 Mar 2024 21:01:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B822405FF; Tue, 19 Mar 2024 21:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N3cEqb4U" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8CDE33E49E; Tue, 19 Mar 2024 21:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710882097; cv=none; b=fP0s5m5bdlDbBcysCOpvQa8hE6X89rDcEtvwCWQJqgmEG4dN0BbYgsG5WzjhsR997/PCwjYVyslRVsXfUBAmIdxzN4BU2T34ZFQr2OZMAXpBoWpBC98n7P4JmP7Oyf7ZVWIYSGuXzwzi54wfLuY0OVyswmFtu1xRVWtcZacbofQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710882097; c=relaxed/simple; bh=TUDK+7jOKxIiMqZBYocYJtdQ1g4v4seILGRV0DTt3xQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YyMWQdL5gwtWj4NNEzBVKZ8GnBDhLJxA9jSrcJ/BoKJqqnKTYHW6trBWaHS4nG9dWqwxTff3JGr6DGfArVpNvZV2PTCmUXvtyQACrBY73YvlbADfnTuuO4wjXpRpI1LXSZMQOGkqYhgG6S8VUBQ8l6+9dPFcD16l40p0n3UR/Pc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N3cEqb4U; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B7C1C43399; Tue, 19 Mar 2024 21:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710882097; bh=TUDK+7jOKxIiMqZBYocYJtdQ1g4v4seILGRV0DTt3xQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N3cEqb4UBKeDtRpOlfjZg01BhZfzqr7+Qtjy5Ntn7aqW7F//V6PeDgVrE1p4M6lYb 5hvSbxMvV8ItPjuMQhAs/XBHc8ht1HQyE7d474kcKHPYw22M1SDTVjH4r8wEuw4LEN /5nMeQvyZtoi/j4Gj+xiYPGM+iN3yVZIpyA5wyRsxsL5lkGTtjuXboT3hlBi+kMEnG drQOC+llGExWHRqPYC2PLuTHc7cElbaEzQq7Jwag0k10CmXP2iHueDCNVHQyPtXYyV kurmwvwSwDbqZDbZgDs5sz/pijuka5A5mDEjNQeIpi1j91mN3Jn/c11xx0jp/EjEvR VDl/OJmN//xhA== Date: Tue, 19 Mar 2024 14:01:36 -0700 From: "Darrick J. Wong" To: Zhang Yi Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, brauner@kernel.org, david@fromorbit.com, tytso@mit.edu, jack@suse.cz, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [PATCH v3 2/9] xfs: make the seq argument to xfs_bmapi_convert_delalloc() optional Message-ID: <20240319210136.GI1927156@frogsfrogsfrogs> References: <20240319011102.2929635-1-yi.zhang@huaweicloud.com> <20240319011102.2929635-3-yi.zhang@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240319011102.2929635-3-yi.zhang@huaweicloud.com> On Tue, Mar 19, 2024 at 09:10:55AM +0800, Zhang Yi wrote: > From: Zhang Yi > > Allow callers to pass a NULLL seq argument if they don't care about > the fork sequence number. > > Signed-off-by: Zhang Yi > Reviewed-by: Christoph Hellwig Aha, you want this because xfs_bmbt_to_iomap will set the iomap validity cookie for us, whereas writeback wants to track the per-fork cookie in the xfs writeback structure. Ok. Reviewed-by: Darrick J. Wong --D > --- > fs/xfs/libxfs/xfs_bmap.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c > index f362345467fa..07dc35de8ce5 100644 > --- a/fs/xfs/libxfs/xfs_bmap.c > +++ b/fs/xfs/libxfs/xfs_bmap.c > @@ -4574,7 +4574,8 @@ xfs_bmapi_convert_delalloc( > if (!isnullstartblock(bma.got.br_startblock)) { > xfs_bmbt_to_iomap(ip, iomap, &bma.got, 0, flags, > xfs_iomap_inode_sequence(ip, flags)); > - *seq = READ_ONCE(ifp->if_seq); > + if (seq) > + *seq = READ_ONCE(ifp->if_seq); > goto out_trans_cancel; > } > > @@ -4623,7 +4624,8 @@ xfs_bmapi_convert_delalloc( > ASSERT(!isnullstartblock(bma.got.br_startblock)); > xfs_bmbt_to_iomap(ip, iomap, &bma.got, 0, flags, > xfs_iomap_inode_sequence(ip, flags)); > - *seq = READ_ONCE(ifp->if_seq); > + if (seq) > + *seq = READ_ONCE(ifp->if_seq); > > if (whichfork == XFS_COW_FORK) > xfs_refcount_alloc_cow_extent(tp, bma.blkno, bma.length); > -- > 2.39.2 > >