From: James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
To: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
Cc: Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>,
James Bottomley
<JBottomley-MU7nAjRaF3makBO8gow8eQ@public.gmane.org>,
Jun Itou <itou_jun-6LX5ZuzTTw53+QwDJ9on6Q@public.gmane.org>,
Markus Rathgeb
<maggu2810-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Matt <vickm78-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>,
SCSI development list
<linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
USB Storage list
<usb-storage-ijkIwGHArpdIPJnuZ7Njw4oP9KaGy4wf@public.gmane.org>,
USB list <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
Subject: Re: [PATCH] USB: storage: add "no SYNCHRONIZE CACHE" quirk
Date: Mon, 22 Jun 2015 14:22:57 -0700 [thread overview]
Message-ID: <1435008177.2237.137.camel@HansenPartnership.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1506221340180.1799-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
On Mon, 2015-06-22 at 13:48 -0400, Alan Stern wrote:
> On Mon, 22 Jun 2015, James Bottomley wrote:
>
> > On Mon, 2015-06-22 at 13:30 -0400, Alan Stern wrote:
> > > On Mon, 22 Jun 2015, James Bottomley wrote:
> > >
> > > > I'm not sure I entirely like this: we are back again treating data
> > > > corruption problems silently.
> > > >
> > > > However, I also believe treating a single flush failure as a critical
> > > > filesystem error is also wrong: The data's all there correctly; all it
> > > > does is introduce a potential window were the FS could get corrupted in
> > > > the unlikely event the system crashed.
> > > >
> > > > Obviously, for a disk with a writeback cache that can't do flush, that
> > > > window is much wider and the real solution should be to try to switch
> > > > the cache to write through.
> > >
> > > I agree. Doing the switch manually (by writing to the "cache_type"
> > > attribute file) works, but it's a nuisance to do this when you have a
> > > portable USB drive that gets moved among a bunch of machines.
> >
> > Perhaps it might be wise to do this to every USB device ... for external
> > devices, the small performance gain doesn't really make up for the
> > potential data loss.
> >
> > > > How about something like this patch? It transforms FS FLUSH into a log
> > > > warning from an error but preserves the error on any other path. You'll
> > > > still get a fairly continuous dump of warnings for one of these devices,
> > > > though ... do they respond to mode selects turning off the writeback?
> > >
> > > I would be very surprised if any of those drives support MODE SELECT at
> > > all.
> >
> > I assume the cache type attribute file you refer to above is just
> > pretending their cache is write through rather than actually setting it
> > to be so?
>
> Yes; I'm referring to cache_type_store() in sd.c, and writing
> "temporary write through", which does not issue a MODE SELECT command.
> It would be easy enough for people to try leaving out the "temporary",
> but I don't expect it to work.
>
> > The original IDE device had no way of turning their cache
> > types to write through either, but the manufacturers were eventually
> > convinced of the error of their ways.
>
> In this case the stupidity resides in the USB-ATA bridge. You can see
> the gory details at
>
> https://bugzilla.kernel.org/show_bug.cgi?id=89511#c19
OK, so that says the SAT in the bridge doesn't know what to do with
MODE_SELECT (probably unsurprising given that it's a usb bridge). the
SATA disk should respond to the ATA command SET FEATURES, though.
Presuming we can get it through the bridge.
You can try it with
hdparm -W 0 <dev>
optionally with --prefer_ata_12 to do the 12 instead of 16 byte
encapsulation and see if that makes a difference.
James
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
next prev parent reply other threads:[~2015-06-22 21:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 14:55 [PATCH] USB: storage: add "no SYNCHRONIZE CACHE" quirk Alan Stern
2015-06-22 15:43 ` James Bottomley
2015-06-22 17:30 ` Alan Stern
2015-06-22 17:36 ` James Bottomley
[not found] ` <1434994588.2237.90.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2015-06-22 17:48 ` Alan Stern
2015-06-22 18:44 ` Markus Rathgeb
[not found] ` <CAOcK=COj7=akJUhsg2Pfr5aeh_tC9dEL3rZK1yKuvTN0KyJB1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-22 20:16 ` Alan Stern
2015-06-22 21:32 ` Markus Rathgeb
[not found] ` <Pine.LNX.4.44L0.1506221340180.1799-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2015-06-22 21:22 ` James Bottomley [this message]
[not found] ` <1435008177.2237.137.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2015-07-24 15:19 ` Alan Stern
2015-12-03 18:36 ` Alan Stern
2015-12-15 11:34 ` Oliver Neukum
[not found] ` <1450179271.17387.19.camel-IBi9RG/b67k@public.gmane.org>
2015-12-15 15:16 ` Alan Stern
2015-06-23 14:15 ` David Laight
2015-06-26 9:43 ` Stefan Richter
2015-06-26 10:14 ` James Bottomley
2015-06-26 11:05 ` Stefan Richter
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=1435008177.2237.137.camel@HansenPartnership.com \
--to=james.bottomley-d9phhud1jfjcxq6kfmz53/egyhegw8jk@public.gmane.org \
--cc=JBottomley-MU7nAjRaF3makBO8gow8eQ@public.gmane.org \
--cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
--cc=greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org \
--cc=itou_jun-6LX5ZuzTTw53+QwDJ9on6Q@public.gmane.org \
--cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=maggu2810-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
--cc=usb-storage-ijkIwGHArpdIPJnuZ7Njw4oP9KaGy4wf@public.gmane.org \
--cc=vickm78-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.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