From: Bart Van Assche <bart.vanassche@wdc.com>
To: Jianchao Wang <jianchao.w.wang@oracle.com>,
"axboe@kernel.dk" <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] blk-mq-fs: invoke queue_for_each_hw_ctx under sysfs_lock
Date: Tue, 26 Jun 2018 08:29:33 -0700 [thread overview]
Message-ID: <d7b196bf-be18-a8f0-29ce-4f705689babe@wdc.com> (raw)
In-Reply-To: <1529907699-2054-1-git-send-email-jianchao.w.wang@oracle.com>
On 06/24/18 23:20, Jianchao Wang wrote:
> blk_mq_run_hw_queues and blk_mq_start_stopped_hw_queues in
> queue_state_write will invoke queue_for_each_hw_ctx. It will race
> with blk_mq_realloc_hw_ctxs and incur NULL pointer reference. Put
> them under sysfs_lock to serialize the accessing to queue_hw_ctx
> and nr_hw_queues.
The above looks wrong to me. blk_mq_realloc_hw_ctxs() starts with
calling blk_mq_unregister_hctx(). That last function uses kobject_del()
and kobject_del() waits until all pending sysfs callback functions for
the deleted objects have finished.
Bart.
prev parent reply other threads:[~2018-06-26 15:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-25 6:21 [PATCH] blk-mq-fs: invoke queue_for_each_hw_ctx under sysfs_lock Jianchao Wang
2018-06-26 15:29 ` Bart Van Assche [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=d7b196bf-be18-a8f0-29ce-4f705689babe@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=axboe@kernel.dk \
--cc=jianchao.w.wang@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 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).