[PATCH v5 08/14] nvmet-fcloop: prevent double port deletion
Daniel Wagner
dwagner at suse.de
Thu Apr 24 04:32:49 PDT 2025
On Thu, Apr 24, 2025 at 12:17:32PM +0200, Hannes Reinecke wrote:
> > struct fcloop_rport *rport = remoteport->private;
> > + bool delete_port = true;
> > unsigned long flags;
> > flush_work(&rport->ls_work);
> > spin_lock_irqsave(&fcloop_lock, flags);
> > + if (test_and_set_bit(PORT_DELETED, &rport->flags))
> > + delete_port = false;
> > rport->nport->rport = NULL;
> > spin_unlock_irqrestore(&fcloop_lock, flags);
> > + if (!delete_port)
> > + return;
> > +
>
> The double negation is hard to follow. Can't you
> rename it to 'put_port' or somesuch and invert the logic?
Yes, was also not really happy with it but didn't really come up with a
good name. Thanks!
More information about the Linux-nvme
mailing list