summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-12-17 21:36:58 +0100
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2022-01-06 20:00:20 +0100
commit68eaba4ca924a97a863c5c81c0b23a11dcb6db90 (patch)
treef70167f7e7cc142e6cc9474d3974e04c7dfef116 /fs
parentNFS: Add a helper to remove case-insensitive aliases (diff)
downloadlinux-68eaba4ca924a97a863c5c81c0b23a11dcb6db90.tar.xz
linux-68eaba4ca924a97a863c5c81c0b23a11dcb6db90.zip
NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open()
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/dir.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index d2a58f7a73a6..2884138848f4 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1888,6 +1888,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
struct iattr attr = { .ia_valid = ATTR_OPEN };
struct inode *inode;
unsigned int lookup_flags = 0;
+ unsigned long dir_verifier;
bool switched = false;
int created = 0;
int err;
@@ -1961,7 +1962,11 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
switch (err) {
case -ENOENT:
d_splice_alias(NULL, dentry);
- nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
+ if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE))
+ dir_verifier = inode_peek_iversion_raw(dir);
+ else
+ dir_verifier = nfs_save_change_attribute(dir);
+ nfs_set_verifier(dentry, dir_verifier);
break;
case -EISDIR:
case -ENOTDIR: