Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256893
b: refs/heads/master
c: 5e1be91
h: refs/heads/master
i:
  256891: db8120b
v: v3
  • Loading branch information
Roland Dreier authored and Nicholas Bellinger committed Jul 22, 2011
1 parent ad4a332 commit dec0311
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56e34ee2adb59a35bfa5714bdf4dcb3f4d14a41d
refs/heads/master: 5e1be919820175a2becc3c72051050aaa3fae954
9 changes: 5 additions & 4 deletions trunk/drivers/target/target_core_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,15 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u32 unpacked_lun)
struct se_lun *se_lun = NULL;
struct se_session *se_sess = se_cmd->se_sess;
struct se_tmr_req *se_tmr = se_cmd->se_tmr_req;
unsigned long flags;

if (unpacked_lun >= TRANSPORT_MAX_LUNS_PER_TPG) {
se_cmd->scsi_sense_reason = TCM_NON_EXISTENT_LUN;
se_cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION;
return -ENODEV;
}

spin_lock_irq(&se_sess->se_node_acl->device_list_lock);
spin_lock_irqsave(&se_sess->se_node_acl->device_list_lock, flags);
se_cmd->se_deve = &se_sess->se_node_acl->device_list[unpacked_lun];
deve = se_cmd->se_deve;

Expand All @@ -200,7 +201,7 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u32 unpacked_lun)
se_cmd->orig_fe_lun = unpacked_lun;
se_cmd->se_orig_obj_ptr = se_cmd->se_dev;
}
spin_unlock_irq(&se_sess->se_node_acl->device_list_lock);
spin_unlock_irqrestore(&se_sess->se_node_acl->device_list_lock, flags);

if (!se_lun) {
printk(KERN_INFO "TARGET_CORE[%s]: Detected NON_EXISTENT_LUN"
Expand All @@ -223,9 +224,9 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u32 unpacked_lun)
se_cmd->se_dev = se_lun->lun_se_dev;
se_tmr->tmr_dev = se_lun->lun_se_dev;

spin_lock(&se_tmr->tmr_dev->se_tmr_lock);
spin_lock_irqsave(&se_tmr->tmr_dev->se_tmr_lock, flags);
list_add_tail(&se_tmr->tmr_list, &se_tmr->tmr_dev->dev_tmr_list);
spin_unlock(&se_tmr->tmr_dev->se_tmr_lock);
spin_unlock_irqrestore(&se_tmr->tmr_dev->se_tmr_lock, flags);

return 0;
}
Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/target/target_core_tmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ void core_tmr_release_req(
return;
}

spin_lock(&dev->se_tmr_lock);
spin_lock_irq(&dev->se_tmr_lock);
list_del(&tmr->tmr_list);
spin_unlock(&dev->se_tmr_lock);
spin_unlock_irq(&dev->se_tmr_lock);

kmem_cache_free(se_tmr_req_cache, tmr);
}
Expand Down Expand Up @@ -154,7 +154,7 @@ int core_tmr_lun_reset(
* Release all pending and outgoing TMRs aside from the received
* LUN_RESET tmr..
*/
spin_lock(&dev->se_tmr_lock);
spin_lock_irq(&dev->se_tmr_lock);
list_for_each_entry_safe(tmr_p, tmr_pp, &dev->dev_tmr_list, tmr_list) {
/*
* Allow the received TMR to return with FUNCTION_COMPLETE.
Expand All @@ -176,17 +176,17 @@ int core_tmr_lun_reset(
(core_scsi3_check_cdb_abort_and_preempt(
preempt_and_abort_list, cmd) != 0))
continue;
spin_unlock(&dev->se_tmr_lock);
spin_unlock_irq(&dev->se_tmr_lock);

spin_lock_irqsave(&cmd->t_state_lock, flags);
if (!(atomic_read(&cmd->t_transport_active))) {
spin_unlock_irqrestore(&cmd->t_state_lock, flags);
spin_lock(&dev->se_tmr_lock);
spin_lock_irq(&dev->se_tmr_lock);
continue;
}
if (cmd->t_state == TRANSPORT_ISTATE_PROCESSING) {
spin_unlock_irqrestore(&cmd->t_state_lock, flags);
spin_lock(&dev->se_tmr_lock);
spin_lock_irq(&dev->se_tmr_lock);
continue;
}
DEBUG_LR("LUN_RESET: %s releasing TMR %p Function: 0x%02x,"
Expand All @@ -196,9 +196,9 @@ int core_tmr_lun_reset(
spin_unlock_irqrestore(&cmd->t_state_lock, flags);

transport_cmd_finish_abort_tmr(cmd);
spin_lock(&dev->se_tmr_lock);
spin_lock_irq(&dev->se_tmr_lock);
}
spin_unlock(&dev->se_tmr_lock);
spin_unlock_irq(&dev->se_tmr_lock);
/*
* Complete outstanding struct se_task CDBs with TASK_ABORTED SAM status.
* This is following sam4r17, section 5.6 Aborting commands, Table 38
Expand Down

0 comments on commit dec0311

Please sign in to comment.