linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BUG in kernel: Wrong Handling of USB HDD’s in scsiglue(slave_configure) and scsi/sd(sd_read_cache_type)
@ 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
  0 siblings, 2 replies; 19+ messages in thread
From: Amit Sahrawat @ 2011-09-28 15:42 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel

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.

Thanks & Regards,
Amit Sahrawat

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2011-10-03 19:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CADDb1s2bVY04G1fZ=3KwCagZHm_dOmLPxsUBKven7=iBo_nU-g@mail.gmail.com>
     [not found] ` <CADDb1s2bVY04G1fZ=3KwCagZHm_dOmLPxsUBKven7=iBo_nU-g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-03 14:25   ` Re: Re: BUG in kernel: Wrong Handling of USB HDD’s in scsiglue(slave_configure) and scsi/sd(sd_read_cache_type) Alan Stern
2011-10-03 16:06     ` Douglas Gilbert
2011-10-03 18:10       ` Alan Stern
     [not found]         ` <Pine.LNX.4.44L0.1110031408420.1882-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2011-10-03 19:32           ` James Bottomley
2011-10-03 19:53             ` Alan Stern
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
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

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).