All of lore.kernel.org
 help / color / mirror / Atom feed
* 3.16 commit 89fb4cd errors on drives without SYNC CACHE
@ 2014-11-16  1:14 Jeff DeFouw
  2014-11-20  6:42 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff DeFouw @ 2014-11-16  1:14 UTC (permalink / raw)
  To: James E.J. Bottomley; +Cc: linux-scsi

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.

-- 
Jeff DeFouw <mrj@plorb.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 3.16 commit 89fb4cd errors on drives without SYNC CACHE
  2014-11-16  1:14 3.16 commit 89fb4cd errors on drives without SYNC CACHE Jeff DeFouw
@ 2014-11-20  6:42 ` Christoph Hellwig
  2014-11-20 15:11   ` [usb-storage] " Alan Stern
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2014-11-20  6:42 UTC (permalink / raw)
  To: Jeff DeFouw; +Cc: James E.J. Bottomley, linux-scsi, usb-storage

On Sat, Nov 15, 2014 at 08:14:57PM -0500, Jeff DeFouw wrote:
> 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?

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 

> 
> 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.
> 
> -- 
> Jeff DeFouw <mrj@plorb.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
---end quoted text---

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [usb-storage] Re: 3.16 commit 89fb4cd errors on drives without SYNC CACHE
  2014-11-20  6:42 ` Christoph Hellwig
@ 2014-11-20 15:11   ` Alan Stern
  2014-11-21 10:17     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Stern @ 2014-11-20 15:11 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jeff DeFouw, James E.J. Bottomley, linux-scsi, usb-storage

On Wed, 19 Nov 2014, Christoph Hellwig wrote:

> On Sat, Nov 15, 2014 at 08:14:57PM -0500, Jeff DeFouw wrote:
> > 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?
> 
> 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).

> Adding the 

Alan Stern


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [usb-storage] Re: 3.16 commit 89fb4cd errors on drives without SYNC CACHE
  2014-11-20 15:11   ` [usb-storage] " Alan Stern
@ 2014-11-21 10:17     ` Christoph Hellwig
  2014-11-21 15:08       ` Alan Stern
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2014-11-21 10:17 UTC (permalink / raw)
  To: Alan Stern; +Cc: Jeff DeFouw, James E.J. Bottomley, linux-scsi, usb-storage

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [usb-storage] Re: 3.16 commit 89fb4cd errors on drives without SYNC CACHE
  2014-11-21 10:17     ` Christoph Hellwig
@ 2014-11-21 15:08       ` Alan Stern
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Stern @ 2014-11-21 15:08 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jeff DeFouw, James E.J. Bottomley, linux-scsi, usb-storage

On Fri, 21 Nov 2014, Christoph Hellwig wrote:

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-21 15:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-16  1:14 3.16 commit 89fb4cd errors on drives without SYNC CACHE Jeff DeFouw
2014-11-20  6:42 ` Christoph Hellwig
2014-11-20 15:11   ` [usb-storage] " Alan Stern
2014-11-21 10:17     ` Christoph Hellwig
2014-11-21 15:08       ` Alan Stern

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.