|
From: <vl...@us...> - 2013-01-09 01:42:16
|
Revision: 4727
http://scst.svn.sourceforge.net/scst/?rev=4727&view=rev
Author: vlnb
Date: 2013-01-09 01:42:10 +0000 (Wed, 09 Jan 2013)
Log Message:
-----------
scst, SCSI pass-through: Do not complain unnecessarily about max_hw_sectors
cmd->bufflen is in bytes so it has to be divided by the sector size before
being compared with queue_max_hw_sectors(). Other changes included in this
patch:
* Print the "rc" error code as a signed integer instead of as an unsigned
hex number.
* Change "(int)rc" into "rc". The cast isn't necessary because rc has type
int.
* Insert a "0x" prefix in front of the SCSI CDB opcode.
Signed-off-by: Bart Van Assche <bva...@ac...>
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2013-01-09 01:38:05 UTC (rev 4726)
+++ trunk/scst/src/scst_targ.c 2013-01-09 01:42:10 UTC (rev 4727)
@@ -2612,11 +2612,12 @@
rc = scst_scsi_exec_async(cmd, cmd, scst_pass_through_cmd_done);
#endif
if (unlikely(rc != 0)) {
- PRINT_ERROR("scst pass-through exec failed: %x", rc);
- if (((int)rc == -EINVAL) &&
- (cmd->bufflen > queue_max_hw_sectors(scsi_dev->request_queue)))
+ PRINT_ERROR("scst pass-through exec failed: %d", rc);
+ /* "Sectors" are hardcoded as 512 bytes in the kernel */
+ if (rc == -EINVAL &&
+ (cmd->bufflen >> 9) > queue_max_hw_sectors(scsi_dev->request_queue))
PRINT_ERROR("Too low max_hw_sectors %d sectors on %s "
- "to serve command %x with bufflen %db."
+ "to serve command %#x with bufflen %d bytes."
"See README for more details.",
queue_max_hw_sectors(scsi_dev->request_queue),
dev->virt_name, cmd->cdb[0], cmd->bufflen);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|