lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YS1I5DuGr0q7/uow@bombadil.infradead.org>
Date:   Mon, 30 Aug 2021 14:08:52 -0700
From:   Luis Chamberlain <mcgrof@...nel.org>
To:     Keith Busch <kbusch@...nel.org>
Cc:     axboe@...nel.dk, colyli@...e.de, kent.overstreet@...il.com,
        sagi@...mberg.me, vishal.l.verma@...el.com,
        dan.j.williams@...el.com, dave.jiang@...el.com,
        ira.weiny@...el.com, konrad.wilk@...cle.com, roger.pau@...rix.com,
        boris.ostrovsky@...cle.com, jgross@...e.com,
        sstabellini@...nel.org, minchan@...nel.org, ngupta@...are.org,
        senozhatsky@...omium.org, xen-devel@...ts.xenproject.org,
        nvdimm@...ts.linux.dev, linux-nvme@...ts.infradead.org,
        linux-bcache@...r.kernel.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/10] nvme-multipath: add error handling support for
 add_disk()

On Fri, Aug 27, 2021 at 01:29:32PM -0700, Keith Busch wrote:
> On Fri, Aug 27, 2021 at 12:18:02PM -0700, Luis Chamberlain wrote:
> > @@ -479,13 +479,17 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
> >  static void nvme_mpath_set_live(struct nvme_ns *ns)
> >  {
> >  	struct nvme_ns_head *head = ns->head;
> > +	int rc;
> >  
> >  	if (!head->disk)
> >  		return;
> >  
> > -	if (!test_and_set_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) {
> > -		device_add_disk(&head->subsys->dev, head->disk,
> > -				nvme_ns_id_attr_groups);
> > +	if (!test_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) {
> 
> This should still be test_and_set_bit() because it is protecting against
> two nvme paths simultaneously calling device_add_disk() on the same
> namespace head.

Interesting, I'll add a comment as well, as this was not clear with the drive
by effort.

  Luis

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ