All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Herbszt <herbszt@gmx.de>
To: dm-devel@redhat.com, Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: Sebastian Herbszt <herbszt@gmx.de>
Subject: Re: multipath-tools: mismatch between CDB allocation length and SG_IO dxfer_len
Date: Thu, 22 May 2014 00:46:30 +0200	[thread overview]
Message-ID: <20140522004630.00003f9a@localhost> (raw)
In-Reply-To: <20140521131429.00005192@localhost>

> 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

  reply	other threads:[~2014-05-21 22:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-05 11:13 multipath-tools: mismatch between CDB allocation length and SG_IO dxfer_len Sebastian Herbszt
2014-05-21 11:14 ` Sebastian Herbszt
2014-05-21 22:46   ` Sebastian Herbszt [this message]
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=20140522004630.00003f9a@localhost \
    --to=herbszt@gmx.de \
    --cc=christophe.varoqui@opensvc.com \
    --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.