Am Mittwoch, 5. August 2015, 13:32:41 schrieb Austin S Hemmelgarn:
> On 2015-07-22 07:00, Russell Coker wrote:
> > On Tue, 23 Jun 2015 02:52:43 AM Chris Murphy wrote:
> >> OK I actually don't know what the intended block layer behavior is
> >> when unplugging a device, if it is supposed to vanish, or change state
> >> somehow so that thing that depend on it can know it's "missing" or
> >> what. So the question here is, is this working as intended? If the
> >> layer Btrfs depends on isn't working as intended, then Btrfs is
> >> probably going to do wild and crazy things. And I don't know that the
> >> part of the block layer Btrfs depends on for this is the same (or
> >> different) as what the md driver depends on.
> > 
> > I disagree with that statement.  BTRFS should be expected to not do wild
> > and crazy things regardless of what happens with block devices.
> 
> I would generally agree with this, although we really shouldn't be doing
> things like trying to handle hardware failures without user
> intervention.  If a block device disappears from under us, we should
> throw a warning and if it's the last device in the FS, kill anything
> that is trying to read or write to that FS.  At the very least, we
> should try to avoid hanging or panicking the system if all of the
> devices in an FS disappear out from under us.

The best solution I have ever seen for removable media is with AmigaOS. You 
remove a disk (or nowadays an usb stick) while it is being written to and 
AmigaDOS/AmigaOS pops up a dialog window saying "You MUST insert volume 
$VOLUMENAME again". And if you did, it just continued writing. I bet this may 
be difficult for do for Linux for all devices as unwritten changes pile up in 
memory until dirty limits are reached, unless one says "Okay, disk gone, we 
block all processes writing to it immediately or quite soon", but for 
removable media I never saw anything with that amount of sanity. There was 
some GSoC for NetBSD once to implement this, but I don´t know whether its 
implemented in there now. For AmigaOS and floppy disks with back then 
filesystem there was just one culprit: If you didn´t insert the disk again, it 
was often broken beyond repair. For journaling or COW filesystem it would just 
be like in any other sudden stop to writes.

On Linux with eSATA I saw I can also replug the disk if I didn´t yet hit the 
timeouts in block layer. After that the disk is gone.

Ciao,
-- 
Martin

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to