Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4377659rdh; Tue, 28 Nov 2023 22:34:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRxhJKn68N9/SfH2zKCHgXUM1tmGcUjyZhfSE9ihyEr/2cdVip/+kgXpYjBZP3VbEQ069v X-Received: by 2002:a17:902:d507:b0:1cf:cd33:42f2 with SMTP id b7-20020a170902d50700b001cfcd3342f2mr15076326plg.33.1701239686671; Tue, 28 Nov 2023 22:34:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701239686; cv=none; d=google.com; s=arc-20160816; b=SCjrLKhaXz6kz3Yga5aEb5U0WcuVFjatgFIT1Gb/X4kyyBbsJYinVdHmXTJn+xTqU0 7KCSNMyj4eEwGIV83acDk48mKNfn25Ny0rmzMh5m6Y36rIAd0XIIDAhLNG8OF2iMu+KP NgVRnsd2vklpdVZxO78qWEC5fB8eRSLMF61WMRq00z8de9vPqsMJ5+0er1AZGPXSPiaX e/BYcB5Y7aUgrUcsVtsx+yCpTTttOT2IxQ7GhLdMYhxIqd0FJSOZbKz7PhhV5825fFrn Nz6K1PgqB9GNkeq4Q52Vh6VVzzOVPPGaSLEZcSPqupBBaGRDE+f9TLlYHh7SzIvFuffT wQig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ulf19nfBQHPuPxCGQHOzwBZJuVqNELpQrEmrVGly6ec=; fh=t9rOFoIC6YQWwVrfAfuVJGLnQIgwyjhVwmizg1NaXCk=; b=oJBcSTmXjGxG+x2PACSA503dZppQT379wjb/LT3+Gt+mZnEDAiZO63uWqfoVsJrjwR /Uklc5FuiF7cFhyI3mqC/wxr/s6abO0Be0nU+9t2lMY8Fs7xo5hCXzBXxgF7mgkBltS3 vrSwBxg2vygHFTT8jbXC2gqRPLLh1hFdDBEOQl1BKeFQ6TjpbsJDEwwG2bxonnXmBVYj 3hWHu+RlExmI39AadLSiTvxtfi/gymfWIkFTVwRzQli27yHw2JDDrr1kQzX4TAPJf9l3 mrILMYq3Lrmq56X9NG9qPtyXQ7bhiCE6PD8wjCdop/I/UfWrC39414KIco84BaMissqc piaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=n+Yx1exG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id n1-20020a170902968100b001d0068a4a3dsi2090964plp.410.2023.11.28.22.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 22:34:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=n+Yx1exG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 197678068C52; Tue, 28 Nov 2023 22:34:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231271AbjK2GeV (ORCPT + 99 others); Wed, 29 Nov 2023 01:34:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjK2GeU (ORCPT ); Wed, 29 Nov 2023 01:34:20 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1475170B; Tue, 28 Nov 2023 22:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ulf19nfBQHPuPxCGQHOzwBZJuVqNELpQrEmrVGly6ec=; b=n+Yx1exGjzqdszhwKYniFvLsDF K1pwUEBrOzoc1E4ykAB0pwVEHMBZ8OsioglebBjMv8B/xY3MQ91GWk9jlNy5FXGDo54r+6VSMGe6p WB8o+R5MeB3xKOZhvMFiwjTCGtr/1Iw7gyoWEm5MDAZrcx2ogosDH/stGAAZtOzoXTUZsoXC5y5dC sGQcMMLYgNIAVgQGmTTsyDc8dSQs/Sh97D3bKXFvbkrnl9VNsspWNsShw+TMVGdOzhS3M0zxXSyOF 82ajo//BhyVD6Kgb7CKV84rTWE9cUUeFdZWO+jq4e2+e0wdhL+4dj8J4wc0Vti9xGA74osd9Df19p rfZKNWWg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1r8E9B-007FOS-2Y; Wed, 29 Nov 2023 06:34:09 +0000 Date: Tue, 28 Nov 2023 22:34:09 -0800 From: Christoph Hellwig To: Dave Chinner Cc: Jiachen Zhang , Chandan Babu R , "Darrick J. Wong" , Dave Chinner , Allison Henderson , Zhang Tianci , Brian Foster , Ben Myers , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, xieyongji@bytedance.com, me@jcix.top Subject: Re: [PATCH 2/2] xfs: update dir3 leaf block metadata after swap Message-ID: References: <20231128053202.29007-1-zhangjiachen.jaycee@bytedance.com> <20231128053202.29007-3-zhangjiachen.jaycee@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 22:34:44 -0800 (PST) On Wed, Nov 29, 2023 at 10:15:52AM +1100, Dave Chinner wrote: > > + /* > > + * Update the moved block's blkno if it's a dir3 leaf block > > + */ > > + if (dead_info->magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || > > + dead_info->magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC) || > > + dead_info->magic == cpu_to_be16(XFS_ATTR3_LEAF_MAGIC)) { > > a.k.a. > > if (xfs_has_crc(mp)) { > > i.e. this is not specific to the buffer type being processed, it's > specific to v4 vs v5 on-disk format. Hence it's a fs-feature check, > not a block magic number check. We have these magic based checks in quite a few places right now, so I'm not surprised that Jiachen picked it up from there..