Commit 15e2ab5f authored by Nicholas Bellinger's avatar Nicholas Bellinger Committed by Greg Kroah-Hartman

target: Fix transport_cmd_finish_abort queue removal bug

commit 77039d1e upstream.

This patch fixes a bug in LUN_RESET operation with transport_cmd_finish_abort()
where transport_remove_cmd_from_queue() was incorrectly being called, causing
descriptors with t_state == TRANSPORT_FREE_CMD_INTR to be incorrectly removed
from qobj->qobj_list during process context release.  This change ensures the
descriptor is only removed via transport_remove_cmd_from_queue() when doing a
direct release via transport_generic_remove().
Signed-off-by: default avatarNicholas Bellinger <nab@risingtidesystems.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4013ba5c
...@@ -594,13 +594,14 @@ static void transport_lun_remove_cmd(struct se_cmd *cmd) ...@@ -594,13 +594,14 @@ static void transport_lun_remove_cmd(struct se_cmd *cmd)
void transport_cmd_finish_abort(struct se_cmd *cmd, int remove) void transport_cmd_finish_abort(struct se_cmd *cmd, int remove)
{ {
transport_remove_cmd_from_queue(cmd, &cmd->se_dev->dev_queue_obj);
transport_lun_remove_cmd(cmd); transport_lun_remove_cmd(cmd);
if (transport_cmd_check_stop_to_fabric(cmd)) if (transport_cmd_check_stop_to_fabric(cmd))
return; return;
if (remove) if (remove) {
transport_remove_cmd_from_queue(cmd, &cmd->se_dev->dev_queue_obj);
transport_generic_remove(cmd, 0); transport_generic_remove(cmd, 0);
}
} }
void transport_cmd_finish_abort_tmr(struct se_cmd *cmd) void transport_cmd_finish_abort_tmr(struct se_cmd *cmd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment