Skip to content

Commit

Permalink
CIFS: When sending data on socket, pass the correct page offset
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
longlimsft authored and Steve French committed Jun 5, 2018
1 parent 7b7f2bd commit e8157b2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions fs/cifs/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e8157b2

Please sign in to comment.