Re: [PATCH v2 13/14] nvme-fc: Use CCR to recover controller that hits an error
From: Mohamed Khalfella
Date: Tue Feb 10 2026 - 17:21:08 EST
On Tue 2026-02-10 14:12:24 -0800, James Smart wrote:
> On 1/30/2026 2:34 PM, Mohamed Khalfella wrote:
> > +static void nvme_fc_fenced_work(struct work_struct *work)
> > +{
> > + struct nvme_fc_ctrl *fc_ctrl = container_of(to_delayed_work(work),
> > + struct nvme_fc_ctrl, fenced_work);
> > + struct nvme_ctrl *ctrl = &fc_ctrl->ctrl;
> > +
> > + nvme_change_ctrl_state(ctrl, NVME_CTRL_FENCED);
> > + if (nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING))
> > + queue_work(nvme_reset_wq, &fc_ctrl->ioerr_work);
> > +}
>
> I'm not a fan of 1, maybe 2, state changes that may silently fail. Some
> trace message would be worthwhile to state fencing cancelled/ended.
>
> -- james
>
The change to FENCED should never fail. This is the only transition
allowed from FENCING state and this is the only place we do that.
Do you suggest I put WARN_ON() around it?
The second transition from FENCED to RESETTING can fail if someone
resets the controller. It should be fine to do nothing in this case
because they will have queued reset or error work.