]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target: Fix ordered CMD_T_SENT handling
authorMike Christie <michael.christie@oracle.com>
Thu, 30 Sep 2021 02:04:18 +0000 (21:04 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 19 Oct 2021 02:38:35 +0000 (22:38 -0400)
commitd57b1acecb24deb92c7f81588ab983cd9dc3d744
treecb8e855c574e6cc026c810ddf94d403e6b2abb41
parenta975889914f8f16d8b1a77c2f69567bdbbb6ff00
scsi: target: Fix ordered CMD_T_SENT handling

We can race where target_handle_task_attr() has put the cmd on the
delayed_cmd_list. Then target_restart_delayed_cmds() has removed it and set
CMD_T_SENT, but then target_execute_cmd() now clears that bit.

This patch moves the clearing to before we've put the cmd on the list.

Link: https://lore.kernel.org/r/20210930020422.92578-2-michael.christie@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_transport.c