From: Hannes Reinecke <hare@suse.de>
To: James Bottomley <jbottomley@parallels.com>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>,
Doug Gilbert <dgilbert@interlog.com>
Subject: Decoding short sense buffers
Date: Tue, 09 Oct 2012 12:42:33 +0200 [thread overview]
Message-ID: <5073FF99.3070808@suse.de> (raw)
Hi all,
I've noticed that virtually everybody assumes that the length of the
sense buffer is SCSI_SENSE_BUFFERSIZE.
And consequently every caller uses SCSI_SENSE_BUFFERSIZE when
calling any of the sense processing functions like
scsi_normalize_sense() etc.
However, those processing functions to go into great detail handling
_shorter_ buffersizes, which of course will never happen.
On the other hand, most LLDDs are capable of detecting the actually
transmitted sense buffer sizes; there even is a field in struct
request which would allow us to transmit the number of bytes in the
sense buffer.
But this field is happily neglected, too.
So, questions here:
- Do we actually care for a sense buffer underflow?
We won't be able to detect it currently anyway;
plus we haven't received any error reports for it.
And the allocated sense buffer is _always_ SCSI_SENSE_BUFFERSIZE ...
- What is the intention of rq->sense_len?
From what I gather it _should_ hold the size of the received sense
buffer data. But that doesn't happen currently.
For short sense buffers that doesn't matter, but for sense buffer
_overruns_ it would be quite good to know.
Which causes quite some confusion on how to probe for valid sense data:
- DRIVER_SENSE ?
- rq->sense_len?
- scsi_normalize_sense?
Thanks for clarification.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
reply other threads:[~2012-10-09 10:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=5073FF99.3070808@suse.de \
--to=hare@suse.de \
--cc=dgilbert@interlog.com \
--cc=jbottomley@parallels.com \
--cc=linux-scsi@vger.kernel.org \
/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.