From 52aa20c1de2fac5a32f5838e1905940cdeb96c96 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 30 Sep 2008 18:18:18 +0000 Subject: [PATCH] Merge of r506: VERIFY commands that comes with BYTCHK unset (i.e. no data to write) shouldn't fail Signed-off-by: Gal Rosen git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/1.0.0.x@507 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index d956324f2..f556596e3 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -528,7 +528,11 @@ static int scst_parse_cmd(struct scst_cmd *cmd) if (((cmd->expected_data_direction != SCST_DATA_NONE) || (cmd->bufflen != 0)) && /* Crazy VMware people sometimes do TUR with READ direction */ - !(cmd->cdb[0] == TEST_UNIT_READY)) { + (!(cmd->cdb[0] == TEST_UNIT_READY) && + /* VERIFY commands with BYTCHK unset shouldn't fail here */ + !(((cmd->cdb[0] == VERIFY) || (cmd->cdb[0] == VERIFY_6) || + (cmd->cdb[0] == VERIFY_12) || (cmd->cdb[0] == VERIFY_16)) && + ((cmd->cdb[1] & BYTCHK) == 0)))) { PRINT_ERROR("Expected data direction %d for opcode " "0x%02x (handler %s, target %s) doesn't match " "decoded value %d", cmd->expected_data_direction,