Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9508369rwr; Thu, 11 May 2023 16:29:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4KCYK9/e2EQwnXrVOwLfTy08zanA+OaJAiJ3nCMZ8egXcS/c2Dcb5y5lRADtJyMsERMvCE X-Received: by 2002:a05:6a20:394b:b0:101:1b94:31c1 with SMTP id r11-20020a056a20394b00b001011b9431c1mr17670960pzg.42.1683847775278; Thu, 11 May 2023 16:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683847775; cv=none; d=google.com; s=arc-20160816; b=0oexFjViCGvPDLnPn7SbvpXtgPIJkNJVyr9N0FBwiKLRyT3ZOAssu7MlSzsUmnv3QH IhdjWMM/leJCc01A7Av+cixDhaZadn9M5Re89ynk8Jqyrnok2AvFOPdT+Q9YCnnVAQcW r+TayvrpfTlyXszUpWo+cua7rJwwX+cI6ixi+lGJ7CLUAemjX7T1zjGIAX8VHaQ5xYFd 8AameSprukRed2dwzv2JvMKLjwhKRnSWtXpafb6LvzBzDnhEEYDZa3gPGNLh1EXh/zdi R6gJ374ihK0ZfccT7QgHd5SGXr2PDPK76x5DevC2y3ndRIleHPmuAwst3RJG1xtzfDKk +r+Q== 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=ziLOqRw+erBMSM2hE+4jH8oyzrXVMS6KBTmgmvrlozo=; b=ajU2tapBK/RdRT2CY8aHjqxbuF1KSSw1Pi+QSWL+Gb+ZHO5oXdY2zWTCU/5ksXGX5g b1w4Fse0sma1oW7hiLY7WRVKI0xTGUGql1PizHyn6CefCBVfx1oEyTDr7+YJOxC78U6G jaSz1VLpV8ZhO9x7Qp+QxD6k7euKTndkLk3UyM5b7TCNmHQZ+OPhHxhqq3kp2VxNF1mB vaQl6FvtDyKFa8UGKZYxCjYlUxmiZEoBIdVsYC7RNpR6PGCM36UWUrTXZNpTB2kcNQ8j 4Og2yYbZ/rB+d5MvcJ0OuxAA7K5qRb5t2B8hc9zObdqgRJm8zSRURjsSvH4ErY0jFStR jAIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="g/p0s/80"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a63eb45000000b0051902da7a2csi7709886pgk.286.2023.05.11.16.29.23; Thu, 11 May 2023 16:29:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="g/p0s/80"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239247AbjEKXWK (ORCPT + 99 others); Thu, 11 May 2023 19:22:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232390AbjEKXWJ (ORCPT ); Thu, 11 May 2023 19:22:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCA925BA9; Thu, 11 May 2023 16:22:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 775BD6524D; Thu, 11 May 2023 23:22:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1B0FC433EF; Thu, 11 May 2023 23:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683847326; bh=eZGu5MJPJ9fXCT6mKVeohpImVi3IXtivEBhSPsiKHOU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g/p0s/80BuG8QS2NbcgoYi5bEDDMQbmnm/6jBTKkXUW30ndqoiy26r6sptZIfP5rM YpehZ9P9+CPEe5e9iR3XDrKFCrUgPzzVzpOCHo5cZyGbCYYAS9ctngU711QfUHdMJo /8MUgZ7sW7EXte1mhmAGcyefc3buoWgPnQNU9NZVcKvLLPdgL5khJkIvof0ON7I8Eq J8vAIcuuHY4f4hL5Z0F8adnk5cAZ9DKXsARBm1lcHcmlvUAJFSPqVs+7XSTWGkFpNM 03bHzQhgCcFuknqKjJ3otUE1N+o9mVg9/rGE+SptXHC4fFXIXlu9gBBjxTCDPzhV2+ iIgj9GrCQ6joA== Date: Thu, 11 May 2023 16:22:06 -0700 From: "Darrick J. Wong" To: renlei1@chinatelecom.cn Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] xfs: xfs_nfs_get_inode support zero generation Message-ID: <20230511232206.GG858799@frogsfrogsfrogs> References: <1683800241-14488-1-git-send-email-renlei1@chinatelecom.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1683800241-14488-1-git-send-email-renlei1@chinatelecom.cn> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 11, 2023 at 06:17:21PM +0800, renlei1@chinatelecom.cn wrote: > From: Ren Lei > > If generation is zero, bypass the verification of generation number > to avoid stale file error. (Be consistent with other fs, such as > ext4, fat, jfs, etc.) What code is affected by the gen==0 handles being rejected? Is there a user program or test case where this is required? --D > Signed-off-by: Ren Lei > --- > fs/xfs/xfs_export.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c > index 1064c2342876..cbee32c5ad37 100644 > --- a/fs/xfs/xfs_export.c > +++ b/fs/xfs/xfs_export.c > @@ -146,7 +146,7 @@ xfs_nfs_get_inode( > return ERR_PTR(error); > } > > - if (VFS_I(ip)->i_generation != generation) { > + if (generation && VFS_I(ip)->i_generation != generation) { > xfs_irele(ip); > return ERR_PTR(-ESTALE); > } > -- > 2.27.0 >