summary refs log tree commit diff
path: root/drivers/net/mdio.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2016-06-13 22:58:09 -0700
committerNicholas Bellinger <nab@linux-iscsi.org>2016-07-20 00:58:40 -0700
commit410c29dfbfdf73d0d0b5d14a21868ab038eca703 (patch)
tree97fb83380b69b398a4d263f47912a397d3f09b9e /drivers/net/mdio.c
parentdff0ca9ea7dc8be2181a62df4a722c32ce68ff4a (diff)
downloadlinux-410c29dfbfdf73d0d0b5d14a21868ab038eca703.tar.gz
target: Fix ordered task CHECK_CONDITION early exception handling
If a Simple command is sent with a failure, target_setup_cmd_from_cdb
returns with TCM_UNSUPPORTED_SCSI_OPCODE or TCM_INVALID_CDB_FIELD.

So in the cases where target_setup_cmd_from_cdb returns an error, we
never get far enough to call target_execute_cmd to increment simple_cmds.
Since simple_cmds isn't incremented, the result of the failure from
target_setup_cmd_from_cdb causes transport_generic_request_failure to
decrement simple_cmds, due to call to transport_complete_task_attr.

With this dev->simple_cmds or dev->dev_ordered_sync is now -1, not 0.
So when a subsequent command with an Ordered Task is sent, it causes
a hang, since dev->simple_cmds is at -1.

Tested-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Tested-by: Michael Cyr <mikecyr@linux.vnet.ibm.com>
Signed-off-by: Michael Cyr <mikecyr@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # 4.4+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/net/mdio.c')
0 files changed, 0 insertions, 0 deletions