<div dir="ltr">Hi,<div><br></div><div>have you verified this part is not enough to fix the problem, without shrinking the response size to 128 ?</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:19.428571701049805px">        unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC0, 0,</span><br style="font-family:arial,sans-serif;font-size:19.428571701049805px">
<span style="font-family:arial,sans-serif;font-size:19.428571701049805px">-                                               sizeof(sb), 0};</span><br style="font-family:arial,sans-serif;font-size:19.428571701049805px"><span style="font-family:arial,sans-serif;font-size:19.428571701049805px">+                                               sizeof(sense_buffer), 0};</span><br style="font-family:arial,sans-serif;font-size:19.428571701049805px">
</div><div><span style="font-family:arial,sans-serif;font-size:19.428571701049805px"><br></span></div><div><div>Is it me or the variable name is just plain misleading ?</div></div><div><br></div><div>Best regards,</div><div>
Christophe Varoqui</div><div><a href="http://www.opensvc.com">www.opensvc.com</a></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 5, 2014 at 1:13 PM, Sebastian Herbszt <span dir="ltr"><<a href="mailto:herbszt@gmx.de" target="_blank">herbszt@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
while playing with multipath-tools and scst I got the following warning:<br>
<br>
[ 6382.467569] [3806]: scst: scst_parse_cmd:826:Warning: expected<br>
transfer length 256 for opcode 0x12 (handler vdisk_blockio, target<br>
scst_local) doesn't match decoded value 128<br>
[ 6382.467574] [3806]: scst_parse_cmd:828:Suspicious CDB:<br>
[ 6382.467579]  (h)___0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F<br>
[ 6382.467581]    0: 12 01 c0 00 80 00   ......<br>
<br>
This happened when my scst target pretended to be a CLARiiON.<br>
I noticed a mismatch in emc_clariion_prio (libmultipath/prioritizers/emc.c)<br>
between the allocation length and dxfer_len:<br>
<br>
int emc_clariion_prio(const char *dev, int fd)<br>
{<br>
        unsigned char sense_buffer[256];<br>
        unsigned char sb[128];<br>
        unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC0, 0,<br>
                                                sizeof(sb), 0};<br>
<br>
...<br>
<br>
        memset(&sense_buffer, 0, 256);<br>
        io_hdr.interface_id = 'S';<br>
        io_hdr.cmd_len = sizeof (inqCmdBlk);<br>
        io_hdr.mx_sb_len = sizeof (sb);<br>
        io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;<br>
        io_hdr.dxfer_len = sizeof (sense_buffer);<br>
        io_hdr.dxferp = sense_buffer;<br>
        io_hdr.cmdp = inqCmdBlk;<br>
        io_hdr.sbp = sb;<br>
        io_hdr.timeout = 60000;<br>
        io_hdr.pack_id = 0;<br>
<br>
The following change shrinks the size of sense_buffer to 128.<br>
<br>
Sebastian<br>
<br>
diff --git a/libmultipath/prioritizers/emc.c b/libmultipath/prioritizers/emc.c<br>
index 87e9a8d..91b3d90 100644<br>
--- a/libmultipath/prioritizers/emc.c<br>
+++ b/libmultipath/prioritizers/emc.c<br>
@@ -14,15 +14,15 @@<br>
<br>
 int emc_clariion_prio(const char *dev, int fd)<br>
 {<br>
-       unsigned char sense_buffer[256];<br>
+       unsigned char sense_buffer[128];<br>
        unsigned char sb[128];<br>
        unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC0, 0,<br>
-                                               sizeof(sb), 0};<br>
+                                               sizeof(sense_buffer), 0};<br>
        struct sg_io_hdr io_hdr;<br>
        int ret = PRIO_UNDEF;<br>
<br>
        memset(&io_hdr, 0, sizeof (struct sg_io_hdr));<br>
-       memset(&sense_buffer, 0, 256);<br>
+       memset(&sense_buffer, 0, 128);<br>
        io_hdr.interface_id = 'S';<br>
        io_hdr.cmd_len = sizeof (inqCmdBlk);<br>
        io_hdr.mx_sb_len = sizeof (sb);<br>
<br>
--<br>
dm-devel mailing list<br>
<a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/dm-devel" target="_blank">https://www.redhat.com/mailman/listinfo/dm-devel</a><br>
</blockquote></div><br></div>