All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Tom Seewald <tseewald@gmail.com>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	axboe@kernel.dk
Subject: Re: [Regression] [Bisected] Errors when ejecting USB storage drives since v5.10
Date: Tue, 16 Feb 2021 13:37:55 +0100	[thread overview]
Message-ID: <20210216123755.GA4608@lst.de> (raw)
In-Reply-To: <CAARYdbiUBxFTY25VusuxgxqVzNRnoB61fFQeXcmsKyDP_d_ipQ@mail.gmail.com>

... but you were using sd, not sr.

Can you give this patch a spin?

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index a3d2d4bc4a3dcd..6671b4e1909777 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2116,6 +2116,14 @@ static int sd_done(struct scsi_cmnd *SCpnt)
 			}
 		}
 		break;
+	case NOT_READY:
+		/* Medium not present */
+		if (SCpnt->device->removable && sshdr.asc == 0x3a00) {
+			req->rq_flags |= RQF_QUIET;
+			set_media_not_present(sdkp);
+			sdkp->capacity = 0;
+		}
+		break;
 	default:
 		break;
 	}

  parent reply	other threads:[~2021-02-16 12:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-12  5:42 [Regression] [Bisected] Errors when ejecting USB storage drives since v5.10 Tom Seewald
2021-02-16 12:15 ` Christoph Hellwig
2021-02-16 12:37 ` Christoph Hellwig [this message]
2021-02-16 20:01   ` Tom Seewald
2021-02-17  2:11   ` Tom Seewald
2021-02-22 11:44     ` Christoph Hellwig
2021-02-22 18:27       ` Tom Seewald

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=20210216123755.GA4608@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=tseewald@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.