lkml.org 
[lkml]   [2013]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 0/4] tracing/kprobes/uprobes: Fix race between opening probe event files and deleting probe
From
Date
On Tue, 2013-07-16 at 18:38 +0200, Oleg Nesterov wrote:
> On 07/15, Oleg Nesterov wrote:
> >
> > So. As Masami pointed out, this is not enough. Probably we can add more
> > hacks, but I'd like to discuss the alternative approach.
> >
> > Note also that this ref count has the unfortunate property, if someone
> > keeps the file opened we can't remove an event.
>
> And please correct me, but afaics there are similar problems with
> rmdir instances/xxx.

The instances have their own refcount. And if a file is open, it wont
remove the directory. Just try it...


# cd /sys/kernel/debug/tracing/instances
# mkdir foo
# sleep 10 < foo/events/ext3/enable &
[1] 2087
# rmdir foo
rmdir: failed to remove `foo': Device or resource busy
#
[1]+ Done sleep 10 < foo/events/ext3/enable
# rmdir foo
#

>
> > What this patch does:
> >
> > - add the new "topmost" rw_semaphore, file_sem.
>
> probably unneeded...
>
> > - trace_remove_event_call() takes this sem for writing and
> > cleares enable/id/format/filter->i_private
> >
> > - removes tracing_open_generic_file/tracing_release_generic_file,
> > we do not use file->f_private any longer
> >
> > - changes event_enable_read/event_enable_write to read
> > ftrace_event_file = i_private under read_lock(file_sem) and
> > abort if it is null.
> >
> > Question: why event_enable_write() needs trace_array_get() ?
>
> probably it doesn't...

I'm confused. Which code has event_enable_write doing a
trace_array_get()?

>
> > Steven, Masami, do you think this can make any sense?

I need to sort these patches out. They are all over the place. What
exactly do we have for a solution here. Did we figure out which patches
are needed?

I'll have to go back and re-read the entire thread. I've been all over
the place lately with different topics, and don't remember all that has
been said here.

-- Steve




\
 
 \ /
  Last update: 2013-07-16 22:01    [W:0.649 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site