Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tcmu_cdb_get_length() will return 10 for vendor specific cdb

tcmur_cmdproc_thread() will not drop vendor specific command
  • Loading branch information
rkawase committed Sep 25, 2024
1 parent 1bdb239 commit 4fa0bf5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ int tcmu_cdb_get_length(uint8_t *cdb)
return 12;
case 6: /*110b Vendor Specific */
case 7: /*111b Vendor Specific */
return 10;
default:
/* TODO: */
goto cdb_not_supp;
Expand Down Expand Up @@ -327,7 +328,6 @@ void tcmu_cdb_print_info(struct tcmu_device *dev,
char fix[CDB_FIX_SIZE], *buf;

buf = fix;

bytes = tcmu_cdb_get_length(cmd->cdb);
if (bytes < 0)
return;
Expand Down
24 changes: 17 additions & 7 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,13 +814,23 @@ static void *tcmur_cmdproc_thread(void *arg)
if (tcmu_get_log_level() == TCMU_LOG_DEBUG_SCSI_CMD)
tcmu_cdb_print_info(dev, cmd, NULL);

if (tcmur_handler_is_passthrough_only(rhandler))
ret = tcmur_cmd_passthrough_handler(dev, cmd);
else
ret = tcmur_generic_handle_cmd(dev, cmd);

if (ret == TCMU_STS_NOT_HANDLED)
tcmu_cdb_print_info(dev, cmd, "is not supported");
if (cmd->cdb[0] <= 0xC0) {
if (tcmur_handler_is_passthrough_only(rhandler))
ret = tcmur_cmd_passthrough_handler(dev, cmd);
else
ret = tcmur_generic_handle_cmd(dev, cmd);

if (ret == TCMU_STS_NOT_HANDLED)
tcmu_cdb_print_info(dev, cmd, "is not supported");
} else {
/*
* Vendor specific opcodes are currently not supported in TCMU
* given it requires callbacks that currently don't exist for
* TCMU backstores.
*/
ret = TCMU_STS_NOT_HANDLED;
tcmu_cdb_print_info(dev, cmd, "Vendor specific opcodes not supported.");
}

/*
* command (processing) completion is called in the following
Expand Down

0 comments on commit 4fa0bf5

Please sign in to comment.