From: Jens Axboe <axboe@kernel.dk>
To: Steven Rostedt <rostedt@goodmis.org>,
Arianna Avanzini <avanzini.arianna@gmail.com>
Cc: namhyung@kernel.org, mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC v2] trace, blktrace: don't let the sysfs interface remove trace from running list
Date: Tue, 09 Dec 2014 15:00:06 -0700 [thread overview]
Message-ID: <548770E6.7040002@kernel.dk> (raw)
In-Reply-To: <20141113210744.7a725036@gandalf.local.home>
On 11/13/2014 07:07 PM, Steven Rostedt wrote:
>
> Jens (Cc'd) maintains the blktrace. He can take this if he wants.
>
> -- Steve
>
>
> On Mon, 10 Nov 2014 11:40:49 +0100
> Arianna Avanzini <avanzini.arianna@gmail.com> wrote:
>
>> Currently, blktrace can be started/stopped via its ioctl-based interface
>> (used by the userspace blktrace tool) or via its ftrace interface. The
>> function blk_trace_remove_queue(), called each time an "enable" tunable
>> of the ftrace interface transitions to zero, removes the trace from the
>> running list, even if no function from the sysfs interface adds it to
>> such a list. This leads to a null pointer dereference.
>> This commit changes the blk_trace_remove_queue() function so that it
>> does not remove the blk_trace from the running list.
>>
>> v2:
>> - Now the patch removes the invocation of list_del() instead of
>> adding an useless if branch, as suggested by Namhyung Kim.
>>
>> Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
>> ---
>> kernel/trace/blktrace.c | 3 ---
>> 1 file changed, 3 deletions(-)
>>
>> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
>> index c1bd4ad..bd05fd2 100644
>> --- a/kernel/trace/blktrace.c
>> +++ b/kernel/trace/blktrace.c
>> @@ -1493,9 +1493,6 @@ static int blk_trace_remove_queue(struct request_queue *q)
>> if (atomic_dec_and_test(&blk_probes_ref))
>> blk_unregister_tracepoints();
>>
>> - spin_lock_irq(&running_trace_lock);
>> - list_del(&bt->running_list);
>> - spin_unlock_irq(&running_trace_lock);
>> blk_trace_free(bt);
>> return 0;
Applied, thanks!
--
Jens Axboe
prev parent reply other threads:[~2014-12-09 22:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-08 15:14 [PATCH RFC] trace, blktrace: remove trace from running list only if trace is running Arianna Avanzini
2014-11-10 8:25 ` Namhyung Kim
2014-11-10 10:40 ` Arianna Avanzini
2014-11-10 10:40 ` [PATCH RFC v2] trace, blktrace: don't let the sysfs interface remove trace from running list Arianna Avanzini
2014-11-14 2:07 ` Steven Rostedt
2014-12-09 22:00 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=548770E6.7040002@kernel.dk \
--to=axboe@kernel.dk \
--cc=avanzini.arianna@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.