Bug 623092 - btrfs across devices won't be mounted without btrfs module loaded
Summary: btrfs across devices won't be mounted without btrfs module loaded
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel   
(Show other bugs)
Version: 6.0
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Josef Bacik
QA Contact: Eryu Guan
Keywords: RHELNAK
Depends On:
TreeView+ depends on / blocked
Reported: 2010-08-11 10:00 UTC by Eryu Guan
Modified: 2010-08-17 03:04 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-08-16 12:51:13 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Eryu Guan 2010-08-11 10:00:58 UTC
Description of problem:
Create a btrfs partition across multiple devices, unload btrfs module, then the mount will fail (btrfs module will be loaded automatically). But mounting btrfs on single device will be done without problems(of cause, without btrfs module loaded)

After this failure mount, all mount will fail even with btrfs module loaded. I have to do btrfsck to make the partition mounted.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
# Make sure btrfs is unloaded
modprobe -r btrfs

mkdir -p /mnt/btrfs
dd if=/dev/null of=/home/img0 bs=1G seek=5
dd if=/dev/null of=/home/img1 bs=1G seek=3
for i in 0 1;do losetup /dev/loop$i /home/img$i;done
mkfs.btrfs /dev/loop0 /dev/loop1

mount /dev/loop0 /mnt/btrfs
Actual results:
[root@dell-per810-01 ~]# mount /dev/loop0 /mnt/btrfs
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

[root@dell-per810-01 ~]# dmesg | tail
Btrfs loaded
device fsid f14ed90116772672-7a80a1b42439d7b3 devid 1 transid 7 /dev/loop0
btrfs: failed to read the system array on loop0
btrfs: open_ctree failed

Expected results:
Mount successfully

Additional info:

Comment 2 RHEL Product and Program Management 2010-08-11 10:18:28 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 3 Eric Sandeen 2010-08-11 21:08:51 UTC
Looks like one for Josef

Comment 4 Eric Sandeen 2010-08-12 03:09:36 UTC
Talked to Chris tonight; it sounds like this is expected, and the issue is actually that the volume was -mkfs'd- without having the modules loaded, and so things weren't properly scanned.  Josef can probably elaborate.  :)

But it sounds like it's not necessarily indicative of a bug.  (Maybe mkfs.btrfs should ask for the module to be loaded, though, if this is the case?)


Comment 5 Josef Bacik 2010-08-16 12:51:13 UTC
Yeah for multi-device volumes you need to have both volumes in cache before mounting will work.  So you need to run btrfsctl -a while the btrfs module is loaded, and then do the mount, otherwise we can't find the second volume the user is trying to mount.

Comment 6 Eryu Guan 2010-08-17 03:04:01 UTC
Eric, Josef, thanks for clarifying this.

I think make mkfs.btrfs issue a warning/load btrfs module would be better then the user would know he is doing wrong (like me :)

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