Bug 37492 - btrfs fails after adding and removing devices
Summary: btrfs fails after adding and removing devices
Status: RESOLVED OBSOLETE
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: All Linux
: P1 high
Assignee: fs_btrfs@kernel-bugs.osdl.org
URL: http://bugs.gentoo.org/show_bug.cgi?i...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-14 18:48 UTC by Raymond Jennings
Modified: 2013-04-30 16:41 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.38
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Raymond Jennings 2011-06-14 18:48:48 UTC
While manipulating devices on a live btrfs system (btrfs device add/remove), I
got a couple errors then a BUG, followed by a complete failure to mount at
reboot

Reproducible: Always

Steps to Reproduce:
1.  Shrink your filesystem enough to squeeze another partition on your drive
2.  Fdisk your drive and split it in two
3.  Reboot
4.  Add the new partition to the filesystem
5.  Remove the old partition from the filesystem (and get coffee)
6.  Reboot
7.  pacify the initrd by telling it to mount the second partition instead of
the first
8.  Add the first partition back into the filesystem again
9.  Remove the second partition from the filesystem.
Actual Results:  
Problems:

1.  As soon as the other device was added, "btrfs filesystem resize" became
impossible.

2.  Deleting the second partition from the filesystem after booting into
mounting it failed.  most of the data was moved except for 1G.

3.  My kernel oopsed with a BUG() in disk-io.c, after which the filesystme was
paralyzed and refused to read OR write any further information.

4.  The entire filesystem became unmountable when I tried to mount it from the
livedvd.  mounting the first partition caused a bad fs type or whatever error,
and mounting the second partition triggered an "unable to read superblock"

Expected Results:  
1.  Resizing the filesystem when it had multiple devices should have been
possible.

2.  It should have been possible to delete the second partition from the
filesystem after booting into it.  After all, deleting the first partition
worked after migrating up.

Regrettably I do not have any diagnostic information
handy as the filesystem locked up at runtime, and refused to mount afterwards.

Version information I was able to remember:
Kernel version 2.6.38.
Latest version of btrfsprogs as of June 10, 2011

My only suggestion for diagnosis is stress testing the adding and removing of
devices from a live filesystem, interspersed with reboots.

CC:  http://bugs.gentoo.org/show_bug.cgi?id=371207
Comment 1 Josef Bacik 2013-04-30 16:41:19 UTC
Closing, if this is still affecting you on a newer kernel please reopen.

Note You need to log in before you can comment on or make changes to this bug.