Re: multipath-tools: mismatch between CDB allocation length and SG_IO dxfer_len

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi,
> 
> have you verified this part is not enough to fix the problem, without
> shrinking the response size to 128 ?
> 
>         unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC0, 0,
> -                                               sizeof(sb), 0};
> +                                               sizeof(sense_buffer), 0};

sizeof(sense_buffer) is 256 and it gets truncated to 0:

ioctl(4, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[6]=[12, 01, c0, 00, 00, 00], ...

[ 3730.100199] [5674]: scst: scst_parse_cmd:828:Warning: expected transfer length 256 for opcode INQUIRY (handler vdisk_blockio, target scst_local) doesn't match decoded value 0
[ 3730.100203] [5674]: scst_parse_cmd:830:Suspicious CDB:
[ 3730.100204]  (h)___0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F
[ 3730.100206]    0: 12 01 c0 00 00 00   ......

This works

@@ -16,8 +16,9 @@ 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};
+       unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC0,
+                                       (sizeof(sense_buffer) >> 8) & 0xff,
+                                       sizeof(sense_buffer) & 0xff,  0};
        struct sg_io_hdr io_hdr;
        int ret = PRIO_UNDEF;

but I am not sure a buffer of 256 is required, because the checker just uses
128 bytes for the same page.

> Is it me or the variable name is just plain misleading ?

Should be "resp" or something like that.

> Best regards,
> Christophe Varoqui
> www.opensvc.com

Please keep me CC'ed in replies.

Sebastian

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux