summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLong Li <longli@microsoft.com>2018-05-30 21:47:59 +0200
committerSteve French <stfrench@microsoft.com>2018-06-06 00:41:27 +0200
commite8157b2729c9a3d1d331eb5714d0651e3bd271ea (patch)
tree327015fd8eea2de47a8d7b3098d39656705f31c4 /fs
parentCIFS: Introduce helper function to get page offset and length in smb_rqst (diff)
downloadlinux-e8157b2729c9a3d1d331eb5714d0651e3bd271ea.tar.xz
linux-e8157b2729c9a3d1d331eb5714d0651e3bd271ea.zip
CIFS: When sending data on socket, pass the correct page offset
It's possible that the offset is non-zero in the page to send, change the function to pass this offset to socket. Signed-off-by: Long Li <longli@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/transport.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index d6cff1e5afc6..24887a0898c0 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -288,15 +288,13 @@ __smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst)
/* now walk the page array and send each page in it */
for (i = 0; i < rqst->rq_npages; i++) {
- size_t len = i == rqst->rq_npages - 1
- ? rqst->rq_tailsz
- : rqst->rq_pagesz;
- struct bio_vec bvec = {
- .bv_page = rqst->rq_pages[i],
- .bv_len = len
- };
+ struct bio_vec bvec;
+
+ bvec.bv_page = rqst->rq_pages[i];
+ rqst_page_get_length(rqst, i, &bvec.bv_len, &bvec.bv_offset);
+
iov_iter_bvec(&smb_msg.msg_iter, WRITE | ITER_BVEC,
- &bvec, 1, len);
+ &bvec, 1, bvec.bv_len);
rc = smb_send_kvec(server, &smb_msg, &sent);
if (rc < 0)
break;