Skip to contentSkip to conversation

BUG: unable to mount btrfs on ppc64 starting from v4.7-rc3 kernel

DISCUSSION Eryu Guan 3 participants 3 messages Jun 14, 2016 – Jun 15, 2016 Btrfs file system

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

Hi,

I'm unable to mount btrfs on ppc64 hosts and other hosts with 64k pagesize(like aarch64, ppc64le). It seems that it's commit 99e3ecfcb9f4 ("Btrfs: add more validation checks for superblock") introduced this failure, btrfs fails stripesize check.

[root@ibm-p8-kvm-09-guest-06 btrfs-progs]# uname -r 4.7.0-rc3
[root@ibm-p8-kvm-09-guest-06 btrfs-progs]# ./mkfs.btrfs -f /dev/vda3 btrfs-progs v4.4
See http://btrfs.wiki.kernel.org for more information.

Label:              (null)
UUID:               06813ff6-d585-4c54-b4df-b7d6920d27ba
Node size:          65536
Sector size:        65536
Filesystem size:    15.00GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         DUP               1.01GiB
  System:           DUP              12.00MiB
SSD detected:       no
Incompat features:  extref, skinny-metadata
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1    15.00GiB  /dev/vda3

[root@ibm-p8-kvm-09-guest-06 btrfs-progs]# mount /dev/vda3 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/vda3,
missing codepage or helper program, or other error

In some cases useful info is found in syslog - try dmesg | tail or so.
[root@ibm-p8-kvm-09-guest-06 btrfs-progs]# dmesg | tail
...

[ 1910.048650] BTRFS: device fsid 06813ff6-d585-4c54-b4df-b7d6920d27ba devid 1 transid 3 /dev/vda3
[ 1913.152085] BTRFS error (device vda3): invalid stripesize 4096
[ 1913.154349] BTRFS error (device vda3): superblock contains fatal errors
[ 1913.200300] BTRFS: open_ctree failed

Thanks,
Eryu

#1 lore raw

Hi,

Quoted 33 lines · Eryu Guan

Hi,

I'm unable to mount btrfs on ppc64 hosts and other hosts with 64k pagesize(like aarch64, ppc64le). It seems that it's commit 99e3ecfcb9f4 ("Btrfs: add more validation checks for superblock") introduced this failure, btrfs fails stripesize check.

[root@ibm-p8-kvm-09-guest-06 btrfs-progs]# uname -r 4.7.0-rc3
[root@ibm-p8-kvm-09-guest-06 btrfs-progs]# ./mkfs.btrfs -f /dev/vda3 btrfs-progs v4.4
See http://btrfs.wiki.kernel.org for more information.

Label:              (null)
UUID:               06813ff6-d585-4c54-b4df-b7d6920d27ba
Node size:          65536
Sector size:        65536
Filesystem size:    15.00GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         DUP               1.01GiB
  System:           DUP              12.00MiB
SSD detected:       no
Incompat features:  extref, skinny-metadata
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1    15.00GiB  /dev/vda3

[root@ibm-p8-kvm-09-guest-06 btrfs-progs]# mount /dev/vda3 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/vda3,
missing codepage or helper program, or other error

Quoted 8 lines

In some cases useful info is found in syslog - try dmesg | tail or so.
[root@ibm-p8-kvm-09-guest-06 btrfs-progs]# dmesg | tail
...

[ 1910.048650] BTRFS: device fsid 06813ff6-d585-4c54-b4df-b7d6920d27ba devid 1 transid 3 /dev/vda3
[ 1913.152085] BTRFS error (device vda3): invalid stripesize 4096
[ 1913.154349] BTRFS error (device vda3): superblock contains fatal errors
[ 1913.200300] BTRFS: open_ctree failed

Ah, that's right, we need to update btrfs-progs to set super_stripesize to sectorsize.

In mkfs.c we have,

{
	u32 sectorsize = 4096;
	u32 stripesize = 4096;
	...
	sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
	...
	mkfs_cfg.sectorsize = sectorsize;
	mkfs_cfg.stripesize = stripesize;

	ret = make_btrfs(fd, &mkfs_cfg, NULL);
	...
}

Thanks,

-liubo

#2 lore raw
Quoted 10 lines · Liu Bo
Quoted 4 lines
[ 1910.048650] BTRFS: device fsid 06813ff6-d585-4c54-b4df-b7d6920d27ba devid 1 transid 3 /dev/vda3
[ 1913.152085] BTRFS error (device vda3): invalid stripesize 4096
[ 1913.154349] BTRFS error (device vda3): superblock contains fatal errors
[ 1913.200300] BTRFS: open_ctree failed

Ah, that's right, we need to update btrfs-progs to set super_stripesize to sectorsize.

In mkfs.c we have,

Quoted 12 lines
{
	u32 sectorsize = 4096;
	u32 stripesize = 4096;
	...
	sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
	...
	mkfs_cfg.sectorsize = sectorsize;
	mkfs_cfg.stripesize = stripesize;

	ret = make_btrfs(fd, &mkfs_cfg, NULL);
	...
}

Yeah we need to fix progs and allow the 4k value in kernel, Chandan will send a patch.