public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Block <lkml@mageta.org>
To: 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 18:44:50 +0200	[thread overview]
Message-ID: <ZF0bgrAXJnWPJR/U@chlorum.ategam.org> (raw)
In-Reply-To: <7C02DE30-DBA7-45E5-A16C-02C75C670E9F@purestorage.com>

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.

> 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.

-- 
Best Regards und Beste Grüße, Benjamin Block
               PGP KeyID: 9610 2BB8 2E17 6F65 2362  6DF2 46E0 4E05 67A3 2E9E

  reply	other threads:[~2023-05-11 17:29 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 [this message]
2023-05-12  2:58       ` Douglas Gilbert
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=ZF0bgrAXJnWPJR/U@chlorum.ategam.org \
    --to=lkml@mageta.org \
    --cc=bblock@linux.ibm.com \
    --cc=brian@purestorage.com \
    --cc=krishna.kant@purestorage.com \
    --cc=linux-scsi@vger.kernel.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