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: <CAPpK+O14EoCUJjShTEDV+rTLfLC1GBWm+sv2C1quPdK8fJnEbw@mail.gmail.com>
Date: Fri, 19 Dec 2025 17:44:50 -0800
From: Randy Jennings <randyj@...estorage.com>
To: Mohamed Khalfella <mkhalfella@...estorage.com>
Cc: Chaitanya Kulkarni <kch@...dia.com>, Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>, 
	Keith Busch <kbusch@...nel.org>, Sagi Grimberg <sagi@...mberg.me>, 
	Aaron Dailey <adailey@...estorage.com>, John Meneghini <jmeneghi@...hat.com>, 
	Hannes Reinecke <hare@...e.de>, linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 14/14] nvme-fc: Hold inflight requests while in
 RECOVERING state

On Tue, Nov 25, 2025 at 6:13 PM Mohamed Khalfella
<mkhalfella@...estorage.com> wrote:

> Signed-off-by: Mohamed Khalfella <mkhalfella@...estorage.com>

> diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c

> @@ -2083,17 +2092,34 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)

> +       /*
> +        * We can not access op after the request is completed because it can
> +        * be reused immediately. At the same time we want to wakeup the thread
> +        * waiting for ongoing IOs _after_ requests are completed. This is
> +        * necessary because that thread will start canceling inflight IOs
> +        * and we want to avoid request completion racing with cancellation.
> +        */
> +       op_term = __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate);
> +
> +       /* Error recovery completes inflight reqeusts when it is safe */
"reqeusts" -> "requests"

> +       if (nvme_ctrl_state(&ctrl->ctrl) == NVME_CTRL_RECOVERING)
> +               goto check_op_term;
> +
>         if (!nvme_try_complete_req(rq, status, result))
>                 nvme_fc_complete_rq(rq);
>
> +check_op_term:
> +       if (op_term)
> +               __nvme_fc_fcpop_count_one_down(ctrl);

I think it is easier to grok:
+       op_term = __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate);
+
+       /* Error recovery completes inflight reqeusts when it is safe */
+       if (nvme_ctrl_state(&ctrl->ctrl) != NVME_CTRL_RECOVERING &&
+           !nvme_try_complete_req(rq, status, result))
                nvme_fc_complete_rq(rq);
+
+       if (op_term)
+               __nvme_fc_fcpop_count_one_down(ctrl);

Reviewed-by: Randy Jennings <randyj@...estorage.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ