Skip to content

Commit

Permalink
CIFS: Remove custom credit adjustments for SMB2 async IO
Browse files Browse the repository at this point in the history
Currently we do proper accounting for credits in regards to
reconnects and error handling, thus we do not need custom
credit adjustments when reconnect is detected developed
previously.

Signed-off-by: Pavel Shilovsky <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
piastry authored and Steve French committed Mar 6, 2019
1 parent 9a1c67e commit f0b93cb
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions fs/cifs/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3297,17 +3297,8 @@ smb2_async_readv(struct cifs_readdata *rdata)

rc = smb2_new_read_req(
(void **) &buf, &total_len, &io_parms, rdata, 0, 0);
if (rc) {
if (rc == -EAGAIN && rdata->credits.value) {
/* credits was reset by reconnect */
rdata->credits.value = 0;
/* reduce in_flight value since we won't send the req */
spin_lock(&server->req_lock);
server->in_flight--;
spin_unlock(&server->req_lock);
}
if (rc)
return rc;
}

if (smb3_encryption_required(io_parms.tcon))
flags |= CIFS_TRANSFORM_REQ;
Expand Down Expand Up @@ -3515,17 +3506,8 @@ smb2_async_writev(struct cifs_writedata *wdata,
unsigned int total_len;

rc = smb2_plain_req_init(SMB2_WRITE, tcon, (void **) &req, &total_len);
if (rc) {
if (rc == -EAGAIN && wdata->credits.value) {
/* credits was reset by reconnect */
wdata->credits.value = 0;
/* reduce in_flight value since we won't send the req */
spin_lock(&server->req_lock);
server->in_flight--;
spin_unlock(&server->req_lock);
}
goto async_writev_out;
}
if (rc)
return rc;

if (smb3_encryption_required(tcon))
flags |= CIFS_TRANSFORM_REQ;
Expand Down

0 comments on commit f0b93cb

Please sign in to comment.