Skip to content

Commit 67fcb2c

Browse files
weiny2smfrench
authored andcommitted
cifs: Fix kmap_local_page() unmapping
kmap_local_page() requires kunmap_local() to unmap the mapping. In addition memcpy_page() is provided to perform this common memcpy pattern. Replace the kmap_local_page() and broken kunmap() with memcpy_page() Fixes: d406d26 ("cifs: skip alloc when request has no pages") Reviewed-by: Paulo Alcantara <[email protected]> Reviewed-by: "Fabio M. De Francesco" <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Ira Weiny <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 88603b6 commit 67fcb2c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

fs/cifs/smb2ops.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4488,17 +4488,12 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, int num_rqst,
44884488

44894489
/* copy pages form the old */
44904490
for (j = 0; j < npages; j++) {
4491-
char *dst, *src;
44924491
unsigned int offset, len;
44934492

44944493
rqst_page_get_length(new, j, &len, &offset);
44954494

4496-
dst = kmap_local_page(new->rq_pages[j]) + offset;
4497-
src = kmap_local_page(old->rq_pages[j]) + offset;
4498-
4499-
memcpy(dst, src, len);
4500-
kunmap(new->rq_pages[j]);
4501-
kunmap(old->rq_pages[j]);
4495+
memcpy_page(new->rq_pages[j], offset,
4496+
old->rq_pages[j], offset, len);
45024497
}
45034498
}
45044499

0 commit comments

Comments
 (0)