Skip to contentSkip to conversation

cifs: make retry logic in read/write path consistent with other paths

PATCH New [email protected] 1 participant 1 message Jan 21

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cifs: make retry logic in read/write path consistent with other paths

From: Shyam Prasad N <[email protected]>

Today in most other code paths in cifs.ko, the decision of whether to retry a command depends on two mount options: retrans and hard. However, the read/write code paths diverged from this and would only retry if the error returned was -EAGAIN. However, there are other replayable errors in cifs.ko, for which is_replayable_errors helper was written. This change makes read/write codepaths consistent with other code-paths.

This change also does the following:
1. The SMB2 read/write code diverged significantly (presumably since they were changed during netfs refactor at different times). This changes the response verification logic to be consistent.
2. Moves the netfs tracepoints to slightly different locations in order to make debugging easier.

---
 fs/smb/client/cifsglob.h |  2 ++
 fs/smb/client/smb2pdu.c  | 60 +++++++++++++++++++++++++++++++++++-----
 2 files changed, 55 insertions(+), 7 deletions(-)
fs/smb/client/cifsglob.h +2 -0
index 3eca5bfb70303..f6ebd3fd176d7 100644
@@ -1507,6 +1507,8 @@ struct cifs_io_subrequest {
 	int				result;
 	bool				have_xid;
 	bool				replay;
+	unsigned int			retries;	/* number of retries so far */
+	unsigned int			cur_sleep;	/* time to sleep before replay */
 	struct kvec			iov[2];
 	struct TCP_Server_Info		*server;
 #ifdef CONFIG_CIFS_SMB_DIRECT
fs/smb/client/smb2pdu.c +53 -7

121 lines not on this page · raw message

Signature · 1 line
2.43.0