[PATCH 1/1] nvme-core : remove redundant check from nvme_init_ns_head

Sagi Grimberg sagi at grimberg.me
Thu May 18 02:06:53 PDT 2023


> nvme_find_ns_head already checks that the list of namescpaces
> in an already existing namespace head is not empty
> 
> Signed-off-by: Irvin Cote <irvincoteg at gmail.com>
> ---
>   drivers/nvme/host/core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index ccb6eb1282f8..54a8eadd9876 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4209,7 +4209,7 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
>   			goto out_put_ns_head;
>   		}
>   
> -		if (!multipath && !list_empty(&head->list)) {
> +		if (!multipath) {
>   			dev_warn(ctrl->device,
>   				"Found shared namespace %d, but multipathing not supported.\n",
>   				info->nsid);

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>



More information about the Linux-nvme mailing list