scst_vdisk, COMPARE AND WRITE: Convert a kernel warning into a SCSI sense code

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5448 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2014-04-19 11:48:33 +00:00
parent c0d9aee18e
commit f5fd6f5375

View File

@@ -5117,7 +5117,10 @@ static enum compl_status_e vdisk_exec_caw(struct vdisk_cmd_params *p)
goto out;
}
WARN_ON_ONCE(length != 2 * data_len);
if (length != 2 * data_len) {
scst_set_invalid_field_in_cdb(cmd, 13, 0);
goto out;
}
loff = p->loff;
read = vdev_read_sync(virt_dev, read_buf, data_len, &loff);