summaryrefslogtreecommitdiff
path: root/fs/cifs/cached_dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cached_dir.c')
-rw-r--r--fs/cifs/cached_dir.c10
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;