Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8646106rwr; Thu, 11 May 2023 04:28:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CXLLbKIOdb5xhZNQoMgaFvgkslgu6WFQhoaaIqaXMK/hDMx92aSz6ZeA9m+pB5Kgc6Sd8 X-Received: by 2002:a17:902:edd0:b0:1aa:e425:2527 with SMTP id q16-20020a170902edd000b001aae4252527mr21526177plk.21.1683804485363; Thu, 11 May 2023 04:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683804485; cv=none; d=google.com; s=arc-20160816; b=Lf7fokeZfJSMVzJGE/DESqoCn2lKm/55EejMnKZS+yo3A240N2mtA+Sxl89O7Vg2uc 2m2WoS8UMUp5r0qgTQUihm+7lf80qShK7hRKdTXOZKUjXW+h73DL4ahkkdBLheWIG+Me ewJgKcepBxDy2OU1LV1RhjPzHDCCtZhD6JmFewVv7Xz2icYhXJklMSFt3Vd05z7VtSF5 TtHiCFsWP44Rklf600gO+ZBqhwiIZIjGWmPoYXNEw9+AYmoKcq0iwTc+BUiJ8fF4Bb1U d1dEGi4Evmq/g73ANcGci1Z65EwkgUslY0Ik5jLMyIR7zuCvAzcb6SZTdq/lyIKF0iiR qy1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:sender :hmm_source_type:hmm_attache_num:hmm_source_ip; bh=TAN7U7E9dJRbZbj7ev6VI4yDVjpDRdivIkfT1PQQJxM=; b=aM4KRjBWx7XW462vjBjPRr/yD8lSwJeode1A7+WGnNsgiJmotzq+RUBde9D4EiopN2 XC8VF8riURRkU0+YepUuH23PtGa59/pwT1awxLaMVz/rqufbCWfRnwHKrMz5nyboX+WO ChGTujJILp0yefIYPS8m1C309CmLF9/LA2zh4mZQBl5h8NADNPkaJekyw7qGJwFMTb6M hb0GqR4KqPos0y2kagQCbvWRoNz0qxpbVvMUCYMmBQx89E3nC2ZOH9c0wY25YYe0R4KW Q/F/yr6ZJIExzzOP0aiLKKGdDR14XOY/LluMIoWbbJEC60fHeuwF0ux3rFvn6sURDDfL UG0Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ij25-20020a170902ab5900b001a971d32b41si5924307plb.267.2023.05.11.04.27.50; Thu, 11 May 2023 04:28:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231278AbjEKK2h (ORCPT + 99 others); Thu, 11 May 2023 06:28:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237617AbjEKK2W (ORCPT ); Thu, 11 May 2023 06:28:22 -0400 X-Greylist: delayed 622 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 11 May 2023 03:28:20 PDT Received: from chinatelecom.cn (prt-mail.chinatelecom.cn [42.123.76.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A08EE1FDA for ; Thu, 11 May 2023 03:28:20 -0700 (PDT) HMM_SOURCE_IP: 172.18.0.218:33257.1589737745 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-36.111.64.84 (unknown [172.18.0.218]) by chinatelecom.cn (HERMES) with SMTP id 2059D2800AB; Thu, 11 May 2023 18:17:47 +0800 (CST) X-189-SAVE-TO-SEND: +renlei1@chinatelecom.cn Received: from ([36.111.64.84]) by app0025 with ESMTP id 119dc4bf77aa4dda88a45456292276a0 for djwong@kernel.org; Thu, 11 May 2023 18:17:57 CST X-Transaction-ID: 119dc4bf77aa4dda88a45456292276a0 X-Real-From: renlei1@chinatelecom.cn X-Receive-IP: 36.111.64.84 X-MEDUSA-Status: 0 Sender: renlei1@chinatelecom.cn From: renlei1@chinatelecom.cn To: djwong@kernel.org Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, Ren Lei Subject: [PATCH] xfs: xfs_nfs_get_inode support zero generation Date: Thu, 11 May 2023 18:17:21 +0800 Message-Id: <1683800241-14488-1-git-send-email-renlei1@chinatelecom.cn> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 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.) 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