From: Mike Snitzer <snitzer@redhat.com>
To: Bart Van Assche <Bart.VanAssche@wdc.com>
Cc: "hch@lst.de" <hch@lst.de>,
"dm-devel@redhat.com" <dm-devel@redhat.com>,
"hare@suse.de" <hare@suse.de>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"tom.leiming@gmail.com" <tom.leiming@gmail.com>,
"axboe@kernel.dk" <axboe@kernel.dk>
Subject: Re: [for-4.16 PATCH v3 2/3] block: allow gendisk's request_queue registration to be deferred
Date: Thu, 11 Jan 2018 14:20:27 -0500 [thread overview]
Message-ID: <20180111192027.GA31104@redhat.com> (raw)
In-Reply-To: <1515692836.2752.42.camel@wdc.com>
On Thu, Jan 11 2018 at 12:47pm -0500,
Bart Van Assche <Bart.VanAssche@wdc.com> wrote:
> On Thu, 2018-01-11 at 12:29 -0500, Mike Snitzer wrote:
> > On Thu, Jan 11 2018 at 12:18pm -0500,
> > Bart Van Assche <Bart.VanAssche@wdc.com> wrote:
> >
> > > On Thu, 2018-01-11 at 12:04 -0500, Mike Snitzer wrote:
> > > > So my v4, that I'll send out shortly, won't be using test_and_clear_bit()
> > >
> > > Please use queue_flag_set(), queue_flag_clear(), queue_flag_test_and_clear() and/or
> > > queue_flag_test_and_set() to manipulate queue flags.
> >
> > Can you please expand on this? My patch is only using test_bit().
>
> Hello Mike,
>
> I was referring to the following code, which apparenly is existing code:
>
> mutex_lock(&q->sysfs_lock);
> queue_flag_clear_unlocked(QUEUE_FLAG_REGISTERED, q);
> mutex_unlock(&q->sysfs_lock);
>
> The above code is wrong. Other code that changes the queue flags protects
> these changes with the the queue lock. The above code should be changed into
> the following:
>
> spin_lock_irq(q->queue_lock);
> queue_flag_clear(QUEUE_FLAG_REGISTERED, q);
> spin_unlock_irq(q->queue_lock);
>
> The only functions from which it is safe to call queue_flag_(set|clear)_unlocked()
> without holding the queue lock are blk_alloc_queue_node() and
> __blk_release_queue() because for these functions it is guaranteed that no queue
> flag changes can happen from another context, e.g. through a blk_set_queue_dying()
> call.
Yes, I noticed the use of sysfs_lock also. I've fixed it up earlier in
my v4 patchset and build on it. I'll add your Reported-by too.
Mike
next prev parent reply other threads:[~2018-01-11 19:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 2:12 [for-4.16 PATCH v3 0/3] block/dm: allow DM to defer blk_register_queue() until ready Mike Snitzer
2018-01-11 2:12 ` [for-4.16 PATCH v3 1/3] block: only bdi_unregister() in del_gendisk() if !GENHD_FL_HIDDEN Mike Snitzer
2018-01-11 2:48 ` Ming Lei
2018-01-11 7:40 ` Hannes Reinecke
2018-01-11 2:12 ` [for-4.16 PATCH v3 2/3] block: allow gendisk's request_queue registration to be deferred Mike Snitzer
2018-01-11 2:54 ` Ming Lei
2018-01-11 7:46 ` Hannes Reinecke
2018-01-11 17:04 ` Mike Snitzer
2018-01-11 17:18 ` Bart Van Assche
2018-01-11 17:29 ` Mike Snitzer
2018-01-11 17:47 ` Bart Van Assche
2018-01-11 19:20 ` Mike Snitzer [this message]
2018-01-11 19:32 ` Bart Van Assche
2018-01-11 19:50 ` Mike Snitzer
2018-01-11 7:56 ` Hannes Reinecke
2018-01-11 16:03 ` Mike Snitzer
2018-01-11 2:12 ` [for-4.16 PATCH v3 3/3] dm: fix awkward and incomplete request_queue initialization Mike Snitzer
2018-01-11 2:56 ` Ming Lei
2018-01-11 7:57 ` Hannes Reinecke
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=20180111192027.GA31104@redhat.com \
--to=snitzer@redhat.com \
--cc=Bart.VanAssche@wdc.com \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=tom.leiming@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).