public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: xfs_nfs_get_inode support zero generation
@ 2023-05-11 10:17 renlei1
  2023-05-11 23:22 ` Darrick J. Wong
  0 siblings, 1 reply; 5+ messages in thread
From: renlei1 @ 2023-05-11 10:17 UTC (permalink / raw)
  To: djwong; +Cc: linux-xfs, linux-kernel, Ren Lei

From: Ren Lei <renlei1@chinatelecom.cn>

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<renlei1@chinatelecom.cn>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-12  6:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-11 10:17 [PATCH] xfs: xfs_nfs_get_inode support zero generation renlei1
2023-05-11 23:22 ` Darrick J. Wong
2023-05-12  2:00   ` Dave Chinner
     [not found]     ` <2023051210532845432129@chinatelecom.cn>
2023-05-12  3:31       ` Darrick J. Wong
2023-05-12  6:02       ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox