diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-03-08 18:33:47 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-06-01 03:24:44 -0400 |
commit | 403edd78a2851ef95b24c0bf5151a4ab640898d7 (patch) | |
tree | 66ab8314fe3281d25f8fced91c973d5b6d5c40ba /drivers/target/target_core_pr.c | |
parent | 6bb826121be244a5a3c8bd8b7d45c47df18810b7 (diff) |
target: Convert se_tpg->acl_node_lock to ->acl_node_mutex
This patch converts se_tpg->acl_node_lock to struct mutex, so that
->acl_node_acl walkers in core_clear_lun_from_tpg() can block when
calling core_disable_device_list_for_node().
It also updates core_dev_add_lun() to hold ->acl_node_mutex when
calling core_tpg_add_node_to_devs() to build ->lun_entry_hlist
for dynamically generated se_node_acl.
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_pr.c')
-rw-r--r-- | drivers/target/target_core_pr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 1e89679ad606..b983f8a54766 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
@@ -1589,12 +1589,12 @@ core_scsi3_decode_spec_i_port( | |||
1589 | * from the decoded fabric module specific TransportID | 1589 | * from the decoded fabric module specific TransportID |
1590 | * at *i_str. | 1590 | * at *i_str. |
1591 | */ | 1591 | */ |
1592 | spin_lock_irq(&tmp_tpg->acl_node_lock); | 1592 | mutex_lock(&tmp_tpg->acl_node_mutex); |
1593 | dest_node_acl = __core_tpg_get_initiator_node_acl( | 1593 | dest_node_acl = __core_tpg_get_initiator_node_acl( |
1594 | tmp_tpg, i_str); | 1594 | tmp_tpg, i_str); |
1595 | if (dest_node_acl) | 1595 | if (dest_node_acl) |
1596 | atomic_inc_mb(&dest_node_acl->acl_pr_ref_count); | 1596 | atomic_inc_mb(&dest_node_acl->acl_pr_ref_count); |
1597 | spin_unlock_irq(&tmp_tpg->acl_node_lock); | 1597 | mutex_unlock(&tmp_tpg->acl_node_mutex); |
1598 | 1598 | ||
1599 | if (!dest_node_acl) { | 1599 | if (!dest_node_acl) { |
1600 | core_scsi3_tpg_undepend_item(tmp_tpg); | 1600 | core_scsi3_tpg_undepend_item(tmp_tpg); |
@@ -3308,12 +3308,12 @@ after_iport_check: | |||
3308 | /* | 3308 | /* |
3309 | * Locate the destination struct se_node_acl from the received Transport ID | 3309 | * Locate the destination struct se_node_acl from the received Transport ID |
3310 | */ | 3310 | */ |
3311 | spin_lock_irq(&dest_se_tpg->acl_node_lock); | 3311 | mutex_lock(&dest_se_tpg->acl_node_mutex); |
3312 | dest_node_acl = __core_tpg_get_initiator_node_acl(dest_se_tpg, | 3312 | dest_node_acl = __core_tpg_get_initiator_node_acl(dest_se_tpg, |
3313 | initiator_str); | 3313 | initiator_str); |
3314 | if (dest_node_acl) | 3314 | if (dest_node_acl) |
3315 | atomic_inc_mb(&dest_node_acl->acl_pr_ref_count); | 3315 | atomic_inc_mb(&dest_node_acl->acl_pr_ref_count); |
3316 | spin_unlock_irq(&dest_se_tpg->acl_node_lock); | 3316 | mutex_unlock(&dest_se_tpg->acl_node_mutex); |
3317 | 3317 | ||
3318 | if (!dest_node_acl) { | 3318 | if (!dest_node_acl) { |
3319 | pr_err("Unable to locate %s dest_node_acl for" | 3319 | pr_err("Unable to locate %s dest_node_acl for" |