summaryrefslogtreecommitdiffstats
path: root/fs/smb/client/cached_dir.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-01-31 14:17:06 +0100
committerMark Brown <broonie@kernel.org>2024-01-31 14:17:06 +0100
commitb25c4e5684cd4e5a3528485918e34f04a4bea3e5 (patch)
treed90c34ef9bdd7b21ada3ac9a6fb027ba9715e7f2 /fs/smb/client/cached_dir.c
parentASoC: sh: rz-ssi: Fix error message print (diff)
parentASoC: SOF: amd: refactor acp driver pm ops (diff)
downloadlinux-b25c4e5684cd4e5a3528485918e34f04a4bea3e5.tar.xz
linux-b25c4e5684cd4e5a3528485918e34f04a4bea3e5.zip
soundwire/SOF: add SoundWire Interface support for
Merge series from Vijendar Mukunda <Vijendar.Mukunda@amd.com>: This patch series is to redesign existing platform device creation logic for SoundWire managers and Implement generic functions for SoundWire manager probe, start and exit sequence which are common for both Legacy (NO DSP enabled) and SOF stack, and add SoundWire Interface support for AMD SOF stack (ACP 6.3 based platform). The patch series was reviewed in https://github.com/thesofproject/linux/pull/4699
Diffstat (limited to 'fs/smb/client/cached_dir.c')
-rw-r--r--fs/smb/client/cached_dir.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
index 971892620504..1daeb5714faa 100644
--- a/fs/smb/client/cached_dir.c
+++ b/fs/smb/client/cached_dir.c
@@ -145,21 +145,27 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
struct cached_fid *cfid;
struct cached_fids *cfids;
const char *npath;
+ int retries = 0, cur_sleep = 1;
if (tcon == NULL || tcon->cfids == NULL || tcon->nohandlecache ||
is_smb1_server(tcon->ses->server) || (dir_cache_timeout == 0))
return -EOPNOTSUPP;
ses = tcon->ses;
- server = cifs_pick_channel(ses);
cfids = tcon->cfids;
- if (!server->ops->new_lease_key)
- return -EIO;
-
if (cifs_sb->root == NULL)
return -ENOENT;
+replay_again:
+ /* reinitialize for possible replay */
+ flags = 0;
+ oplock = SMB2_OPLOCK_LEVEL_II;
+ server = cifs_pick_channel(ses);
+
+ if (!server->ops->new_lease_key)
+ return -EIO;
+
utf16_path = cifs_convert_path_to_utf16(path, cifs_sb);
if (!utf16_path)
return -ENOMEM;
@@ -268,6 +274,11 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
*/
cfid->has_lease = true;
+ if (retries) {
+ smb2_set_replay(server, &rqst[0]);
+ smb2_set_replay(server, &rqst[1]);
+ }
+
rc = compound_send_recv(xid, ses, server,
flags, 2, rqst,
resp_buftype, rsp_iov);
@@ -367,6 +378,11 @@ out:
atomic_inc(&tcon->num_remote_opens);
}
kfree(utf16_path);
+
+ if (is_replayable_error(rc) &&
+ smb2_should_replay(tcon, &retries, &cur_sleep))
+ goto replay_again;
+
return rc;
}