summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2022-08-31 12:49:43 +1000
committerSteve French <stfrench@microsoft.com>2022-10-05 01:33:53 -0500
commit47fc2491e108f253cf963c50acc59a74d34c7f2b (patch)
tree7453c54b710229c2c2721093bad742b82fd7c054 /fs/cifs
parentaea6794e664a07324288f3d3484b950922baeebd (diff)
downloadlinux-47fc2491e108f253cf963c50acc59a74d34c7f2b.tar.gz
linux-47fc2491e108f253cf963c50acc59a74d34c7f2b.tar.bz2
linux-47fc2491e108f253cf963c50acc59a74d34c7f2b.zip
cifs: improve handlecaching
Only track the dentry for the root handle Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cached_dir.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/cifs/cached_dir.c b/fs/cifs/cached_dir.c
index 88d117ddb630..211f630cd876 100644
--- a/fs/cifs/cached_dir.c
+++ b/fs/cifs/cached_dir.c
@@ -47,11 +47,11 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
if (cifs_sb->root == NULL)
return -ENOENT;
- if (strlen(path))
+ if (!path[0])
+ dentry = cifs_sb->root;
+ else
return -ENOENT;
- dentry = cifs_sb->root;
-
cfid = &tcon->cfids->cfid;
mutex_lock(&cfid->fid_mutex);
if (cfid->is_valid) {
@@ -177,7 +177,8 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
cfid->tcon = tcon;
cfid->is_valid = true;
cfid->dentry = dentry;
- dget(dentry);
+ if (dentry)
+ dget(dentry);
kref_init(&cfid->refcount);
/* BB TBD check to see if oplock level check can be removed below */