Skip to content

Commit

Permalink
cifs: smbd: Indicate to retry on transport sending failure
Browse files Browse the repository at this point in the history
Failure to send a packet doesn't mean it's a permanent failure, it can't be
returned to user process. This I/O should be retried or failed based on
server packet response and transport health. This logic is handled by the
upper layer.

Give this decision to upper layer.

Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Long Li authored and Steve French committed May 8, 2019
1 parent 98e0d40 commit 62fdf67
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/cifs/smbdirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ static int smbd_create_header(struct smbd_connection *info,

if (info->transport_status != SMBD_CONNECTED) {
log_outgoing(ERR, "disconnected not sending\n");
return -ENOENT;
return -EAGAIN;
}
atomic_dec(&info->send_credits);

Expand Down Expand Up @@ -979,6 +979,7 @@ static int smbd_post_send(struct smbd_connection *info,
wake_up(&info->wait_send_pending);
}
smbd_disconnect_rdma_connection(info);
rc = -EAGAIN;
} else
/* Reset timer for idle connection after packet is sent */
mod_delayed_work(info->workqueue, &info->idle_timer_work,
Expand Down Expand Up @@ -2085,7 +2086,7 @@ int smbd_send(struct TCP_Server_Info *server, struct smb_rqst *rqst)
int rc;

if (info->transport_status != SMBD_CONNECTED) {
rc = -ENODEV;
rc = -EAGAIN;
goto done;
}

Expand Down

0 comments on commit 62fdf67

Please sign in to comment.