summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-02-13 01:07:22 -0800
committerNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 14:37:49 -0800
commit86715569d085addc635c2b55ee8acb79d3a7fbbf (patch)
treeb6b6d554b329a86845d8de661529c3fc2bc6dbef
parent2fbff1276bb635294b3384b6c167f72d0acdab95 (diff)
downloadop-kernel-dev-86715569d085addc635c2b55ee8acb79d3a7fbbf.zip
op-kernel-dev-86715569d085addc635c2b55ee8acb79d3a7fbbf.tar.gz
target: Add SCF_ACK_KREF flag for acknowledgement kref
When TARGET_SCF_ACK_KREF is in use with target_submit_cmd() for setting the extra acknowledgement reference to se_cmd->cmd_kref, go ahead and set SCF_ACK_KREF in order to be used later by abort task. Reported-by: Roland Dreier <roland@purestorage.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/target_core_transport.c4
-rw-r--r--include/target/target_core_base.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 35bae7d..c6b8b82 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -4030,8 +4030,10 @@ void target_get_sess_cmd(struct se_session *se_sess, struct se_cmd *se_cmd,
* fabric acknowledgement that requires two target_put_sess_cmd()
* invocations before se_cmd descriptor release.
*/
- if (ack_kref == true)
+ if (ack_kref == true) {
kref_get(&se_cmd->cmd_kref);
+ se_cmd->se_cmd_flags |= SCF_ACK_KREF;
+ }
spin_lock_irqsave(&se_sess->sess_cmd_lock, flags);
list_add_tail(&se_cmd->se_cmd_list, &se_sess->sess_cmd_list);
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 9d514e0..bbcf803 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -184,7 +184,8 @@ enum se_cmd_flags_table {
SCF_ALUA_NON_OPTIMIZED = 0x00040000,
SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000,
SCF_UNUSED = 0x00100000,
- SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000,
+ SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00200000,
+ SCF_ACK_KREF = 0x00400000,
};
/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
OpenPOWER on IntegriCloud