Message ID | 20240612155135.3060667-2-kbusch@meta.com |
---|---|
State | New |
Headers | show |
Series | [1/2] list: introduce a new cutting helper | expand |
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index f5d150c62955d..30fec15872b3d 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -3959,9 +3959,10 @@ static void nvme_remove_invalid_namespaces(struct nvme_ctrl *ctrl, mutex_lock(&ctrl->namespaces_lock); list_for_each_entry_safe(ns, next, &ctrl->namespaces, list) { - if (ns->head->ns_id > nsid) - list_splice_init_rcu(&ns->list, &rm_list, - synchronize_rcu); + if (ns->head->ns_id > nsid) { + list_cut(&rm_list, &ctrl->namespaces, &ns->list); + break; + } } mutex_unlock(&ctrl->namespaces_lock); synchronize_srcu(&ctrl->srcu);