diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2022-08-11 19:51:18 -0500 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-08-12 17:40:15 -0500 |
commit | 7eb59a98701d3113671b513593bb489cc76f58d2 (patch) | |
tree | 307b4338c95b6a53760256c015d3ecdf4b898075 /fs/cifs/cached_dir.c | |
parent | a63ec83c462b5b1439f71ace751e8985dfb3fcab (diff) |
cifs: Do not access tcon->cfids->cfid directly from is_path_accessible
cfids will soon keep a list of cached fids so we should not access this
directly from outside of cached_dir.c
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cached_dir.c')
-rw-r--r-- | fs/cifs/cached_dir.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/cifs/cached_dir.c b/fs/cifs/cached_dir.c index 78e8deb82a0a..b401339f6e73 100644 --- a/fs/cifs/cached_dir.c +++ b/fs/cifs/cached_dir.c @@ -16,9 +16,9 @@ * If error then *cfid is not initialized. */ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, - const char *path, - struct cifs_sb_info *cifs_sb, - struct cached_fid **ret_cfid) + const char *path, + struct cifs_sb_info *cifs_sb, + bool lookup_only, struct cached_fid **ret_cfid) { struct cifs_ses *ses; struct TCP_Server_Info *server; @@ -68,9 +68,11 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, * cifs_mark_open_files_invalid() which takes the lock again * thus causing a deadlock */ - mutex_unlock(&cfid->fid_mutex); + if (lookup_only) + return -ENOENT; + if (smb3_encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; |