Skip to content

Commit e8157b2

Browse files
longlimsftSteve French
authored andcommitted
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 <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 7b7f2bd commit e8157b2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

fs/cifs/transport.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,13 @@ __smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst)
288288

289289
/* now walk the page array and send each page in it */
290290
for (i = 0; i < rqst->rq_npages; i++) {
291-
size_t len = i == rqst->rq_npages - 1
292-
? rqst->rq_tailsz
293-
: rqst->rq_pagesz;
294-
struct bio_vec bvec = {
295-
.bv_page = rqst->rq_pages[i],
296-
.bv_len = len
297-
};
291+
struct bio_vec bvec;
292+
293+
bvec.bv_page = rqst->rq_pages[i];
294+
rqst_page_get_length(rqst, i, &bvec.bv_len, &bvec.bv_offset);
295+
298296
iov_iter_bvec(&smb_msg.msg_iter, WRITE | ITER_BVEC,
299-
&bvec, 1, len);
297+
&bvec, 1, bvec.bv_len);
300298
rc = smb_send_kvec(server, &smb_msg, &sent);
301299
if (rc < 0)
302300
break;

0 commit comments

Comments
 (0)