summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2012-08-08 17:35:08 +0200
committerAnton Arapov <anton@redhat.com>2012-10-29 11:22:07 +0100
commitfebabeb2cd9d126bf9457ed98bbfda209455fbce (patch)
tree37bbb5b19565374a027cec469e7641604c52ce26 /kernel
parente283bd73117213f14d0e4722cf6acb53faf29b6b (diff)
downloadkernel-uprobes-febabeb2cd9d126bf9457ed98bbfda209455fbce.tar.gz
kernel-uprobes-febabeb2cd9d126bf9457ed98bbfda209455fbce.tar.xz
kernel-uprobes-febabeb2cd9d126bf9457ed98bbfda209455fbce.zip
uprobes: Do not use -EEXIST in install_breakpoint() paths
-EEXIST from install_breakpoint() no longer makes sense, all callers should simply treat it as "success". Change the code to return zero and simplify register_for_each_vma(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/uprobes.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 298fbbdf57e..3e2996b809b 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -332,7 +332,7 @@ int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned
*/
result = is_swbp_at_addr(mm, vaddr);
if (result == 1)
- return -EEXIST;
+ return 0;
if (result)
return result;
@@ -657,7 +657,7 @@ install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm,
* Hence behave as if probe already existed.
*/
if (!uprobe->consumers)
- return -EEXIST;
+ return 0;
if (!(uprobe->flags & UPROBE_COPY_INSN)) {
ret = copy_insn(uprobe, vma->vm_file);
@@ -817,17 +817,11 @@ static int register_for_each_vma(struct uprobe *uprobe, bool is_register)
vaddr_to_offset(vma, info->vaddr) != uprobe->offset)
goto unlock;
- if (is_register) {
+ if (is_register)
err = install_breakpoint(uprobe, mm, vma, info->vaddr);
- /*
- * We can race against uprobe_mmap(), see the
- * comment near uprobe_hash().
- */
- if (err == -EEXIST)
- err = 0;
- } else {
+ else
remove_breakpoint(uprobe, mm, info->vaddr);
- }
+
unlock:
up_write(&mm->mmap_sem);
free: