OSDN Git Service

tracing: Remove igrab() iput() call from uprobes.c
authorSong Liu <songliubraving@fb.com>
Mon, 23 Apr 2018 17:21:35 +0000 (10:21 -0700)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 26 Apr 2018 18:50:56 +0000 (14:50 -0400)
commit61f94203c9efcaf44a7435298697caf406476c79
tree28dbde5c548085dfae5eaef1484ef8e2b56db2d6
parent0c92c7a3c5d416f47b32c5f20a611dfeca5d5f2e
tracing: Remove igrab() iput() call from uprobes.c

Caller of uprobe_register is required to keep the inode and containing
mount point referenced.

There was misuse of igrab() in uprobes.c and trace_uprobe.c. This is
because igrab() will not prevent umount of the containing mount point.
To fix this, we added path to struct trace_uprobe, which keeps the inode
and containing mount reference.

For uprobes.c, it is not necessary to call igrab() in uprobe_register(),
as the caller is required to keep the inode reference. The igrab() is
removed and comments on this requirement is added to uprobe_register().

Link: http://lkml.kernel.org/r/CAELBmZB2XX=qEOLAdvGG4cPx4GEntcSnWQquJLUK1ongRj35cA@mail.gmail.com
Link: http://lkml.kernel.org/r/20180423172135.4050588-2-songliubraving@fb.com
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Howard McLauchlan <hmclauchlan@fb.com>
Cc: Josef Bacik <jbacik@fb.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Acked-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/events/uprobes.c