From: Xiubo Li <xiubli@redhat.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: axboe@kernel.dk, mchristi@redhat.com, ming.lei@redhat.com,
linux-block@vger.kernel.org
Subject: Re: [PATCH] nbd: fix possible sysfs duplicate warning
Date: Fri, 11 Oct 2019 08:39:25 +0800 [thread overview]
Message-ID: <d6a76e7f-0e98-ffaa-6543-9684719cc257@redhat.com> (raw)
In-Reply-To: <20191010135654.lvdawtrzk7df6id3@macbook-pro-91.dhcp.thefacebook.com>
On 2019/10/10 21:56, Josef Bacik wrote:
> On Thu, Sep 19, 2019 at 11:44:27AM +0530, xiubli@redhat.com wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> 1. nbd_put takes the mutex and drops nbd->ref to 0. It then does
>> idr_remove and drops the mutex.
>>
>> 2. nbd_genl_connect takes the mutex. idr_find/idr_for_each fails
>> to find an existing device, so it does nbd_dev_add.
>>
>> 3. just before the nbd_put could call nbd_dev_remove or not finished
>> totally, but if nbd_dev_add try to add_disk, we can hit:
>>
>> debugfs: Directory 'nbd1' with parent 'block' already present!
>>
>> This patch will make sure all the disk add/remove stuff are done
>> by holding the nbd_index_mutex lock.
>>
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> Reported-by: Mike Christie <mchristi@redhat.com>
> Sorry, don't know how I missed this.
Many thanks.
Xiubo
> Reviewed-by: Josef Bacik <josef@toxicpanda.com>
>
> Thanks,
>
> Josef
next prev parent reply other threads:[~2019-10-11 0:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-19 6:14 [PATCH] nbd: fix possible sysfs duplicate warning xiubli
2019-10-10 13:56 ` Josef Bacik
2019-10-11 0:39 ` Xiubo Li [this message]
2019-10-10 15:45 ` Jens Axboe
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=d6a76e7f-0e98-ffaa-6543-9684719cc257@redhat.com \
--to=xiubli@redhat.com \
--cc=axboe@kernel.dk \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=mchristi@redhat.com \
--cc=ming.lei@redhat.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).