Re: [PATCH] nbd: fix lockdep deadlock warning

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

 



On Wed, Jul 9, 2025 at 3:59 PM Nilay Shroff <nilay@xxxxxxxxxxxxx> wrote:
>
>
>
> On 7/9/25 7:11 AM, Ming Lei wrote:
> > diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> > index 7bdc7eb808ea..136640e4c866 100644
> > --- a/drivers/block/nbd.c
> > +++ b/drivers/block/nbd.c
> > @@ -1473,7 +1473,15 @@ static int nbd_start_device(struct nbd_device *nbd)
> >               return -EINVAL;
> >       }
> >
> > -     blk_mq_update_nr_hw_queues(&nbd->tag_set, config->num_connections);
> > +retry:
> > +     mutex_unlock(&nbd->config_lock);
> > +     blk_mq_update_nr_hw_queues(&nbd->tag_set, num_connections);
> > +     mutex_lock(&nbd->config_lock);
> > +
> > +     /* if another code path updated nr_hw_queues, retry until succeed */
> > +     if (num_connections != config->num_connections)
> > +             goto retry;
> > +
>
> Don't we need to update num_connections to config->num_connections
> here before we attempt retry?

Good catch, will fix it v2.

thanks,






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux