summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLong Li <longli@microsoft.com>2018-04-17 21:17:05 +0200
committerSteve French <smfrench@gmail.com>2018-04-19 05:02:49 +0200
commitab60ee7bf9a84954f50a66a3d835860e80f99b7f (patch)
tree9124edf8bd5d58b1c5a6f8dfd7b5f2d241e1f1dd
parentfs: cifs: Adding new return type vm_fault_t (diff)
downloadlinux-ab60ee7bf9a84954f50a66a3d835860e80f99b7f.tar.xz
linux-ab60ee7bf9a84954f50a66a3d835860e80f99b7f.zip
cifs: smbd: Check for iov length on sending the last iov
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>
-rw-r--r--fs/cifs/smbdirect.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index 5008af546dd1..d611ed0537fd 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -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;