Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurence Oberman <loberman@redhat.com>
To: Ewan Milne <emilne@redhat.com>,
	linux-nvme@lists.infradead.org,  justin.tee@broadcom.com,
	Johannes.Thumshirn@wdc.com
Subject: Re: [PATCH] nvme: nvme-fc: Fix nvme_fc_create_hw_io_queues() queue deletion in error path
Date: Tue, 30 Jun 2026 16:19:38 -0400	[thread overview]
Message-ID: <bc8ecded9145e89cc1a36e93afe37d431d7141c3.camel@redhat.com> (raw)
In-Reply-To: <CAGtn9rkvFU0aKz6ktJyK3Z8TSGYz0F1YfopeFV+LswUP5yE3ig@mail.gmail.com>

On Tue, 2026-06-30 at 14:56 -0400, Ewan Milne wrote:
> On Wed, May 13, 2026 at 3:27 PM Ewan D. Milne <emilne@redhat.com>
> wrote:
> > 
> > nvme_fc_create_hw_io_queues() will call __nvme_fc_delete_hw_queue()
> > for the
> > last queue on which __nvme_fc_create_hw_queue() reported an error
> > when deleting
> > all the io queues if they cannot all be created.  This is incorrect
> > since the
> > last queue did not actually get created.
> > 
> > The most recent change to this code was commit 17a1ec08ce70
> > ("nvme/fc: simplify
> > error handling of nvme_fc_create_hw_io_queues") which moved the
> > cleanup to the
> > delete_queues: label and changed the loop bounds, however the code
> > was not
> > correct prior to this change in a different way.  The original
> > commit
> > e399441de911 ("nvme-fabrics: Add host support for FC transport")
> > had a
> > different error which called __nvme_fc_delete_hw_queue() on queue
> > index 0 which
> > is used for the admin queue.
> > 
> > Fix this by correcting the initial loop index when deleting the io
> > queues.
> > 
> > Fixes: 17a1ec08ce70 ("nvme/fc: simplify error handling of
> > nvme_fc_create_hw_io_queues")
> > Fixes: e399441de911 ("nvme-fabrics: Add host support for FC
> > transport")
> > Cc: stable@vger.kernel.org
> > Assisted-by: Claude:claude-opus-4-6
> > Signed-off-by: Ewan D. Milne <emilne@redhat.com>
> > ---
> >  drivers/nvme/host/fc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> > index e4f4528fe2a2..f5a83798f3a9 100644
> > --- a/drivers/nvme/host/fc.c
> > +++ b/drivers/nvme/host/fc.c
> > @@ -2318,7 +2318,7 @@ nvme_fc_create_hw_io_queues(struct
> > nvme_fc_ctrl *ctrl, u16 qsize)
> >         return 0;
> > 
> >  delete_queues:
> > -       for (; i > 0; i--)
> > +       for (--i; i > 0; i--)
> >                 __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i],
> > i);
> >         return ret;
> >  }
> > --
> > 2.52.0
> > 
> > 
> 
> Gentle ping for reviews.
> 
> -Ewan
> 

Looks good to me, loop index is corrected.

Reviewed-by: Laurence Oberman <loberman@redhat.com>



      reply	other threads:[~2026-06-30 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 19:25 [PATCH] nvme: nvme-fc: Fix nvme_fc_create_hw_io_queues() queue deletion in error path Ewan D. Milne
2026-05-13 21:48 ` Justin Tee
2026-06-30 18:56 ` Ewan Milne
2026-06-30 20:19   ` Laurence Oberman [this message]

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=bc8ecded9145e89cc1a36e93afe37d431d7141c3.camel@redhat.com \
    --to=loberman@redhat.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=emilne@redhat.com \
    --cc=justin.tee@broadcom.com \
    --cc=linux-nvme@lists.infradead.org \
    /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