From: Hannes Reinecke <hare@suse.de>
To: "Ewan D. Milne" <emilne@redhat.com>, linux-scsi@vger.kernel.org
Cc: michael.christie@oracle.com, dgilbert@interlog.com,
bvanassche@acm.org, dlemoal@kernel.org
Subject: Re: [PATCH v4 7/9] scsi: Simplify nested if conditional in scsi_probe_lun()
Date: Mon, 6 Oct 2025 09:11:44 +0200 [thread overview]
Message-ID: <93f4b34a-5ce9-47e7-9ba5-0f2e3ee958c3@suse.de> (raw)
In-Reply-To: <20251002192510.1922731-8-emilne@redhat.com>
On 10/2/25 21:25, Ewan D. Milne wrote:
> Make code congruent with similar code in read_capacity_16()/read_capacity_10().
>
> Signed-off-by: Ewan D. Milne <emilne@redhat.com>
> ---
> drivers/scsi/scsi_scan.c | 18 ++++++++----------
> 1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index c754b1d566e0..348ecfe5cdb0 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -717,16 +717,14 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
> "scsi scan: INQUIRY %s with code 0x%x\n",
> result ? "failed" : "successful", result));
>
> - if (result == 0) {
> - /*
> - * if nothing was transferred, we try
> - * again. It's a workaround for some USB
> - * devices.
> - */
> - if (resid == try_inquiry_len)
> - continue;
> - }
> - break;
> + if (result || resid != try_inquiry_len)
> + break;
> +
> + /*
> + * If the status was good but nothing was transferred,
> + * we retry. It is a workaround for some buggy devices
> + * or SAT which sometimes do not return any data.
> + */
> }
>
> if (result == 0) {
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2025-10-06 7:11 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-02 19:25 [PATCH v4 0/9] Retry READ CAPACITY(10)/(16) with good status but no data Ewan D. Milne
2025-10-02 19:25 ` [PATCH v4 1/9] scsi: Explicitly specify .ascq = 0x00 for ASC 0x28/0x29 scsi_failures Ewan D. Milne
2025-10-03 4:24 ` Damien Le Moal
2025-10-06 6:59 ` Hannes Reinecke
2025-10-02 19:25 ` [PATCH v4 2/9] scsi: sd: Do not retry ASC 0x3a in read_capacity_10() with any ASCQ Ewan D. Milne
2025-10-03 4:24 ` Damien Le Moal
2025-10-03 14:40 ` Ewan Milne
2025-10-03 15:44 ` Bart Van Assche
2025-10-03 18:40 ` Ewan Milne
2025-10-06 17:54 ` Bart Van Assche
2025-10-02 19:25 ` [PATCH v4 3/9] scsi: sd: Have scsi-ml retry read_capacity_16 errors Ewan D. Milne
2025-10-06 2:00 ` Damien Le Moal
2025-10-06 7:01 ` Hannes Reinecke
2025-10-02 19:25 ` [PATCH v4 4/9] scsi: sd: Avoid passing potentially uninitialized "sense_valid" to read_capacity_error() Ewan D. Milne
2025-10-06 2:02 ` Damien Le Moal
2025-10-06 7:06 ` Hannes Reinecke
2025-10-02 19:25 ` [PATCH v4 5/9] scsi: sd: Remove checks for -EOVERFLOW in sd_read_capacity() Ewan D. Milne
2025-10-06 2:04 ` Damien Le Moal
2025-10-06 7:07 ` Hannes Reinecke
2025-10-02 19:25 ` [PATCH v4 6/9] scsi: sd: Check for and retry in case of READ_CAPCITY(10)/(16) returning no data Ewan D. Milne
2025-10-06 2:06 ` Damien Le Moal
2025-10-06 7:10 ` Hannes Reinecke
2025-10-06 7:20 ` Damien Le Moal
2025-10-06 7:25 ` Damien Le Moal
2025-10-06 10:59 ` Hannes Reinecke
2025-10-02 19:25 ` [PATCH v4 7/9] scsi: Simplify nested if conditional in scsi_probe_lun() Ewan D. Milne
2025-10-06 2:07 ` Damien Le Moal
2025-10-06 7:11 ` Hannes Reinecke [this message]
2025-10-02 19:25 ` [PATCH v4 8/9] scsi: scsi_debug: Add option to suppress returned data but return good status Ewan D. Milne
2025-10-06 2:09 ` Damien Le Moal
2025-10-06 7:12 ` Hannes Reinecke
2025-10-02 19:25 ` [PATCH v4 9/9] scsi: scsi_debug: Add "only_once" module option to inject an error one time Ewan D. Milne
2025-10-06 2:12 ` Damien Le Moal
2025-10-06 7:12 ` Hannes Reinecke
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=93f4b34a-5ce9-47e7-9ba5-0f2e3ee958c3@suse.de \
--to=hare@suse.de \
--cc=bvanassche@acm.org \
--cc=dgilbert@interlog.com \
--cc=dlemoal@kernel.org \
--cc=emilne@redhat.com \
--cc=linux-scsi@vger.kernel.org \
--cc=michael.christie@oracle.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;
as well as URLs for NNTP newsgroup(s).