From e2155e10bfe4b26675c26ddd97dac088e0f69595 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 13 Nov 2012 02:48:45 +0000 Subject: [PATCH] scst: Clarify dev_pr_mutex source code comments Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4614 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 5 +++-- scst/src/scst_pres.c | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index ddcd82d60..54953a476 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -80,9 +80,10 @@ struct mutex scst_mutex; EXPORT_SYMBOL_GPL(scst_mutex); /* - * Secondary level main mutex, inner for scst_mutex. Needed for + * Second level main mutex, inner to scst_mutex and dev_pr_mutex. Needed for * __scst_pr_register_all_tg_pt(), since we can't use scst_mutex there, - * because of the circular locking dependency with dev_pr_mutex. + * because its caller already holds dev_pr_mutex, hence circular locking + * dependency is possible. */ struct mutex scst_mutex2; diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index 557368b99..80ba46b66 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -1212,8 +1212,8 @@ static int scst_pr_register_with_spec_i_pt(struct scst_cmd *cmd, TRACE_PR("Wildcard iSCSI TransportID %s", &transport_id[4]); /* - * We can't use scst_mutex here, because of the - * circular locking dependency with dev_pr_mutex. + * We can't use scst_mutex here because the caller + * already holds dev_pr_mutex. */ spin_lock_bh(&dev->dev_lock); list_for_each_entry(t, &dev->dev_tgt_dev_list, @@ -1320,8 +1320,8 @@ static void scst_pr_unregister_all_tg_pt(struct scst_device *dev, TRACE_ENTRY(); /* - * We can't use scst_mutex here, because of the circular locking - * dependency with dev_pr_mutex. + * We can't use scst_mutex here since the caller already holds + * dev_pr_mutex. */ mutex_lock(&scst_mutex2); @@ -1407,8 +1407,8 @@ static int scst_pr_register_all_tg_pt(struct scst_cmd *cmd, uint8_t *buffer, TRACE_ENTRY(); /* - * We can't use scst_mutex here, because of the circular locking - * dependency with dev_pr_mutex. + * We can't use scst_mutex here because the caller already holds + * dev_pr_mutex. */ mutex_lock(&scst_mutex2);