scsi: fix internal write cache issue on usb hdd.
cover scsi: fix internal write cache issue on usb hdd.
From: Namjae Jeon <[email protected]>
The numbers of USB HDDs(All USB HDD I checked) does not respond correctly to scsi mode sense command for retrieving the write cache page status. Even though write cache is enabled by default, due to scsi driver assume that cache is not enabled which in turn might lead to loss of data since data still will be in cache.
This result that all filesystems is not stable on USB HDD when the device is unplugged abruptly, even though these are having journaling feature. Our first trying is that scsi driver send ATA command (ATA Pass through, #85) to USB HDD after failure from normal routine to know write cache enable.
We have known it is dangerous after testing several USB HDD. some of HDD is stalled by this command(A-DATA HDD). So we tried to make the patch James Bottomley's suggestion(usb quirk) on version 2 that add product ID and verdor ID of USB HDD to USB quirk list after checking write cache.
All filesystem will be stable on USB HDD registered in quirk list. And it will be updated continuously.
Namjae Jeon (3):
scsi: set to WCE if usb cache quirk is present.
usb: storage: add support for write cache quirk.
usb: storage: update usb devices for write cache quirk in quirk.
drivers/scsi/sd.c | 9 +++++++-- include/scsi/scsi_device.h | 1 + drivers/usb/storage/scsiglue.c | 5 +++++ drivers/usb/storage/usb.c | 5 ++++- include/linux/usb_usual.h | 4 +++- drivers/usb/storage/unusual_devs.h | 24 ++++++++++++++++++++++++ Documentation/kernel-parameters.txt | 2 ++ 7 files changed, 46 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.9.5
Quoted 11 lines · Namjae Jeon
From: Namjae Jeon <[email protected]>
The numbers of USB HDDs(All USB HDD I checked) does not respond correctly to scsi mode sense command for retrieving the write cache page status. Even though write cache is enabled by default, due to scsi driver assume that cache is not enabled which in turn might lead to loss of data since data still will be in cache.
This result that all filesystems is not stable on USB HDD when the device is unplugged abruptly, even though these are having journaling feature. Our first trying is that scsi driver send ATA command (ATA Pass through, #85) to USB HDD after failure from normal routine to
Quoted 8 lines
know write cache enable.
We have known it is dangerous after testing several USB HDD. some of HDD is stalled by this command(A-DATA HDD). So we tried to make the patch James Bottomley's suggestion(usb quirk) on version 2 that add product ID and verdor ID of USB HDD to USB quirk list after checking write cache.
All filesystem will be stable on USB HDD registered in quirk list. And it will be updated continuously.
Now applied to the usb-next branch.
thanks,
greg k-h
James Bottomley
maintainerQuoted 21 lines · Greg KH
Quoted 11 lines · Namjae Jeon
From: Namjae Jeon <[email protected]>
The numbers of USB HDDs(All USB HDD I checked) does not respond correctly to scsi mode sense command for retrieving the write cache page status. Even though write cache is enabled by default, due to scsi driver assume that cache is not enabled which in turn might lead to loss of data since data still will be in cache.
This result that all filesystems is not stable on USB HDD when the device is unplugged abruptly, even though these are having journaling feature. Our first trying is that scsi driver send ATA command (ATA Pass through, #85) to USB HDD after failure from normal routine toQuoted 8 lines
know write cache enable.
We have known it is dangerous after testing several USB HDD. some of HDD is stalled by this command(A-DATA HDD). So we tried to make the patch James Bottomley's suggestion(usb quirk) on version 2 that add product ID and verdor ID of USB HDD to USB quirk list after checking write cache.
All filesystem will be stable on USB HDD registered in quirk list. And it will be updated continuously.
Quoted 1 line
Now applied to the usb-next branch.
It's been in scsi#misc for ten days with no problems. Lets leave it there rather than create merge and rebase issues.
Thanks,
James
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 22 lines · James Bottomley
Quoted 21 lines · Greg KH
Quoted 19 lines · Namjae Jeon
From: Namjae Jeon <[email protected]>
The numbers of USB HDDs(All USB HDD I checked) does not respond correctly to scsi mode sense command for retrieving the write cache page status. Even though write cache is enabled by default, due to scsi driver assume that cache is not enabled which in turn might lead to loss of data since data still will be in cache.
This result that all filesystems is not stable on USB HDD when the device is unplugged abruptly, even though these are having journaling feature. Our first trying is that scsi driver send ATA command (ATA Pass through, #85) to USB HDD after failure from normal routine to know write cache enable.
We have known it is dangerous after testing several USB HDD. some of HDD is stalled by this command(A-DATA HDD). So we tried to make the patch James Bottomley's suggestion(usb quirk) on version 2 that add product ID and verdor ID of USB HDD to USB quirk list after checking write cache.
All filesystem will be stable on USB HDD registered in quirk list. And it will be updated continuously.
Quoted 4 lines
Quoted 1 line
Now applied to the usb-next branch.
It's been in scsi#misc for ten days with no problems. Lets leave it there rather than create merge and rebase issues.
No need for rebasing. It's already in my tree, so we can handle the merge when this hits Linus's tree.
thanks,
greg k-h