Skip to content

Commit

Permalink
fs/coredump: use kmap_local_page()
Browse files Browse the repository at this point in the history
In dump_user_range() there is no reason for the mapping to be global.  Use
kmap_local_page() rather than kmap.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ira Weiny <[email protected]>
Cc: Alexander Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
weiny2 authored and torvalds committed Feb 26, 2021
1 parent f9c8bc4 commit 3159ed5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,10 +897,10 @@ int dump_user_range(struct coredump_params *cprm, unsigned long start,
*/
page = get_dump_page(addr);
if (page) {
void *kaddr = kmap(page);
void *kaddr = kmap_local_page(page);

stop = !dump_emit(cprm, kaddr, PAGE_SIZE);
kunmap(page);
kunmap_local(kaddr);
put_page(page);
} else {
stop = !dump_skip(cprm, PAGE_SIZE);
Expand Down

0 comments on commit 3159ed5

Please sign in to comment.