target: Convert se_lun->lun_deve_lock to normal spinlock
This patch converts se_lun->lun_deve_lock acquire/release access to use a normal, non bottom-half spin_lock_t for protecting se_lun->lun_deve_list access. Reported-by: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
parent
c51c8e7bca
commit
1adff1b3a7
@ -968,7 +968,7 @@ static void core_alua_queue_state_change_ua(struct t10_alua_tg_pt_gp *tg_pt_gp)
|
|||||||
continue;
|
continue;
|
||||||
spin_unlock(&tg_pt_gp->tg_pt_gp_lock);
|
spin_unlock(&tg_pt_gp->tg_pt_gp_lock);
|
||||||
|
|
||||||
spin_lock_bh(&lun->lun_deve_lock);
|
spin_lock(&lun->lun_deve_lock);
|
||||||
list_for_each_entry(se_deve, &lun->lun_deve_list, lun_link) {
|
list_for_each_entry(se_deve, &lun->lun_deve_list, lun_link) {
|
||||||
lacl = rcu_dereference_check(se_deve->se_lun_acl,
|
lacl = rcu_dereference_check(se_deve->se_lun_acl,
|
||||||
lockdep_is_held(&lun->lun_deve_lock));
|
lockdep_is_held(&lun->lun_deve_lock));
|
||||||
@ -1000,7 +1000,7 @@ static void core_alua_queue_state_change_ua(struct t10_alua_tg_pt_gp *tg_pt_gp)
|
|||||||
core_scsi3_ua_allocate(se_deve, 0x2A,
|
core_scsi3_ua_allocate(se_deve, 0x2A,
|
||||||
ASCQ_2AH_ASYMMETRIC_ACCESS_STATE_CHANGED);
|
ASCQ_2AH_ASYMMETRIC_ACCESS_STATE_CHANGED);
|
||||||
}
|
}
|
||||||
spin_unlock_bh(&lun->lun_deve_lock);
|
spin_unlock(&lun->lun_deve_lock);
|
||||||
|
|
||||||
spin_lock(&tg_pt_gp->tg_pt_gp_lock);
|
spin_lock(&tg_pt_gp->tg_pt_gp_lock);
|
||||||
percpu_ref_put(&lun->lun_ref);
|
percpu_ref_put(&lun->lun_ref);
|
||||||
|
@ -352,10 +352,10 @@ int core_enable_device_list_for_node(
|
|||||||
hlist_add_head_rcu(&new->link, &nacl->lun_entry_hlist);
|
hlist_add_head_rcu(&new->link, &nacl->lun_entry_hlist);
|
||||||
mutex_unlock(&nacl->lun_entry_mutex);
|
mutex_unlock(&nacl->lun_entry_mutex);
|
||||||
|
|
||||||
spin_lock_bh(&lun->lun_deve_lock);
|
spin_lock(&lun->lun_deve_lock);
|
||||||
list_del(&orig->lun_link);
|
list_del(&orig->lun_link);
|
||||||
list_add_tail(&new->lun_link, &lun->lun_deve_list);
|
list_add_tail(&new->lun_link, &lun->lun_deve_list);
|
||||||
spin_unlock_bh(&lun->lun_deve_lock);
|
spin_unlock(&lun->lun_deve_lock);
|
||||||
|
|
||||||
kref_put(&orig->pr_kref, target_pr_kref_release);
|
kref_put(&orig->pr_kref, target_pr_kref_release);
|
||||||
wait_for_completion(&orig->pr_comp);
|
wait_for_completion(&orig->pr_comp);
|
||||||
@ -369,9 +369,9 @@ int core_enable_device_list_for_node(
|
|||||||
hlist_add_head_rcu(&new->link, &nacl->lun_entry_hlist);
|
hlist_add_head_rcu(&new->link, &nacl->lun_entry_hlist);
|
||||||
mutex_unlock(&nacl->lun_entry_mutex);
|
mutex_unlock(&nacl->lun_entry_mutex);
|
||||||
|
|
||||||
spin_lock_bh(&lun->lun_deve_lock);
|
spin_lock(&lun->lun_deve_lock);
|
||||||
list_add_tail(&new->lun_link, &lun->lun_deve_list);
|
list_add_tail(&new->lun_link, &lun->lun_deve_list);
|
||||||
spin_unlock_bh(&lun->lun_deve_lock);
|
spin_unlock(&lun->lun_deve_lock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -403,9 +403,9 @@ void core_disable_device_list_for_node(
|
|||||||
* NodeACL context specific PR metadata for demo-mode
|
* NodeACL context specific PR metadata for demo-mode
|
||||||
* MappedLUN *deve will be released below..
|
* MappedLUN *deve will be released below..
|
||||||
*/
|
*/
|
||||||
spin_lock_bh(&lun->lun_deve_lock);
|
spin_lock(&lun->lun_deve_lock);
|
||||||
list_del(&orig->lun_link);
|
list_del(&orig->lun_link);
|
||||||
spin_unlock_bh(&lun->lun_deve_lock);
|
spin_unlock(&lun->lun_deve_lock);
|
||||||
/*
|
/*
|
||||||
* Disable struct se_dev_entry LUN ACL mapping
|
* Disable struct se_dev_entry LUN ACL mapping
|
||||||
*/
|
*/
|
||||||
|
@ -709,7 +709,7 @@ static struct t10_pr_registration *__core_scsi3_alloc_registration(
|
|||||||
continue;
|
continue;
|
||||||
spin_unlock(&dev->se_port_lock);
|
spin_unlock(&dev->se_port_lock);
|
||||||
|
|
||||||
spin_lock_bh(&lun_tmp->lun_deve_lock);
|
spin_lock(&lun_tmp->lun_deve_lock);
|
||||||
list_for_each_entry(deve_tmp, &lun_tmp->lun_deve_list, lun_link) {
|
list_for_each_entry(deve_tmp, &lun_tmp->lun_deve_list, lun_link) {
|
||||||
/*
|
/*
|
||||||
* This pointer will be NULL for demo mode MappedLUNs
|
* This pointer will be NULL for demo mode MappedLUNs
|
||||||
@ -742,7 +742,7 @@ static struct t10_pr_registration *__core_scsi3_alloc_registration(
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
kref_get(&deve_tmp->pr_kref);
|
kref_get(&deve_tmp->pr_kref);
|
||||||
spin_unlock_bh(&lun_tmp->lun_deve_lock);
|
spin_unlock(&lun_tmp->lun_deve_lock);
|
||||||
/*
|
/*
|
||||||
* Grab a configfs group dependency that is released
|
* Grab a configfs group dependency that is released
|
||||||
* for the exception path at label out: below, or upon
|
* for the exception path at label out: below, or upon
|
||||||
@ -779,9 +779,9 @@ static struct t10_pr_registration *__core_scsi3_alloc_registration(
|
|||||||
|
|
||||||
list_add_tail(&pr_reg_atp->pr_reg_atp_mem_list,
|
list_add_tail(&pr_reg_atp->pr_reg_atp_mem_list,
|
||||||
&pr_reg->pr_reg_atp_list);
|
&pr_reg->pr_reg_atp_list);
|
||||||
spin_lock_bh(&lun_tmp->lun_deve_lock);
|
spin_lock(&lun_tmp->lun_deve_lock);
|
||||||
}
|
}
|
||||||
spin_unlock_bh(&lun_tmp->lun_deve_lock);
|
spin_unlock(&lun_tmp->lun_deve_lock);
|
||||||
|
|
||||||
spin_lock(&dev->se_port_lock);
|
spin_lock(&dev->se_port_lock);
|
||||||
percpu_ref_put(&lun_tmp->lun_ref);
|
percpu_ref_put(&lun_tmp->lun_ref);
|
||||||
|
Loading…
Reference in New Issue
Block a user