From: Hugo Mills <hugo@carfax.org.uk>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>,
Chris Mason <chris.mason@fusionio.com>,
linux-btrfs@vger.kernel.org, linux-usb@vger.kernel.org,
Hans de Goede <hdegoede@redhat.com>,
linux-scsi@vger.kernel.org
Subject: Re: BTRFS doesn't handle USB device disconnect
Date: Wed, 11 Dec 2013 16:18:17 +0000 [thread overview]
Message-ID: <20131211161817.GL9738@carfax.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1312111058340.1531-100000@iolanthe.rowland.org>
[-- Attachment #1: Type: text/plain, Size: 3462 bytes --]
On Wed, Dec 11, 2013 at 11:03:09AM -0500, Alan Stern wrote:
> On Tue, 10 Dec 2013, Sarah Sharp wrote:
>
> > In order to stress test the uas driver (next-gen USB storage driver), I
> > decided to run some tests with a USB 3.0 storage device with four 10GB
> > partitions: BTRFS, ext3, ext4, and fat32.
> >
> > It seems that BTRFS doesn't handle unexpected USB disconnect very well.
> > Is that expected behavior?
It's something that's been known about for a while, but is clearly
undesirable behaviour. I don't think anyone with the detailed
knowledge of the FS code has investigated in enough depth to get to
the point of proposing patches. I suspect it's just not shown up with
enough disastrous consequences to bubble to the top of the stack of
things to fix yet.
I think we're still at the point of "you can use USB if you like,
but don't be surprised if, sometimes, Bad Things happen when the bus
disconnects briefly".
The problems you show below do look quite like the kind of things
we've seen btrfs doing on USB disconnects, so on only this evidence I
wouldn't be quick to point any fingers at the USB layer (unless other
filesystems corroborate the behaviour).
Hugo.
(I'm not a btrfs developer, but I do a reasonable amount of
first-line support for it on IRC and linux-btrfs; we see these things
every week or two).
> > The BTRFS partition was created on an Ubuntu 13.10 system, with
> > btrfs-tools version 0.19+20130705-1.
> >
> > On 3.12-rc6, if all partitions are mounted, and I yank the USB cable,
> > the BTRFS filesystem still shows up as mounted. If I yank it multiple
> > times, sometimes it's listed twice when the device is disconnected:
> >
> > /dev/sdb3 on /media/sarah/9f21ef28-0eac-4736-9964-db5378b877e4 type btrfs (rw,nosuid,nodev,uhelper=udisks2)
> > /dev/sdc3 on /media/sarah/9f21ef28-0eac-4736-9964-db5378b877e41 type btrfs (rw,nosuid,nodev,uhelper=udisks2)
> >
> > Sometimes (but not always) when I plug it back in, I can get /dev/sdc3
> > listed twice:
> >
> > /dev/sdb3 on /media/sarah/9f21ef28-0eac-4736-9964-db5378b877e4 type btrfs (rw,nosuid,nodev,uhelper=udisks2)
> > /dev/sdc3 on /media/sarah/9f21ef28-0eac-4736-9964-db5378b877e42 type btrfs (rw,nosuid,nodev,uhelper=udisks2)
> > /dev/sdc1 on /media/sarah/ext3-part type ext3 (rw,nosuid,nodev,uhelper=udisks2)
> > /dev/sdc2 on /media/sarah/ext4-part type ext4 (rw,nosuid,nodev,uhelper=udisks2)
> > /dev/sdc4 on /media/sarah/fat32-part type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
> > /dev/sdc3 on /media/sarah/9f21ef28-0eac-4736-9964-db5378b877e41 type btrfs (rw,nosuid,nodev,uhelper=udisks2)
> > On 3.13-rc1, the btrfs partion from the disconnected USB device
> > continues to be listed as mounted. Yanking the cable produces some
> > additional oops messages. It also produced a couple hard-hangs.
> > Unfortunately, I didn't capture the dmesg during the hard-hangs, so I
> > can't tell for sure which driver is to blame (uas, btrfs, or xhci).
>
> Does this happen with usb-storage instead of uas?
>
> What about with ehci-hcd instead of xhci-hcd?
>
> And just to be exotic, what about with dummy-hcd and the uas or
> g_mass_storage gadget driver?
--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- UNIX: British manufacturer of modular shelving units. ---
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2013-12-11 16:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20131211011755.GA3574@xanatos>
2013-12-11 16:03 ` BTRFS doesn't handle USB device disconnect Alan Stern
2013-12-11 16:18 ` Hugo Mills [this message]
2013-12-11 23:20 ` Sarah Sharp
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=20131211161817.GL9738@carfax.org.uk \
--to=hugo@carfax.org.uk \
--cc=chris.mason@fusionio.com \
--cc=hdegoede@redhat.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sarah.a.sharp@linux.intel.com \
--cc=stern@rowland.harvard.edu \
/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).