mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
NFS: Fix stale negative cache on failed nfs_mkdir()
Since commit8376583b84("nfs: change mkdir inode_operation to return alternate dentry if needed"), nfs_mkdir() no longer drops the dentry on RPC failure. A negative cache value can then result in spurious ENOENT results for further operations within that directory, such as open or stat. We observed this breaking some applications where an EEXIST on mkdir caused the application to assume the directory to exist, only to fail operations within that directory due to the retained negative cache entry. The other create paths, nfs_create() and nfs_mknod(), still drop the dentry on failure. This patch restores the previous behavior. Fixes:8376583b84("nfs: change mkdir inode_operation to return alternate dentry if needed") Cc: stable@vger.kernel.org # v6.15+ Signed-off-by: Jimmy Zuber <jamz@amazon.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
72233aabc7
commit
211cda4fdf
|
|
@ -2490,6 +2490,8 @@ struct dentry *nfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
|
|||
trace_nfs_mkdir_enter(dir, dentry);
|
||||
ret = NFS_PROTO(dir)->mkdir(dir, dentry, &attr);
|
||||
trace_nfs_mkdir_exit(dir, dentry, PTR_ERR_OR_ZERO(ret));
|
||||
if (IS_ERR(ret))
|
||||
d_drop(dentry);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nfs_mkdir);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user