Skip to contentSkip to conversation

3.16 commit 89fb4cd errors on drives without SYNC CACHE

DISCUSSION Jeff DeFouw 3 participants 5 messages Nov 16, 2014 – Nov 21, 2014 SCSI

lore
Share & tools
lore
#0 lore raw

Kernel 3.16 includes commit
89fb4cd1f717a871ef79fa7debbe840e3225cd54
scsi: handle flush errors properly

I have an old USB backup drive that indicates a write cache but does not support Synchronize Cache(10). The request error now gets returned, resulting in a journal abort and inability to write to the ext3 filesystem. I was able to work around the problem by adding a new USB storage quirk that completes the request without contacting the drive. Is it acceptable for a drive to respond this way, and therefore need to be handled in the SCSI layer, or is a new USB storage quirk the right way to go?

Detection:

[  471.204020] usb 1-2: new high-speed USB device number 2 using ehci-pci
[  471.336900] usb 1-2: New USB device found, idVendor=0d49, idProduct=7100
[  471.336903] usb 1-2: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[  471.336906] usb 1-2: Product: OneTouch II
[  471.336908] usb 1-2: Manufacturer: Maxtor
[  471.336910] usb 1-2: SerialNumber: L60N3ANG    
[  471.450333] usb-storage 1-2:1.0: USB Mass Storage device detected
[  471.450421] scsi8 : usb-storage 1-2:1.0
[  471.450512] usbcore: registered new interface driver usb-storage
[  472.501374] scsi 8:0:0:0: Direct-Access     Maxtor   OneTouch II      023g PQ: 0 ANSI: 4
[  472.501712] sd 8:0:0:0: Attached scsi generic sg4 type 0
[  472.554993] sd 8:0:0:0: [sdd] 586114704 512-byte logical blocks: (300 GB/279 GiB)
[  472.608733] sd 8:0:0:0: [sdd] Write Protect is off
[  472.608735] sd 8:0:0:0: [sdd] Mode Sense: 24 00 00 00
[  472.662478] sd 8:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  472.847985]  sdd: sdd1 sdd2
[  473.063339] sd 8:0:0:0: [sdd] Attached SCSI disk

Write failure:

[ 2812.782271] sd 9:0:0:0: [sdd] Done: 
[ 2812.782276] 0xffff88007960c9c0 SUCCESS
[ 2812.782279] sd 9:0:0:0: [sdd]  
[ 2812.782282] Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[ 2812.782285] sd 9:0:0:0: [sdd] CDB: 
[ 2812.782286] Write(10): 2a 00 00 90 10 3f 00 00 30 00
[ 2812.782293] sd 9:0:0:0: [sdd] scsi host busy 1 failed 0
[ 2812.782897] sd 9:0:0:0: [sdd] Done: 
[ 2812.782900] 0xffff88007960c9c0 SUCCESS
[ 2812.782902] sd 9:0:0:0: [sdd]  
[ 2812.782904] Result: hostbyte=DID_TARGET_FAILURE driverbyte=DRIVER_OK
[ 2812.782905] sd 9:0:0:0: [sdd] CDB: 
[ 2812.782906] Synchronize Cache(10): 35 00 00 00 00 00 00 00 00 00
[ 2812.782911] sd 9:0:0:0: [sdd]  
[ 2812.782912] Sense Key : Illegal Request [current] 
[ 2812.782914] sd 9:0:0:0: [sdd]  
[ 2812.782916] Add. Sense: Invalid command operation code
[ 2812.782917] sd 9:0:0:0: [sdd] scsi host busy 1 failed 0
[ 2812.782922] end_request: critical target error, dev sdd, sector 9441391
[ 2812.782931] Aborting journal on device sdd1-8.
Signature · 1 line
Jeff DeFouw <[email protected]>
#1 lore raw
Quoted 4 lines · Jeff DeFouw

Kernel 3.16 includes commit
89fb4cd1f717a871ef79fa7debbe840e3225cd54
scsi: handle flush errors properly

Quoted 8 lines

I have an old USB backup drive that indicates a write cache but does not support Synchronize Cache(10). The request error now gets returned, resulting in a journal abort and inability to write to the ext3 filesystem. I was able to work around the problem by adding a new USB storage quirk that completes the request without contacting the drive. Is it acceptable for a drive to respond this way, and therefore need to be handled in the SCSI layer, or is a new USB storage quirk the right way to go?

Maybe the problem is that usb-storage sets the wce_default_on flag, and we thus send a SYNCHRONIZE_CACHE even if the devices never claimed to support it?

Adding the

Quoted 35 lines

Detection:

[  471.204020] usb 1-2: new high-speed USB device number 2 using ehci-pci
[  471.336900] usb 1-2: New USB device found, idVendor=0d49, idProduct=7100
[  471.336903] usb 1-2: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[  471.336906] usb 1-2: Product: OneTouch II
[  471.336908] usb 1-2: Manufacturer: Maxtor
[  471.336910] usb 1-2: SerialNumber: L60N3ANG    
[  471.450333] usb-storage 1-2:1.0: USB Mass Storage device detected
[  471.450421] scsi8 : usb-storage 1-2:1.0
[  471.450512] usbcore: registered new interface driver usb-storage
[  472.501374] scsi 8:0:0:0: Direct-Access     Maxtor   OneTouch II      023g PQ: 0 ANSI: 4
[  472.501712] sd 8:0:0:0: Attached scsi generic sg4 type 0
[  472.554993] sd 8:0:0:0: [sdd] 586114704 512-byte logical blocks: (300 GB/279 GiB)
[  472.608733] sd 8:0:0:0: [sdd] Write Protect is off
[  472.608735] sd 8:0:0:0: [sdd] Mode Sense: 24 00 00 00
[  472.662478] sd 8:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  472.847985]  sdd: sdd1 sdd2
[  473.063339] sd 8:0:0:0: [sdd] Attached SCSI disk

Write failure:

[ 2812.782271] sd 9:0:0:0: [sdd] Done: 
[ 2812.782276] 0xffff88007960c9c0 SUCCESS
[ 2812.782279] sd 9:0:0:0: [sdd]  
[ 2812.782282] Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[ 2812.782285] sd 9:0:0:0: [sdd] CDB: 
[ 2812.782286] Write(10): 2a 00 00 90 10 3f 00 00 30 00
[ 2812.782293] sd 9:0:0:0: [sdd] scsi host busy 1 failed 0
[ 2812.782897] sd 9:0:0:0: [sdd] Done: 
[ 2812.782900] 0xffff88007960c9c0 SUCCESS
[ 2812.782902] sd 9:0:0:0: [sdd]  
[ 2812.782904] Result: hostbyte=DID_TARGET_FAILURE driverbyte=DRIVER_OK
[ 2812.782905] sd 9:0:0:0: [sdd] CDB: 
Quoted 15 lines
[ 2812.782906] Synchronize Cache(10): 35 00 00 00 00 00 00 00 00 00
[ 2812.782911] sd 9:0:0:0: [sdd]  
[ 2812.782912] Sense Key : Illegal Request [current] 
[ 2812.782914] sd 9:0:0:0: [sdd]  
[ 2812.782916] Add. Sense: Invalid command operation code
[ 2812.782917] sd 9:0:0:0: [sdd] scsi host busy 1 failed 0
[ 2812.782922] end_request: critical target error, dev sdd, sector 9441391
[ 2812.782931] Aborting journal on device sdd1-8.
Signature · 5 lines
Jeff DeFouw <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

---end quoted text---

#2 lore raw
Quoted 14 lines · Christoph Hellwig
Quoted 4 lines · Jeff DeFouw

Kernel 3.16 includes commit
89fb4cd1f717a871ef79fa7debbe840e3225cd54
scsi: handle flush errors properly

Quoted 8 lines

I have an old USB backup drive that indicates a write cache but does not support Synchronize Cache(10). The request error now gets returned, resulting in a journal abort and inability to write to the ext3 filesystem. I was able to work around the problem by adding a new USB storage quirk that completes the request without contacting the drive. Is it acceptable for a drive to respond this way, and therefore need to be handled in the SCSI layer, or is a new USB storage quirk the right way to go?

Quoted 3 lines

Maybe the problem is that usb-storage sets the wce_default_on flag, and we thus send a SYNCHRONIZE_CACHE even if the devices never claimed to support it?

usb-storage sets wce_default_on only for devices that are marked with the US_FL_WRITE_CACHE quirk flag. Currently only two devices have that
flag: the Seagate Portable HDD (vendor ID 0x0bc2, product ID 0x2300) and the Western Digital My Password HDD (vendor ID 0x1058, product ID 0x070a).

Quoted 1 line

Adding the

Alan Stern

#3 lore raw
Quoted 5 lines

usb-storage sets wce_default_on only for devices that are marked with the US_FL_WRITE_CACHE quirk flag. Currently only two devices have that
flag: the Seagate Portable HDD (vendor ID 0x0bc2, product ID 0x2300) and the Western Digital My Password HDD (vendor ID 0x1058, product ID 0x070a).

So Jeff has a drive that on its own claims WCE=1 but doesn't support SYNCHRONIZE_CACHE(10). I'm not sure what to do about it as it sounds inherently dangerous.

#4 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines

usb-storage sets wce_default_on only for devices that are marked with the US_FL_WRITE_CACHE quirk flag. Currently only two devices have that
flag: the Seagate Portable HDD (vendor ID 0x0bc2, product ID 0x2300) and the Western Digital My Password HDD (vendor ID 0x1058, product ID 0x070a).

So Jeff has a drive that on its own claims WCE=1 but doesn't support SYNCHRONIZE_CACHE(10). I'm not sure what to do about it as it sounds inherently dangerous.

Maybe we should log a one-time warning when this happens and turn off sdkp->WCE. There's not much else we _can_ do about it.

Alan Stern