cifs: commands that are retried should have replay flag set
authorShyam Prasad N <sprasad@microsoft.com>
Sun, 21 Jan 2024 03:32:47 +0000 (03:32 +0000)
committerSteve French <stfrench@microsoft.com>
Sun, 28 Apr 2024 06:27:32 +0000 (01:27 -0500)
commit1ba4be18ebc498d946591b0c05693bf4de843054
tree3c4a6c17366f3f26235952f03535f2856acd8365
parentae40638ac3ffa82ff57467d88b11993b741dd9fc
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>
fs/smb/client/cached_dir.c
fs/smb/client/cifsglob.h
fs/smb/client/smb2inode.c
fs/smb/client/smb2ops.c
fs/smb/client/smb2pdu.c
fs/smb/client/smb2proto.h