lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 13 Dec 2011 10:26:21 +0530
From:	Amit Sahrawat <amit.sahrawat83@...il.com>
To:	Namjae Jeon <linkinjeon@...il.com>
Cc:	James Bottomley <James.Bottomley@...senpartnership.com>,
	Nam-Jae Jeon <namjae.jeon@...sung.com>,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] scsi: retrieve cache mode using ATA_16 if normal
 routine fails

On Tue, Dec 13, 2011 at 10:24 AM, Amit Sahrawat
<amit.sahrawat83@...il.com> wrote:
>
> Hi James,
>
>
>
> We verified the changes by actually putting the setup through a series of test cases. There were test cases where-in we were able to reduce the filesystem corruption by 100%.
>
> Yes, In normal operation SYNC_CACHE gets called up when we do a safe removal of the device. But, Setting WCE also takes cares of sending the SYNC_CACHE command in between the operations also.
>
>
>
> What we are making sure is, that by providing this interface we can have WCE enabled for some HDD –that will mark QUEUE ORDERING to QUEUE_ORDERED_DRAIN_FLUSH(Preflush-Postflush)(i.e., flushing will occur for all the Mass Storage devices - which in turn will keep on calling SYNC_CACHE for these devices.
>
>
>
> We checked this on USB HDD’s, USB SSD, and USB Flash from a number of vendors – all seemed to work pretty well with these changes.
>
>
>
> Please share your opinion.
>
>
>
> Thanks & Regards,
>
> Amit Sahrawat
>
>
>
>
> On Tue, Dec 13, 2011 at 5:50 AM, Namjae Jeon <linkinjeon@...il.com> wrote:
>>
>> 2011/12/12 James Bottomley <James.Bottomley@...senpartnership.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@...il.com>
>> >> Signed-off-by: Nam-Jae Jeon <namjae.jeon@...sung.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@...r.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ