Skip to content

Commit

Permalink
cifs: smbd: Check for iov length on sending the last iov
Browse files Browse the repository at this point in the history
When sending the last iov that breaks into smaller buffers to fit the
transfer size, it's necessary to check if this is the last iov.

If this is the latest iov, stop and proceed to send pages.

Signed-off-by: Long Li <longli@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
  • Loading branch information
longlimsft authored and smfrench committed Apr 19, 2018
1 parent a5240cb commit ab60ee7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/cifs/smbdirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -2194,6 +2194,8 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst)
goto done;
}
i++;
if (i == rqst->rq_nvec)
break;
}
start = i;
buflen = 0;
Expand Down

0 comments on commit ab60ee7

Please sign in to comment.