LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Christian Löhle" <CLoehle@hyperstone.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Subject: Re: [PATCH] scsi: sd: Do not exit sd_spinup_disk quietly
Date: Mon, 16 Aug 2021 20:14:09 -0700	[thread overview]
Message-ID: <dc8e51c6-6859-df73-feb1-98d38a4dfc67@acm.org> (raw)
In-Reply-To: <CWXP265MB26803209FD08A64222EEEA02C4FD9@CWXP265MB2680.GBRP265.PROD.OUTLOOK.COM>

On 8/16/21 2:37 AM, Christian Löhle wrote:
> The sd_spinup_disk function logs what is happening nicely.
> Unfortunately this output stops if the media was marked removed
> in the meantime. To prevent a puzzling output, add a print
> for this case, too.
> 
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
> ---
>  drivers/scsi/sd.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index b8d55af763f9..7e556f5b57e0 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -2180,8 +2180,10 @@ sd_spinup_disk(struct scsi_disk *sdkp)
>  			 * doesn't have any media in it, don't bother
>  			 * with any more polling.
>  			 */
> -			if (media_not_present(sdkp, &sshdr))
> +			if (media_not_present(sdkp, &sshdr)) {
> +				sd_printk(KERN_NOTICE, sdkp, "Media removed, stopped polling\n");
>  				return;
> +			}
>  
>  			if (the_result)
>  				sense_valid = scsi_sense_valid(&sshdr);
> 

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

  reply	other threads:[~2021-08-17  3:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16  9:37 Christian Löhle
2021-08-17  3:14 ` Bart Van Assche [this message]
2021-08-18  2:37 ` Martin K. Petersen
2021-08-24  4:02 ` 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=dc8e51c6-6859-df73-feb1-98d38a4dfc67@acm.org \
    --to=bvanassche@acm.org \
    --cc=CLoehle@hyperstone.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --subject='Re: [PATCH] scsi: sd: Do not exit sd_spinup_disk quietly' \
    /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

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