Cleanup and fix of data overrite with WRITE SAME

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4319 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-05-23 22:54:47 +00:00
parent 5221238b13
commit bbe4224615
2 changed files with 13 additions and 4 deletions

View File

@@ -1156,9 +1156,17 @@ static bool vdisk_parse_offset(struct vdisk_cmd_params *p, struct scst_cmd *cmd)
TRACE_ENTRY();
if (unlikely(!(cmd->op_flags & SCST_INFO_VALID))) {
PRINT_ERROR("Unknown opcode 0x%02x", cmd->cdb[0]);
scst_set_cmd_error(cmd,
SCST_LOAD_SENSE(scst_sense_invalid_opcode));
/*
* Let's ignore reporting T10/04-262r7 16-byte and 12-byte ATA
* pass-thru commands to not pollute logs (udev(?) checks them
* for some reason). If somebody has their description, please,
* update scst_scsi_op_table.
*/
if ((cmd->cdb[0] != 0x85) && (cmd->cdb[0] != 0xa1))
PRINT_ERROR("Unknown opcode 0x%02x", cmd->cdb[0]);
else
TRACE(TRACE_MINOR, "Unknown opcode 0x%02x", cmd->cdb[0]);
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_invalid_opcode));
res = false;
goto out;
}

View File

@@ -4495,7 +4495,8 @@ static int scst_ws_push_single_write(struct scst_write_same_priv *wsp,
if ((ws_cmd->cdb[1] & 0x6) == 0) {
TRACE_DBG("Using direct ws_sg %p (cnt %d)", ws_sg, ws_sg_cnt);
sg = ws_sg;
sg_cnt = ws_sg_cnt;
EXTRACHECKS_BUG_ON(blocks > ws_sg_cnt);
sg_cnt = blocks;
goto set_add;
}