lkml.org 
[lkml]   [2019]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] nvmet: Always remove processed AER elements from list
Date
It will not work as it will consume outstanding command
posted by host for which aen is not generated yet, and
when aen is generated it will not have command in the
async_event_cmds[].

On 11/03/2019 10:55 AM, Chaitanya Kulkarni wrote:
> Something like following on the top of this patch ?
> (compile tested only).
>
> diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
> index b1b9dc58c3b4..36a859082846 100644
> --- a/drivers/nvme/target/core.c
> +++ b/drivers/nvme/target/core.c
> @@ -153,6 +153,18 @@ static void nvmet_async_events_process(struct
> nvmet_ctrl *ctrl, u16 status)
> mutex_unlock(&ctrl->lock);
> nvmet_req_complete(req, status);
> }
> +
> + while (1) {
> + mutex_lock(&ctrl->lock);
> + if (!ctrl->nr_async_event_cmds) {
> + mutex_unlock(&ctrl->lock);
> + return;
> + }
> +
> + req = ctrl->async_event_cmds[--ctrl->nr_async_event_cmds];
> + mutex_unlock(&ctrl->lock);
> + nvmet_req_complete(req, NVME_SC_INTERNAL | NVME_SC_DNR);
> + }
> }
>
> static void nvmet_async_events_free(struct nvmet_ctrl *ctrl)
>


\
 
 \ /
  Last update: 2019-11-03 20:49    [W:0.193 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site