summaryrefslogtreecommitdiff
path: root/fs/smb/client/smb2inode.c
diff options
context:
space:
mode:
authorEnzo Matsumiya <ematsumiya@suse.de>2025-07-08 15:54:31 -0300
committerEnzo Matsumiya <ematsumiya@suse.de>2025-07-09 03:00:14 -0300
commita70b71978ca38fcd839cf708cae288c442c14141 (patch)
tree0b0c893fe653e634e3d69291a7a4336c5c0fc1ba /fs/smb/client/smb2inode.c
parente835f5ff89e9106fe8c8d1fe8ea3917cea67c016 (diff)
downloadlinux-plk.tar.gz
linux-plk.tar.bz2
linux-plk.zip
smb: client: properly invalidate and reuse cached direntsplk
By properly invalidating cache dir entries allows to determine when we must or not do a remote open of the dir, reducing the number of network calls while the cached dir is still valid. Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Diffstat (limited to 'fs/smb/client/smb2inode.c')
-rw-r--r--fs/smb/client/smb2inode.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c
index cd3901e8649e..d9f3fe7830a0 100644
--- a/fs/smb/client/smb2inode.c
+++ b/fs/smb/client/smb2inode.c
@@ -265,6 +265,9 @@ replay_again:
if (rc)
goto finished;
+ if (num_cmds > 0 && cmds[0] == SMB2_OP_MKDIR && oplock == SMB2_OPLOCK_LEVEL_LEASE && oparms->fid)
+ server->ops->new_lease_key(oparms->fid);
+
smb2_set_next_command(tcon, &rqst[num_rqst]);
after_open:
num_rqst++;
@@ -1222,9 +1225,7 @@ mkdir_compound:
}
out:
if (parent_cfid) {
- mutex_lock(&parent_cfid->dirents.de_mutex);
- parent_cfid->dirents.is_valid = false;
- mutex_unlock(&parent_cfid->dirents.de_mutex);
+ invalidate_dirents(parent_cfid);
close_cached_dir(parent_cfid);
}