SCSI target development
 help / color / mirror / Atom feed
* [PATCH 1/1] scsi: target: Fix complete_type use
@ 2026-03-07 22:06 Mike Christie
  2026-03-11  1:32 ` Martin K. Petersen
  2026-03-16  1:41 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Christie @ 2026-03-07 22:06 UTC (permalink / raw)
  To: d.bogdanov, martin.petersen, linux-scsi, target-devel; +Cc: Mike Christie

There were two copy and paste type of errors where I swapped
complete with submit names. This patch uses the correct variables
and definitions.

This problem was found by Dmitry Bogdanov and this patch builds
on top of his patch to fix a second instance that was found.

Fixes: 06933066d88a3 ("scsi: target: Add support for completing commands from backend context")
Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
[Fixed second instance]
Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/target/target_core_device.c    | 2 +-
 drivers/target/target_core_transport.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fbc8ab65372e..9db2201aa553 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -813,7 +813,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
 				DA_UNMAP_ZEROES_DATA_DEFAULT;
 	dev->dev_attrib.max_write_same_len = DA_MAX_WRITE_SAME_LEN;
 	dev->dev_attrib.submit_type = TARGET_FABRIC_DEFAULT_SUBMIT;
-	dev->dev_attrib.submit_type = TARGET_FABRIC_DEFAULT_COMPL;
+	dev->dev_attrib.complete_type = TARGET_FABRIC_DEFAULT_COMPL;
 
 	/* Skip allocating lun_stats since we can't export them. */
 	xcopy_lun = &dev->xcopy_lun;
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 34249fb80c67..4e8d779dda5e 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -917,7 +917,7 @@ static void target_complete(struct se_cmd *cmd, int success)
 	da = &cmd->se_dev->dev_attrib;
 	if (da->complete_type == TARGET_FABRIC_DEFAULT_COMPL)
 		compl_type = wwn->wwn_tf->tf_ops->default_compl_type;
-	else if (da->complete_type == TARGET_DIRECT_SUBMIT &&
+	else if (da->complete_type == TARGET_DIRECT_COMPL &&
 		 wwn->wwn_tf->tf_ops->direct_compl_supp)
 		compl_type = TARGET_DIRECT_COMPL;
 	else
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] scsi: target: Fix complete_type use
  2026-03-07 22:06 [PATCH 1/1] scsi: target: Fix complete_type use Mike Christie
@ 2026-03-11  1:32 ` Martin K. Petersen
  2026-03-16  1:41 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2026-03-11  1:32 UTC (permalink / raw)
  To: Mike Christie; +Cc: martin.petersen, linux-scsi, target-devel


Mike,

> There were two copy and paste type of errors where I swapped complete
> with submit names. This patch uses the correct variables and
> definitions.

Applied to 7.1/scsi-staging, thanks!

-- 
Martin K. Petersen

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] scsi: target: Fix complete_type use
  2026-03-07 22:06 [PATCH 1/1] scsi: target: Fix complete_type use Mike Christie
  2026-03-11  1:32 ` Martin K. Petersen
@ 2026-03-16  1:41 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2026-03-16  1:41 UTC (permalink / raw)
  To: d.bogdanov, linux-scsi, target-devel, Mike Christie; +Cc: Martin K . Petersen

On Sat, 07 Mar 2026 16:06:30 -0600, Mike Christie wrote:

> There were two copy and paste type of errors where I swapped
> complete with submit names. This patch uses the correct variables
> and definitions.
> 
> This problem was found by Dmitry Bogdanov and this patch builds
> on top of his patch to fix a second instance that was found.
> 
> [...]

Applied to 7.1/scsi-queue, thanks!

[1/1] scsi: target: Fix complete_type use
      https://git.kernel.org/mkp/scsi/c/3e70441fb508

-- 
Martin K. Petersen

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-16  1:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-07 22:06 [PATCH 1/1] scsi: target: Fix complete_type use Mike Christie
2026-03-11  1:32 ` Martin K. Petersen
2026-03-16  1:41 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox