diff options
author | Fabio M. De Francesco <[email protected]> | 2023-04-26 19:22:23 +0200 |
---|---|---|
committer | Christian Brauner <[email protected]> | 2023-07-10 14:36:10 +0200 |
commit | e2393b8f3987c5f29dca03aa71d0502f6d721c0d (patch) | |
tree | 0f91ece830fb27032dd319f8cd8e7d8feb9ea762 /net/lapb/lapb_timer.c | |
parent | c3c6833ea8114a18d5acf5f9a4d32f864103144c (diff) |
fs/ecryptfs: Use kmap_local_page() in copy_up_encrypted_with_header()
kmap_atomic() has been deprecated in favor of kmap_local_page().
Therefore, replace kmap_atomic() with kmap_local_page() in
ecryptfs_copy_up_encrypted_with_header().
kmap_atomic() is implemented like a kmap_local_page() which also
disables page-faults and preemption (the latter only in !PREEMPT_RT
kernels). The kernel virtual addresses returned by these two API are
only valid in the context of the callers (i.e., they cannot be handed to
other threads).
With kmap_local_page() the mappings are per thread and CPU local like
in kmap_atomic(); however, they can handle page-faults and can be called
from any context (including interrupts). The tasks that call
kmap_local_page() can be preempted and, when they are scheduled to run
again, the kernel virtual addresses are restored and are still valid.
In ecryptfs_copy_up_encrypted_with_header(), the block of code between
the mapping and un-mapping does not depend on the above-mentioned side
effects of kmap_aatomic(), so that the mere replacements of the old API
with the new one is all that is required (i.e., there is no need to
explicitly call pagefault_disable() and/or preempt_disable()).
Tested in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with
HIGHMEM64GB enabled.
Cc: Ira Weiny <[email protected]>
Signed-off-by: "Fabio M. De Francesco" <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions