diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2021-03-09 00:07:28 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2021-04-25 23:28:23 +0200 |
commit | e6eb19504e23607816cd4df35e2633aef2540e96 (patch) | |
tree | f299a932f56122032f7857c85b6c9dcd4e57aa5c /fs/cifs/smb2ops.c | |
parent | cifs: move the check for nohandlecache into open_shroot (diff) | |
download | linux-e6eb19504e23607816cd4df35e2633aef2540e96.tar.xz linux-e6eb19504e23607816cd4df35e2633aef2540e96.zip |
cifs: pass a path to open_shroot and check if it is the root or not
Move the check for the directory path into the open_shroot() function
but still fail for any non-root directories.
This is preparation for later when we will start using the cache also
for other directories than the root.
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r-- | fs/cifs/smb2ops.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 079d5027cf75..0a139cffbf29 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -728,6 +728,7 @@ smb2_cached_lease_break(struct work_struct *work) * Open the directory at the root of a share */ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, + const char *path, struct cifs_sb_info *cifs_sb, struct cached_fid **cfid) { @@ -749,6 +750,9 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, if (tcon->nohandlecache) return -ENOTSUPP; + if (strlen(path)) + return -ENOTSUPP; + mutex_lock(&tcon->crfid.fid_mutex); if (tcon->crfid.is_valid) { cifs_dbg(FYI, "found a cached root file handle\n"); @@ -926,7 +930,7 @@ smb3_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon, oparms.fid = &fid; oparms.reconnect = false; - rc = open_shroot(xid, tcon, cifs_sb, &cfid); + rc = open_shroot(xid, tcon, "", cifs_sb, &cfid); if (rc == 0) memcpy(&fid, cfid->fid, sizeof(struct cifs_fid)); else |