From 11f35351321597ee9918d33b92b22a7fcbc0ad75 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 22 Oct 2013 05:24:38 +0000 Subject: [PATCH] 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 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5076 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 45c9d48ef..8f473809d 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -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; }