From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Amit Sahrawat <amit.sahrawat83@gmail.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>
Subject: Re: BUG in kernel: Wrong Handling of USB HDD’s in scsiglue(slave_configure) and scsi/sd(sd_read_cache_type)
Date: Wed, 28 Sep 2011 16:29:43 -0500 [thread overview]
Message-ID: <1317245383.22022.23.camel@dabdike.hansenpartnership.com> (raw)
In-Reply-To: <CADDb1s3KjMugBGwLmjoPv93hJVBCjkD81o8F0CZxJXXt+-Fk2A@mail.gmail.com>
On Wed, 2011-09-28 at 21:27 +0530, Amit Sahrawat wrote:
> Marking mail to linux-scsi.
>
> Thanks Christoph.
>
> Regards,
> Amit Sahrawat
>
> On Wed, Sep 28, 2011 at 9:12 PM, Amit Sahrawat
> <amit.sahrawat83@gmail.com> wrote:
> > When a USB HDD is connected to the device, it invokes slave_configure
> > to configure the USB HDD. In this function, whenever there is a SCSI
> > device of type TYPE_DISK, it sets:
> > /* A number of devices have problems with MODE SENSE for
> > * page x08, so we will skip it. */
> > sdev->skip_ms_page_8 = 1;
> >
> > Now, as a part of SCSI device probing, in the function
> > sd_revalidate_disk()-->sd_read_cache_type(), there is a condition
> > if (sdp->skip_ms_page_8)
> > goto defaults;
> > which becomes always true for all the USB HDD’s – the net result is
> > that the Write Cache is never considered for USB HDD(WCE = 0) –
> > “Assuming drive cache: write through”
> >
> > What’s more – the QUEUE ordering which is marked for WCE=0 is
> > QUEUE_ORDERED_DRAIN, instead of QUEUE_ORDERED_DRAIN_FLUSH
> > This means there is no flushing of USB HDD internal cache (although
> > SYNCHRONIZE_CACHE is implemented as passed as command in
> > sd_prepare_flush) – queue_flush()(called in function
> > blk_do_ordered()-->start_ordered()) does not gets called in case of
> > QUEUE_ORDERED_DRAIN.
> >
> > This causes a serious impact on USB HDD’s.
> >
> > Please let me know in case I have missed something in my observations.
This should be working in 3.0 ... what version of the kernel are you
testing. The actual patch that relaxes the caching mode page check is
this one:
commit 0bcaa11154f07502e68375617e5650173eea8e50
Author: Luben Tuikov <ltuikov@yahoo.com>
Date: Thu May 19 00:00:58 2011 -0700
[SCSI] Retrieve the Caching mode page (version 2)
James
next prev parent reply other threads:[~2011-09-28 21:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-28 15:42 Amit Sahrawat
2011-09-28 15:54 ` BUG in kernel: Wrong Handling of USB HDD?s " Christoph Hellwig
2011-09-28 15:57 ` BUG in kernel: Wrong Handling of USB HDD’s " Amit Sahrawat
2011-09-28 21:29 ` James Bottomley [this message]
2011-09-29 9:19 ` Amit Sahrawat
2011-09-29 18:27 ` James Bottomley
2011-09-29 18:31 ` James Bottomley
2011-09-30 6:56 ` Amit Sahrawat
2011-09-30 7:06 ` NamJae Jeon
2011-09-30 12:18 ` James Bottomley
2011-09-30 17:53 ` Amit Sahrawat
2011-09-30 17:56 ` Amit Sahrawat
2011-09-30 18:11 ` James Bottomley
2011-09-30 18:30 ` Amit Sahrawat
2011-09-30 18:17 ` Alan Stern
2011-09-30 18:36 ` Amit Sahrawat
2011-10-03 14:25 Alan Stern
2011-10-03 16:06 ` Douglas Gilbert
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=1317245383.22022.23.camel@dabdike.hansenpartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=amit.sahrawat83@gmail.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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
all inboxes | Powered by JetHome®