Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct drop and timeout for vendor specific CDB to returning NOT_HANDLED status #705

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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