summaryrefslogtreecommitdiff
path: root/fs/smb/client/smb2proto.h
diff options
context:
space:
mode:
authorShyam Prasad N <sprasad@microsoft.com>2024-01-21 03:32:47 +0000
committerSteve French <stfrench@microsoft.com>2024-01-23 20:23:29 -0600
commit4f1fffa2376922f3d1d506e49c0fd445b023a28e (patch)
tree7e5bf09ccdeecf68f6d978c3066a4ef7b885b82a /fs/smb/client/smb2proto.h
parent64cc377b7628b81ffdbdb1c6bacfba895dcac3f8 (diff)
cifs: commands that are retried should have replay flag set
MS-SMB2 states that the header flag SMB2_FLAGS_REPLAY_OPERATION needs to be set when a command needs to be retried, so that the server is aware that this is a replay for an operation that appeared before. This can be very important, for example, for state changing operations and opens which get retried following a reconnect; since the client maybe unaware of the status of the previous open. This is particularly important for multichannel scenario, since disconnection of one connection does not mean that the session is lost. The requests can be replayed on another channel. This change also makes use of exponential back-off before replays and also limits the number of retries to "retrans" mount option value. Also, this change does not modify the read/write codepath. Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/smb2proto.h')
-rw-r--r--fs/smb/client/smb2proto.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/smb/client/smb2proto.h b/fs/smb/client/smb2proto.h
index 0034b537b0b3..b3069911e9dd 100644
--- a/fs/smb/client/smb2proto.h
+++ b/fs/smb/client/smb2proto.h
@@ -122,6 +122,11 @@ extern unsigned long smb_rqst_len(struct TCP_Server_Info *server,
extern void smb2_set_next_command(struct cifs_tcon *tcon,
struct smb_rqst *rqst);
extern void smb2_set_related(struct smb_rqst *rqst);
+extern void smb2_set_replay(struct TCP_Server_Info *server,
+ struct smb_rqst *rqst);
+extern bool smb2_should_replay(struct cifs_tcon *tcon,
+ int *pretries,
+ int *pcur_sleep);
/*
* SMB2 Worker functions - most of protocol specific implementation details