Re: [Regression] [Bisected] Errors when ejecting USB storage drives since v5.10

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christoph,

Thank you for looking into this. I applied your patch to v5.11 but
unfortunately I am encountering the same errors when ejecting USB
drives.

e.g.
[   45.188575] sd 8:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK
driverbyte=DRIVER_SENSE cmd_age=0s
[   45.188584] sd 8:0:0:0: [sdc] tag#0 Sense Key : Not Ready [current]
[   45.188588] sd 8:0:0:0: [sdc] tag#0 Add. Sense: Medium not present
[   45.188592] sd 8:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 00 00
00 00 08 00
[   45.188594] blk_update_request: I/O error, dev sdc, sector 0 op
0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[   45.188601] Buffer I/O error on dev sdc, logical block 0, async page read

I am happy to test any patches you send my way.

Tom

On Tue, Feb 16, 2021 at 6:37 AM Christoph Hellwig <hch@xxxxxx> wrote:
>
> ... 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;
>         }



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux