Skip to content

Commit f6e8883

Browse files
decarvSteve French
authored andcommitted
smb: client: remove unnecessary checks in open_cached_dir()
Checks inside open_cached_dir() can be removed because if dir caching is disabled then tcon->cfids is necessarily NULL. Therefore, all other checks are redundant. Signed-off-by: Henrique Carvalho <[email protected]> Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]> Reviewed-by: Enzo Matsumiya <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 228a115 commit f6e8883

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/smb/client/cached_dir.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,17 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
157157
const char *npath;
158158
int retries = 0, cur_sleep = 1;
159159

160-
if (tcon == NULL || tcon->cfids == NULL || tcon->nohandlecache ||
161-
is_smb1_server(tcon->ses->server) || (dir_cache_timeout == 0))
160+
if (cifs_sb->root == NULL)
161+
return -ENOENT;
162+
163+
if (tcon == NULL)
162164
return -EOPNOTSUPP;
163165

164166
ses = tcon->ses;
165167
cfids = tcon->cfids;
166168

167-
if (cifs_sb->root == NULL)
168-
return -ENOENT;
169+
if (cfids == NULL)
170+
return -EOPNOTSUPP;
169171

170172
replay_again:
171173
/* reinitialize for possible replay */

0 commit comments

Comments
 (0)