target: Make target_release_cmd_kref release on empty list
authorNicholas Bellinger <nab@linux-iscsi.org>
Mon, 13 Feb 2012 10:35:01 +0000 (02:35 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sat, 25 Feb 2012 22:37:49 +0000 (14:37 -0800)
commitffc32d5259d107a3aa1b822e22f20b69cb9ec0a5
tree770ec5b87b91c9c1bc7edd76c8a1535259424696
parent86715569d085addc635c2b55ee8acb79d3a7fbbf
target: Make target_release_cmd_kref release on empty list

This patch changes target_release_cmd_kref() to make TFO->release_cmd()
call when list_empty(&se_cmd->se_cmd_list) is TRUE.  This is required
for TMR_ABORT_TASK operation where the referenced tag descriptor may
have already been pulled of the session command list.

Reported-by: Roland Dreier <roland@purestorage.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c