diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 20:25:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 20:25:18 -0500 |
commit | a57cb1c1d7974c62a5c80f7869e35b492ace12cd (patch) | |
tree | 5a42ee9a668f171143464bc86013954c1bbe94ad /mm/process_vm_access.c | |
parent | cf1b3341afab9d3ad02a76b3a619ea027dcf4e28 (diff) | |
parent | e1e14ab8411df344a17687821f8f78f0a1e73cbb (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge more updates from Andrew Morton:
- a few misc things
- kexec updates
- DMA-mapping updates to better support networking DMA operations
- IPC updates
- various MM changes to improve DAX fault handling
- lots of radix-tree changes, mainly to the test suite. All leading up
to reimplementing the IDA/IDR code to be a wrapper layer over the
radix-tree. However the final trigger-pulling patch is held off for
4.11.
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits)
radix tree test suite: delete unused rcupdate.c
radix tree test suite: add new tag check
radix-tree: ensure counts are initialised
radix tree test suite: cache recently freed objects
radix tree test suite: add some more functionality
idr: reduce the number of bits per level from 8 to 6
rxrpc: abstract away knowledge of IDR internals
tpm: use idr_find(), not idr_find_slowpath()
idr: add ida_is_empty
radix tree test suite: check multiorder iteration
radix-tree: fix replacement for multiorder entries
radix-tree: add radix_tree_split_preload()
radix-tree: add radix_tree_split
radix-tree: add radix_tree_join
radix-tree: delete radix_tree_range_tag_if_tagged()
radix-tree: delete radix_tree_locate_item()
radix-tree: improve multiorder iterators
btrfs: fix race in btrfs_free_dummy_fs_info()
radix-tree: improve dump output
radix-tree: make radix_tree_find_next_bit more useful
...
Diffstat (limited to 'mm/process_vm_access.c')
-rw-r--r-- | mm/process_vm_access.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c index be8dc8d1edb9..84d0c7eada2b 100644 --- a/mm/process_vm_access.c +++ b/mm/process_vm_access.c | |||
@@ -88,7 +88,7 @@ static int process_vm_rw_single_vec(unsigned long addr, | |||
88 | ssize_t rc = 0; | 88 | ssize_t rc = 0; |
89 | unsigned long max_pages_per_loop = PVM_MAX_KMALLOC_PAGES | 89 | unsigned long max_pages_per_loop = PVM_MAX_KMALLOC_PAGES |
90 | / sizeof(struct pages *); | 90 | / sizeof(struct pages *); |
91 | unsigned int flags = FOLL_REMOTE; | 91 | unsigned int flags = 0; |
92 | 92 | ||
93 | /* Work out address and page range required */ | 93 | /* Work out address and page range required */ |
94 | if (len == 0) | 94 | if (len == 0) |
@@ -100,15 +100,19 @@ static int process_vm_rw_single_vec(unsigned long addr, | |||
100 | 100 | ||
101 | while (!rc && nr_pages && iov_iter_count(iter)) { | 101 | while (!rc && nr_pages && iov_iter_count(iter)) { |
102 | int pages = min(nr_pages, max_pages_per_loop); | 102 | int pages = min(nr_pages, max_pages_per_loop); |
103 | int locked = 1; | ||
103 | size_t bytes; | 104 | size_t bytes; |
104 | 105 | ||
105 | /* | 106 | /* |
106 | * Get the pages we're interested in. We must | 107 | * Get the pages we're interested in. We must |
107 | * add FOLL_REMOTE because task/mm might not | 108 | * access remotely because task/mm might not |
108 | * current/current->mm | 109 | * current/current->mm |
109 | */ | 110 | */ |
110 | pages = __get_user_pages_unlocked(task, mm, pa, pages, | 111 | down_read(&mm->mmap_sem); |
111 | process_pages, flags); | 112 | pages = get_user_pages_remote(task, mm, pa, pages, flags, |
113 | process_pages, NULL, &locked); | ||
114 | if (locked) | ||
115 | up_read(&mm->mmap_sem); | ||
112 | if (pages <= 0) | 116 | if (pages <= 0) |
113 | return -EFAULT; | 117 | return -EFAULT; |
114 | 118 | ||