projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a26a978
)
proc: use down_read_killable mmap_sem for /proc/pid/pagemap
author
Konstantin Khlebnikov
<
[email protected]
>
Fri, 12 Jul 2019 03:59:56 +0000
(20:59 -0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 12 Jul 2019 18:05:47 +0000
(11:05 -0700)
Do not remain stuck forever if something goes wrong. Using a killable
lock permits cleanup of stuck tasks and simplifies investigation.
Link:
http://lkml.kernel.org/r/156007493638.3335.4872164955523928492.stgit@buzz
Signed-off-by: Konstantin Khlebnikov <
[email protected]
>
Reviewed-by: Roman Gushchin <
[email protected]
>
Reviewed-by: Cyrill Gorcunov <
[email protected]
>
Reviewed-by: Kirill Tkhai <
[email protected]
>
Acked-by: Michal Hocko <
[email protected]
>
Cc: Alexey Dobriyan <
[email protected]
>
Cc: Al Viro <
[email protected]
>
Cc: Matthew Wilcox <
[email protected]
>
Cc: Michal Koutný <
[email protected]
>
Cc: Oleg Nesterov <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
fs/proc/task_mmu.c
patch
|
blob
|
history
diff --git
a/fs/proc/task_mmu.c
b/fs/proc/task_mmu.c
index 781879a91e3bd1f5d688f59cf4baa78deddf68b2..78bed6adc62d21ff20e8f4d046761df7f2792b47 100644
(file)
--- a/
fs/proc/task_mmu.c
+++ b/
fs/proc/task_mmu.c
@@
-1547,7
+1547,9
@@
static ssize_t pagemap_read(struct file *file, char __user *buf,
/* overflow ? */
if (end < start_vaddr || end > end_vaddr)
end = end_vaddr;
- down_read(&mm->mmap_sem);
+ ret = down_read_killable(&mm->mmap_sem);
+ if (ret)
+ goto out_free;
ret = walk_page_range(start_vaddr, end, &pagemap_walk);
up_read(&mm->mmap_sem);
start_vaddr = end;