Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323739
b: refs/heads/master
c: f1a45d0
h: refs/heads/master
i:
  323737: 8d4362a
  323735: 6f38b73
v: v3
  • Loading branch information
Oleg Nesterov committed Aug 28, 2012
1 parent f6b98c1 commit 752d686
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 647c42dfd40fec032a4c8525a755160f0765921f
refs/heads/master: f1a45d023193f7d8e55e384090b645d609325393
30 changes: 3 additions & 27 deletions trunk/kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ int uprobe_mmap(struct vm_area_struct *vma)
struct list_head tmp_list;
struct uprobe *uprobe, *u;
struct inode *inode;
int ret, count;
int ret;

if (!atomic_read(&uprobe_events) || !valid_vma(vma, true))
return 0;
Expand All @@ -1023,8 +1023,6 @@ int uprobe_mmap(struct vm_area_struct *vma)
build_probe_list(inode, vma, vma->vm_start, vma->vm_end, &tmp_list);

ret = 0;
count = 0;

list_for_each_entry_safe(uprobe, u, &tmp_list, pending_list) {
if (!ret) {
unsigned long vaddr = offset_to_vaddr(vma, uprobe->offset);
Expand All @@ -1034,19 +1032,11 @@ int uprobe_mmap(struct vm_area_struct *vma)
* We can race against uprobe_register(), see the
* comment near uprobe_hash().
*/
if (ret == -EEXIST) {
if (ret == -EEXIST)
ret = 0;

if (!is_swbp_at_addr(vma->vm_mm, vaddr))
continue;
}

if (!ret)
count++;
}
put_uprobe(uprobe);
}

mutex_unlock(uprobes_mmap_hash(inode));

return ret;
Expand All @@ -1057,27 +1047,13 @@ int uprobe_mmap(struct vm_area_struct *vma)
*/
void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end)
{
struct list_head tmp_list;
struct uprobe *uprobe, *u;
struct inode *inode;

if (!atomic_read(&uprobe_events) || !valid_vma(vma, false))
return;

if (!atomic_read(&vma->vm_mm->mm_users)) /* called by mmput() ? */
return;

inode = vma->vm_file->f_mapping->host;
if (!inode)
return;

mutex_lock(uprobes_mmap_hash(inode));
build_probe_list(inode, vma, start, end, &tmp_list);

list_for_each_entry_safe(uprobe, u, &tmp_list, pending_list) {
put_uprobe(uprobe);
}
mutex_unlock(uprobes_mmap_hash(inode));
/* TODO: unmapping uprobe(s) will need more work */
}

/* Slot allocation for XOL */
Expand Down
3 changes: 0 additions & 3 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,6 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)

if (retval)
goto out;

if (file)
uprobe_mmap(tmp);
}
/* a new mm has just been created */
arch_dup_mmap(oldmm, mm);
Expand Down

0 comments on commit 752d686

Please sign in to comment.