Skip to contentSkip to conversation

fs/coredump: Use kmap_local_page()

PATCH Applied [email protected] 1 participant 1 message Feb 3, 2021 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/coredump: Use kmap_local_page()

From: Ira Weiny <[email protected]>

In dump_user_range() there is no reason for the mapping to be global. Use kmap_local_page() rather than kmap.

---
 fs/coredump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/coredump.c +2 -2
index a2f6ecc8e345..53f63e176a2a 100644
@@ -894,10 +894,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);
Signature · 1 line
2.28.0.rc0.12.gb6a658bd00c9