From: Long Li <longli@microsoft.com>
Date: Wed, 16 Oct 2019 13:51:56 -0700
Subject: [PATCH] cifs: smbd: Return -EAGAIN when transport is reconnecting
Git-commit: 4357d45f50e58672e1d17648d792f27df01dfccd
References: bsc#1144333
Patch-mainline: v5.5-rc1
During reconnecting, the transport may have already been destroyed and is in
the process being reconnected. In this case, return -EAGAIN to not fail and
to retry this I/O.
Signed-off-by: Long Li <longli@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Paulo Alcantara <palcantara@suse.de>
---
fs/cifs/transport.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 19300e0cf1d6..4104f59e5bd6 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -325,8 +325,11 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
int val = 1;
__be32 rfc1002_marker;
- if (cifs_rdma_enabled(server) && server->smbd_conn) {
- rc = smbd_send(server, num_rqst, rqst);
+ if (cifs_rdma_enabled(server)) {
+ /* return -EAGAIN when connecting or reconnecting */
+ rc = -EAGAIN;
+ if (server->smbd_conn)
+ rc = smbd_send(server, num_rqst, rqst);
goto smbd_done;
}
--
2.25.1