diff mbox series

scsi: sd: Do not exit sd_spinup_disk quietly

Message ID CWXP265MB26803209FD08A64222EEEA02C4FD9@CWXP265MB2680.GBRP265.PROD.OUTLOOK.COM
State New
Headers show
Series scsi: sd: Do not exit sd_spinup_disk quietly | expand

Commit Message

Christian Loehle Aug. 16, 2021, 9:37 a.m. UTC
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(-)

Comments

Bart Van Assche Aug. 17, 2021, 3:14 a.m. UTC | #1
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>
Martin K. Petersen Aug. 18, 2021, 2:37 a.m. UTC | #2
Christian,

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


Applied to 5.15/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering
Martin K. Petersen Aug. 24, 2021, 4:02 a.m. UTC | #3
On Mon, 16 Aug 2021 09:37:51 +0000, 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.

> 

> 

> 

> [...]


Applied to 5.15/scsi-queue, thanks!

[1/1] scsi: sd: Do not exit sd_spinup_disk quietly
      https://git.kernel.org/mkp/scsi/c/848ade90ba9c

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

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