linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@gmail.com>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Amit Sahrawat <amit.sahrawat83@gmail.com>,
	Nam-Jae Jeon <namjae.jeon@samsung.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] scsi: retrieve cache mode using ATA_16 if normal routine fails
Date: Tue, 13 Dec 2011 09:20:59 +0900	[thread overview]
Message-ID: <CAKYAXd-3LYJUWbAqaT4XfbNXJ_F0L1Lxu1evUxLyu=poHLMFug@mail.gmail.com> (raw)
In-Reply-To: <1323694267.20451.5.camel@dabdike>

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-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-12-13  0:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12 11:18 [PATCH 1/1] scsi: retrieve cache mode using ATA_16 if normal routine fails Amit Sahrawat
2011-12-12 12:51 ` James Bottomley
2011-12-13  0:20   ` Namjae Jeon [this message]
     [not found]     ` <CADDb1s2SOK5sC3N0OOdkBrPuDKc2d2A4z4yso4jYs=1rbxNmkA@mail.gmail.com>
2011-12-13  4:56       ` Amit Sahrawat
2011-12-13  8:53     ` James Bottomley
2011-12-13 12:15       ` Amit Sahrawat
2011-12-13 20:38       ` Jeff Garzik
2011-12-14  3:44         ` Amit Sahrawat
2011-12-14  7:39           ` James Bottomley
2011-12-15  0:25             ` Namjae Jeon
2012-01-27  5:20               ` Amit Sahrawat
  -- strict thread matches above, loose matches on Subject: below --
2012-02-03 12:59 Amit Sahrawat
2012-02-05 12:05 ` Sergei Shtylyov
2012-02-06  5:40   ` Amit Sahrawat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKYAXd-3LYJUWbAqaT4XfbNXJ_F0L1Lxu1evUxLyu=poHLMFug@mail.gmail.com' \
    --to=linkinjeon@gmail.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=amit.sahrawat83@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=namjae.jeon@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).