[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 03/10] nvme-multipath: add error handling support for add_disk()



On Mon, Sep 27, 2021 at 03:00:32PM -0700, Luis Chamberlain wrote:
> +     /*
> +      * test_and_set_bit() is used because it is protecting against two nvme
> +      * paths simultaneously calling device_add_disk() on the same namespace
> +      * head.
> +      */
>       if (!test_and_set_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) {
> -             device_add_disk(&head->subsys->dev, head->disk,
> -                             nvme_ns_id_attr_groups);
> +             rc = device_add_disk(&head->subsys->dev, head->disk,
> +                                  nvme_ns_id_attr_groups);
> +             if (rc)
> +                     return;
> +             set_bit(NVME_NSHEAD_DISK_LIVE, &head->flags);

No need to set_bit() here since the test_and_set_bit() already took care
of that.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.