Re: [PATCH] usb-storage: Add quirks to make G-Technology "G-Drive" work

From: Alexander Kappner
Date: Thu May 17 2018 - 13:42:04 EST


Oliver and Alan,

thank for investigating.

> this is suspicious. You do not actually whether US_FL_NO_WP_DETECT
> by itself would make the device work. Can you please test that?

US_FL_NO_WP_DETECT without US_FL_IGNORE_UAS does not make a difference,
even with the patch you included applied:

[ 44.108417] JBD2: Clearing recovery information on journal
[ 44.119593] sd 2:0:0:0: [sda] tag#1 FAILED Result: hostbyte=DID_OK
driverbyte=DRIVER_SENSE
[ 44.121605] sd 2:0:0:0: [sda] tag#1 Sense Key : Illegal Request
[current]
[ 44.123254] sd 2:0:0:0: [sda] tag#1 Add. Sense: Invalid field in cdb
[ 44.124798] sd 2:0:0:0: [sda] tag#1 CDB: Write(16) 8a 08 00 00 00 00 e8
c4 00 00 00 00 00 08 00 00
[ 44.126847] print_req_error: critical target error, dev sda, sector
3905159168
[ 44.128450] Buffer I/O error on dev sda, logical block 488144896, lost
sync page write
[ 44.130776] JBD2: Error -5 detected when updating journal superblock for
sda-8.
[ 44.141059] sd 2:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK
driverbyte=DRIVER_SENSE
[ 44.141376] sd 2:0:0:0: [sda] tag#0 Sense Key : Illegal Request
[current]
[ 44.141376] sd 2:0:0:0: [sda] tag#0 Add. Sense: Invalid field in cdb
[ 44.141376] sd 2:0:0:0: [sda] tag#0 CDB: Write(16) 8a 08 00 00 00 00 00
00 00 00 00 00 00 08 00 00
[ 44.141376] print_req_error: critical target error, dev sda, sector 0
[ 44.141376] Buffer I/O error on dev sda, logical block 0, lost sync page
write

> That's bizarre too. Even though the only difference is a MODE SENSE
> command, the command that actually faliled was WRITE(16).
It looks to me like the MODE SENSE simply hangs the drive, so anything
issued after that will fail. Of course the drive says it's the "current
command" that caused the failure, but I wouldn't give too much credence to
that. FYI -- this device is a consumer grade rotational drive that you can
get for less than $200, so I wouldn't be surprised if the implementations
have issues.

Also, I noticed that copying onto the drive with dd works fine, whereas
trying to mount a filesystem immediately crashes it. I suspect this is
because check_disk_change is called on mount (which eventually calls down
to sd_read_write_protect_flag, which is where the US_FL_NO_WP_DETECT flag
comes into play).



On 05/17/2018 05:58 AM, Oliver Neukum wrote:
> Am Donnerstag, den 17.05.2018, 01:15 -0700 schrieb Alexander Kappner:
>> Yes. Without this flag, the device keeps throwing similar errors on
>> usb-storage. That's the same result I get on a host that doesn't have UAS
>> compiled in. Here's a dmesg:
>
> Hi,
>
> this is suspicious. You do not actually whether US_FL_NO_WP_DETECT
> by itself would make the device work. Can you please test that?
> You will need the attached patch for the quirk to be supported.
>
> Regards
> Oliver
>