lkml.org 
[lkml]   [2011]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/1] scsi: retrieve cache mode using ATA_16 if normal routine fails
From
2011/12/12 James Bottomley <James.Bottomley@hansenpartnership.com>:
> On Mon, 2011-12-12 at 16:48 +0530, Amit Sahrawat wrote:
>> It has been observed that a number of USB HDD's do not respond correctly
>> to SCSI mode sense command(retrieve caching pages) which results in their
>> Write Cache being discarded by queue requests i.e., WCE if left set to
>> '0'(disabled).
>> This results in a number of Filesystem corruptions, when the device
>> is unplugged abruptly.
>
> Um, how would knowing the caching type correctly help?  If you surprise
> unplug the device, we can't send a flush to it anyway ...
Hi. James.
We can get device specification buffer to use ata_16 cmd.So we are
able to distinguish caching type by using 85byte of buffer.
And filesystem is using write barrier function to protect important
data like journaling data.
If filesystem is able to use write barrier by correctly setting WCE,
ordering can be guaranteed to flush data(preflush/postflush) to
internal write cache in hdd before power off. so filesystem can get
consistency and reliability by sudden plug and power off.
>
>> So, in order to identify the devices correctly - give it
>> a last try using ATA_16 after failure from normal routine.
>> Introduce a mechanism to store write-cache type using /sys/class/
>> interface, so that the normal code continues to function without errors.
>>
>> Signed-off-by: Amit Sahrawat <amit.sahrawat83@gmail.com>
>> Signed-off-by: Nam-Jae Jeon <namjae.jeon@samsung.com>
>
> This whole patch looks like a layering violation.  Why not just update
> the SAT layer to translate the MODE SENSE correctly?
Would plz you explain more ? I didn't clearly understand your point yet.
>
> James
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-12-13 01:23    [W:0.088 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site