scst: Fail unsupported commands properly

Report UNSUPPORTED OPCODE instead of ILLEGAL_REQUEST / LBA_OUT_OF_RANGE
for unsupported opcodes. For unsupported commands the SCST_LBA_NOT_VALID
flag is not set and cmd->lba == 0xffffffffffffffffU. That causes the test
in scst_generic_parse() for out-of-range LBA's to trigger. Avoid that by
explicitly setting the SCST_LBA_NOT_VALID flag for unsupported opcodes.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2013-10-22 05:24:38 +00:00
parent 5d8a563648
commit 11f3535132
+1
View File
@@ -6843,6 +6843,7 @@ int scst_get_cdb_info(struct scst_cmd *cmd)
/* opcode not found or now not used */
TRACE(TRACE_MINOR, "Unknown opcode 0x%x for type %d", op,
dev_type);
cmd->op_flags |= SCST_LBA_NOT_VALID;
res = -1;
goto out;
}