Skip to contentSkip to conversation

target: double locking typo in core_clear_lun_from_tpg()

PATCH Applied Dan Carpenter 2 participants 2 messages May 19, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target: double locking typo in core_clear_lun_from_tpg()

We accidentally deadlock instead of unlocking.

Fixes 08d20ff62cde ('target: Acquire lun_entry_mutex during core_disable_device_list_for_node')
drivers/target/target_core_device.c +1 -1
index 2f4c8fa..20618df 100644
@@ -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);
 }
#1 lore raw
Quoted 10 lines · Dan Carpenter

We accidentally deadlock instead of unlocking.

Fixes 08d20ff62cde ('target: Acquire lun_entry_mutex during core_disable_device_list_for_node')
drivers/target/target_core_device.c +0 -0
index 2f4c8fa..20618df 100644

drivers/target/target_core_device.c void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg) · line 439

Quoted 8 lines
drivers/target/target_core_device.c +1 -1
@@ -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