[PATCH V3 02/10] nvme-core: use xarray for ctrl ns tracking

Keith Busch kbusch at kernel.org
Tue Jul 14 20:55:09 EDT 2020


On Tue, Jul 14, 2020 at 04:30:49PM -0700, Chaitanya Kulkarni wrote:
> @@ -3933,9 +3918,7 @@ static void nvme_ns_remove(struct nvme_ns *ns)
>  			blk_integrity_unregister(ns->disk);
>  	}
>  
> -	down_write(&ns->ctrl->namespaces_rwsem);
> -	list_del_init(&ns->list);
> -	up_write(&ns->ctrl->namespaces_rwsem);
> +	xa_erase(xa, ns->head->ns_id);

Since you're using rcu to protect the kref_get() on load, we need a
synchronize_rcu() after removing it from the xarray.



More information about the Linux-nvme mailing list