Linux NFS development
 help / color / mirror / Atom feed
* Spurious -EEXIST from NFSv3
@ 2025-11-19 10:52 Michael Stoler
  2025-11-19 13:48 ` Trond Myklebust
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Stoler @ 2025-11-19 10:52 UTC (permalink / raw)
  To: linux-nfs; +Cc: Dan Aloni


[-- Attachment #1.1: Type: text/plain, Size: 576 bytes --]

    I’m having an issue with an NFS driver based on Linux 5.15.147. The
function nfs_verifier_is_delegated() spuriously returns true for NFSv3 file
inside nfs_do_lookup_revalidate(). This causes the d_revalidate method to
return true for a removed file, which in turn leads to an -EEXIST error
during exclusive creation of a non-existent file.

    It appears that the root cause is an initialization races or an
uninitialized d_time value. The attached patch resolves the issue, but is
there a more graceful or proper solution?


    Regards,

Michael Stoler

[-- Attachment #1.2: Type: text/html, Size: 2444 bytes --]

[-- Attachment #2: revalidate.patch --]
[-- Type: application/octet-stream, Size: 437 bytes --]

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1602,7 +1602,7 @@ nfs_do_lookup_revalidate(struct inode *dir, struct dentry *dentry,
 		goto out_bad;
 	}
 
-	if (nfs_verifier_is_delegated(dentry))
+	if (nfs_verifier_is_delegated(dentry) && NFS_PROTO(inode)->version > 3)
 		return nfs_lookup_revalidate_delegated(dir, dentry, inode);
 
 	/* Force a full look up iff the parent directory has changed */

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

end of thread, other threads:[~2025-11-20 10:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 10:52 Spurious -EEXIST from NFSv3 Michael Stoler
2025-11-19 13:48 ` Trond Myklebust
2025-11-19 13:58   ` [PATCH 0/3] Fix verifier initialisation races for dentries Trond Myklebust
2025-11-19 13:58     ` [PATCH 1/3] NFS: Initialise verifiers for visible dentries in readdir and lookup Trond Myklebust
2025-11-19 13:58     ` [PATCH 2/3] NFS: Initialise verifiers for visible dentries in nfs_atomic_open() Trond Myklebust
2025-11-19 13:58     ` [PATCH 3/3] NFS: Initialise verifiers for visible dentries in _nfs4_open_and_get_state Trond Myklebust
2025-11-19 16:14       ` Anna Schumaker
2025-11-19 16:50         ` Trond Myklebust
2025-11-20 10:47       ` kernel test robot

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