From: Sebastian Herbszt <herbszt@gmx.de>
To: dm-devel@redhat.com
Cc: Sebastian Herbszt <herbszt@gmx.de>
Subject: multipath-tools: mismatch between CDB allocation length and SG_IO dxfer_len
Date: Sat, 5 Apr 2014 13:13:23 +0200 [thread overview]
Message-ID: <20140405131323.00000d4b@localhost> (raw)
Hello,
while playing with multipath-tools and scst I got the following warning:
[ 6382.467569] [3806]: scst: scst_parse_cmd:826:Warning: expected
transfer length 256 for opcode 0x12 (handler vdisk_blockio, target
scst_local) doesn't match decoded value 128
[ 6382.467574] [3806]: scst_parse_cmd:828:Suspicious CDB:
[ 6382.467579] (h)___0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F
[ 6382.467581] 0: 12 01 c0 00 80 00 ......
This happened when my scst target pretended to be a CLARiiON.
I noticed a mismatch in emc_clariion_prio (libmultipath/prioritizers/emc.c)
between the allocation length and dxfer_len:
int emc_clariion_prio(const char *dev, int fd)
{
unsigned char sense_buffer[256];
unsigned char sb[128];
unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC0, 0,
sizeof(sb), 0};
...
memset(&sense_buffer, 0, 256);
io_hdr.interface_id = 'S';
io_hdr.cmd_len = sizeof (inqCmdBlk);
io_hdr.mx_sb_len = sizeof (sb);
io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
io_hdr.dxfer_len = sizeof (sense_buffer);
io_hdr.dxferp = sense_buffer;
io_hdr.cmdp = inqCmdBlk;
io_hdr.sbp = sb;
io_hdr.timeout = 60000;
io_hdr.pack_id = 0;
The following change shrinks the size of sense_buffer to 128.
Sebastian
diff --git a/libmultipath/prioritizers/emc.c b/libmultipath/prioritizers/emc.c
index 87e9a8d..91b3d90 100644
--- a/libmultipath/prioritizers/emc.c
+++ b/libmultipath/prioritizers/emc.c
@@ -14,15 +14,15 @@
int emc_clariion_prio(const char *dev, int fd)
{
- unsigned char sense_buffer[256];
+ unsigned char sense_buffer[128];
unsigned char sb[128];
unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC0, 0,
- sizeof(sb), 0};
+ sizeof(sense_buffer), 0};
struct sg_io_hdr io_hdr;
int ret = PRIO_UNDEF;
memset(&io_hdr, 0, sizeof (struct sg_io_hdr));
- memset(&sense_buffer, 0, 256);
+ memset(&sense_buffer, 0, 128);
io_hdr.interface_id = 'S';
io_hdr.cmd_len = sizeof (inqCmdBlk);
io_hdr.mx_sb_len = sizeof (sb);
next reply other threads:[~2014-04-05 11:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-05 11:13 Sebastian Herbszt [this message]
2014-05-21 11:14 ` multipath-tools: mismatch between CDB allocation length and SG_IO dxfer_len Sebastian Herbszt
2014-05-21 22:46 ` Sebastian Herbszt
2014-05-21 20:31 ` Christophe Varoqui
2014-06-10 5:58 ` Christophe Varoqui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140405131323.00000d4b@localhost \
--to=herbszt@gmx.de \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.