diff mbox series

[7/7] cifs: smbd: Return -EAGAIN when transport is reconnecting

Message ID 1571259116-102015-8-git-send-email-longli@linuxonhyperv.com (mailing list archive)
State New, archived
Headers show
Series cifs: smbd: Improve reliability on transport reconnect | expand

Commit Message

Long Li Oct. 16, 2019, 8:51 p.m. UTC
From: Long Li <longli@microsoft.com>

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
---
 fs/cifs/transport.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Steve French Oct. 27, 2019, 8:02 p.m. UTC | #1
Tentatively merged the 7 patch series into cifs-2.6.git for-next
pending more reviews and xfstests regression testing runs

On Wed, Oct 16, 2019 at 4:11 PM longli--- via samba-technical
<samba-technical@lists.samba.org> wrote:
>
> From: Long Li <longli@microsoft.com>
>
> 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
> ---
>  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 afe66f9cb15e..66fde7bfec4f 100644
> --- a/fs/cifs/transport.c
> +++ b/fs/cifs/transport.c
> @@ -318,8 +318,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.17.1
>
>
diff mbox series

Patch

diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index afe66f9cb15e..66fde7bfec4f 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -318,8 +318,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;
 	}