diff mbox

[-next] target: double locking typo in core_clear_lun_from_tpg()

Message ID 20150519120419.GA12107@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter May 19, 2015, 12:04 p.m. UTC
We accidentally deadlock instead of unlocking.

Fixes: 08d20ff62cde ('target: Acquire lun_entry_mutex during core_disable_device_list_for_node')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Nicholas A. Bellinger May 19, 2015, 6:44 p.m. UTC | #1
On Tue, 2015-05-19 at 15:04 +0300, Dan Carpenter wrote:
> We accidentally deadlock instead of unlocking.
> 
> Fixes: 08d20ff62cde ('target: Acquire lun_entry_mutex during core_disable_device_list_for_node')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
> index 2f4c8fa..20618df 100644
> --- a/drivers/target/target_core_device.c
> +++ b/drivers/target/target_core_device.c
> @@ -433,7 +433,7 @@ void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg)
>  
>  			core_disable_device_list_for_node(lun, deve, nacl, tpg);
>  		}
> -		mutex_lock(&nacl->lun_entry_mutex);
> +		mutex_unlock(&nacl->lun_entry_mutex);
>  	}
>  	mutex_unlock(&tpg->acl_node_mutex);
>  }

Applied to for-next, and will squash into the original soon.

Thanks Dan!

--nab

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 2f4c8fa..20618df 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -433,7 +433,7 @@  void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg)
 
 			core_disable_device_list_for_node(lun, deve, nacl, tpg);
 		}
-		mutex_lock(&nacl->lun_entry_mutex);
+		mutex_unlock(&nacl->lun_entry_mutex);
 	}
 	mutex_unlock(&tpg->acl_node_mutex);
 }