public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dgilbert@interlog.com>
To: Benjamin Block <lkml@mageta.org>, Brian Bunker <brian@purestorage.com>
Cc: Benjamin Block <bblock@linux.ibm.com>,
	linux-scsi@vger.kernel.org,
	Seamus Connor <sconnor@purestorage.com>,
	Krishna Kant <krishna.kant@purestorage.com>
Subject: Re: [PATCH] scsi: sd: Avoid sending an INQUIRY if the page is not supported
Date: Thu, 11 May 2023 22:58:16 -0400	[thread overview]
Message-ID: <368d06ff-889c-ed05-8ecc-e25e99817465@interlog.com> (raw)
In-Reply-To: <ZF0bgrAXJnWPJR/U@chlorum.ategam.org>

On 2023-05-11 12:44, Benjamin Block wrote:
> On Mon, May 08, 2023 at 09:34:15AM -0700, Brian Bunker wrote:
>>> On May 8, 2023, at 3:09 AM, Benjamin Block <bblock@linux.ibm.com> wrote:
>>> On Fri, May 05, 2023 at 01:49:50PM -0700, Brian Bunker wrote:
>>>
>>>> + int ret = -EINVAL;
>>>
>>> Been wondering, whether it would make sense to have two different error
>>> levels here. One for the case where the page is not found in the loop
>>> that searches within page 0, and one for when page 0 is not present when
>>> we try to dereference the RCU protected pointer.
>>>
>>> That way we could have a safe fallback. If the page is there, we use its
>>> data, if it is not, we blindly send the INQUIRY like we do today.
>>>
>>> Not sure whether this is a bit too paranoid.. VPD page 0 is mandatory
>>> after all.
>>
>> That could be done, but the problem would still exist for the PURE target.
>> We don’t support the page 0xb9, and we don’t advertise we do in the response
>> to VPD 0. This approach would still lead to the INQUIRY being sent to devices
> 
> I wasn't meaning to send the INQUIRY regardless to what the page says,
> if it is present. I was just thinking to having fall-back for when the
> page 0 is not there at all (initially, when you call
> `rcu_dereference()`). That would support your storage, as you have page
> 0, and it would be present for the check I assume.
> 
> But anyway, it seems this is a no-go regardless. I didn't expect targets
> sending a valid page 0, but still supporting pages that are not listed in it.

SCSI standards did contain words that implied vendors would report all
VPD/log/mode pages and operation codes using the mechanisms added to
those standards over the years. I guess users pressured vendors to do
this. Then recently, in T10 approved proposal 21-063r2, the weasel
words "may or may not" were added to all those mechanisms. IMO that
was a pretty disgraceful move by the storage vendors that control T10.

Doug Gilbert


P.S. I have a new option appearing in some of my utilities: --examine
The idea is that it uses an iota function to check for unreported
VPD/log/mode pages as the "report supported" device server responses
"may or may not" be trustworthy :-)

>> who don’t support it, don’t expect it, and report an unexpected error. What I am
>> trying to avoid is the INQUIRY being sent to devices who don’t invite it.
> 


  reply	other threads:[~2023-05-12  2:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 20:49 [PATCH] scsi: sd: Avoid sending an INQUIRY if the page is not supported Brian Bunker
2023-05-08 10:09 ` Benjamin Block
2023-05-08 16:34   ` Brian Bunker
2023-05-11 16:44     ` Benjamin Block
2023-05-12  2:58       ` Douglas Gilbert [this message]
2023-05-08 12:26 ` Martin K. Petersen
2023-05-08 16:04   ` Brian Bunker
2023-05-10 14:29     ` Martin K. Petersen

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=368d06ff-889c-ed05-8ecc-e25e99817465@interlog.com \
    --to=dgilbert@interlog.com \
    --cc=bblock@linux.ibm.com \
    --cc=brian@purestorage.com \
    --cc=krishna.kant@purestorage.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lkml@mageta.org \
    --cc=sconnor@purestorage.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox