aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitzan Carmi <nitzanc@mellanox.com>2018-04-09 10:50:26 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2018-05-15 13:28:03 -0400
commit4317228ad9b86f094d70c951f9210a8a9b2816be (patch)
tree6926b575d7c3fa2d091c13be18544fbc76109551
parentf7194ac32ca241d28765a98e42a7fe13debc85a7 (diff)
nvme: Avoid flush dependency in delete controller flow
The nvme_delete_ctrl() function queues a work item on a MEM_RECLAIM queue (nvme_delete_wq), which eventually calls cleanup_srcu_struct(), which in turn flushes a delayed work from an !MEM_RECLAIM queue. This is unsafe as we might trigger deadlocks under severe memory pressure. Since we don't ever invoke call_srcu(), it is safe to use the shiny new _quiesced() version of srcu cleanup, thus avoiding that flush dependency. This commit makes that change. Signed-off-by: Nitzan Carmi <nitzanc@mellanox.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Max Gurtovoy <maxg@mellanox.com> Tested-by: Nicholas Piggin <npiggin@gmail.com>
-rw-r--r--drivers/nvme/host/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 9df4f71e58ca..c3cea8a29843 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -349,7 +349,7 @@ static void nvme_free_ns_head(struct kref *ref)
349 nvme_mpath_remove_disk(head); 349 nvme_mpath_remove_disk(head);
350 ida_simple_remove(&head->subsys->ns_ida, head->instance); 350 ida_simple_remove(&head->subsys->ns_ida, head->instance);
351 list_del_init(&head->entry); 351 list_del_init(&head->entry);
352 cleanup_srcu_struct(&head->srcu); 352 cleanup_srcu_struct_quiesced(&head->srcu);
353 kfree(head); 353 kfree(head);
354} 354}
355 355