[PATCH v6 05/18] nvmet: Send an AEN on CCR completion
Randy Jennings
randyj at purestorage.com
Fri Oct 30 13:58:46 PDT 2026
On Sun, Sep 20, 2026 at 11:30 AM Mohamed Khalfella
<mkhalfella at purestorage.com> wrote:
>
> When an impacted controller that is the target of pending CCRs is torn
> down, send an AEN to each source controller that issued a CCR against
> it. The notification points to the CCR log page that the source
> controller can read to check which CCR operation completed.
>
> Split nvmet_add_async_event() into a locked helper so the AEN can be
> queued while ctrl->lock is already held.
>
> diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
> index f5d7cb9c943a..69491e8e52ba 100644
> --- a/drivers/nvme/target/core.c
> +++ b/drivers/nvme/target/core.c
> @@ -218,13 +218,19 @@ void nvmet_add_async_event(struct nvmet_ctrl *ctrl, u8 event_type,
> aen->event_info = event_info;
> aen->log_page = log_page;
>
> - mutex_lock(&ctrl->lock);
> list_add_tail(&aen->entry, &ctrl->async_events);
> - mutex_unlock(&ctrl->lock);
>
> queue_work(nvmet_aen_wq, &ctrl->async_event_work);
> }
...
> + lockdep_assert_held(&ctrl->lock);
Is there a reason not to replace the mutex_lock() call with a
lockdep_assert_held() call?
Reviewed-by: Randy Jennings <randyj at purestorage.com>
More information about the Linux-nvme
mailing list