All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cengiz Can <cengiz@kernel.wtf>
To: Ming Lei <tom.leiming@gmail.com>
Cc: Keith Busch <kbusch@kernel.org>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
	Jens Axboe <axboe@kernel.dk>, Bjorn Helgaas <helgaas@kernel.org>,
	Jan Kara <jack@suse.cz>,
	"linux-block" <linux-block@vger.kernel.org>,
	stable <stable@vger.kernel.org>, <tristmd@gmail.com>
Subject: Re: [PATCH] blktrace: Protect q->blk_trace with RCU
Date: Thu, 05 Mar 2020 07:27:02 +0300	[thread overview]
Message-ID: <170a8f261f0.2bfa.85c738e3968116fc5c0dc2de74002084@kernel.wtf> (raw)
In-Reply-To: <CACVXFVNe4dLFyhaP9BKyR4bdS+zpskFLttPfQMDY0O5RvE0GMA@mail.gmail.com>



On March 5, 2020 04:51:51 Ming Lei <tom.leiming@gmail.com> wrote:

> On Tue, Mar 3, 2020 at 8:37 PM Cengiz Can <cengiz@kernel.wtf> wrote:
>>
>> Added a reassignment into the NULL check block to fix the issue.
>>
>> Fixes: c780e86dd48 ("blktrace: Protect q->blk_trace with RCU")
>>
>> Signed-off-by: Cengiz Can <cengiz@kernel.wtf>
>> ---
>> kernel/trace/blktrace.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
>> index 4560878f0bac..29ea88f10b87 100644
>> --- a/kernel/trace/blktrace.c
>> +++ b/kernel/trace/blktrace.c
>> @@ -1896,8 +1896,10 @@ static ssize_t sysfs_blk_trace_attr_store(struct 
>> device *dev,
>> }
>>
>> ret = 0;
>> -       if (bt == NULL)
>> +       if (bt == NULL) {
>>        ret = blk_trace_setup_queue(q, bdev);
>> +               bt = q->blk_trace;
>
> I'd suggest to use the following line for avoiding RCU warning:
>
>   bt = rcu_dereference_protected(q->blk_trace,
>                                       lockdep_is_held(&q->blk_trace_mutex));
>
> Otherwise, the patch looks fine for me:

Thank you.

Please kindly see v2.

>
> Reviewed-by: Ming Lei <ming.lei@redhat.com>
>
> Thanks,
> Ming Lei




      reply	other threads:[~2020-03-05  4:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 14:28 [PATCH] blktrace: Protect q->blk_trace with RCU Jan Kara
2020-02-06 18:46 ` Chaitanya Kulkarni
2020-02-06 18:49   ` Jens Axboe
2020-02-06 19:37     ` Chaitanya Kulkarni
2020-02-10  0:38 ` Chaitanya Kulkarni
2020-02-10  2:19 ` Ming Lei
2020-02-10  3:54 ` Bart Van Assche
2020-02-19 12:59 ` Jan Kara
2020-02-25 10:20   ` Ming Lei
2020-02-25 15:40     ` Jens Axboe
2020-03-02 20:40 ` Bjorn Helgaas
2020-03-02 21:19   ` Chaitanya Kulkarni
2020-03-02 21:59     ` Bjorn Helgaas
2020-03-02 22:06     ` Keith Busch
2020-03-03 11:07       ` Cengiz Can
2020-03-03 12:17         ` Greg KH
2020-03-05  1:51         ` Ming Lei
2020-03-05  4:27           ` Cengiz Can [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=170a8f261f0.2bfa.85c738e3968116fc5c0dc2de74002084@kernel.wtf \
    --to=cengiz@kernel.wtf \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=helgaas@kernel.org \
    --cc=jack@suse.cz \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tom.leiming@gmail.com \
    --cc=tristmd@gmail.com \
    /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.