5fbc7c59fd22c5a6531b40b0759624b680a95e52 in btrfs_kernel_fixes failed on B

Bug #1810376 reported by Po-Hsu Lin
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
Fix Released
Medium
Po-Hsu Lin

Bug Description

Test failed with mount operation:
    mount: /tmp/mnt-5fbc7c59fd22c5a6531b40b0759624b680a95e52: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.

This patch could be found in Bionic tree:
https://kernel.ubuntu.com/git/ubuntu/ubuntu-bionic.git/commit/?id=5fbc7c59fd22c5a6531b40b0759624b680a95e52

Invoking test 5fbc7c59fd22c5a6531b40b0759624b680a95e52

fix 5fbc7c59fd22c5a6531b40b0759624b680a95e52

    Btrfs: fix unfinished readahead thread for raid5/6 degraded mounting

    Steps to reproduce:

     # mkfs.btrfs -f /dev/sd[b-f] -m raid5 -d raid5
     # mkfs.ext4 /dev/sdc --->corrupt one of btrfs device
     # mount /dev/sdb /mnt -o degraded
     # btrfs scrub start -BRd /mnt

    This is because readahead would skip missing device, this is not true
    for RAID5/6, because REQ_GET_READ_MIRRORS return 1 for RAID5/6 block
    mapping. If expected data locates in missing device, readahead thread
    would not call __readahead_hook() which makes event @rc->elems=0
    wait forever.

    Fix this problem by checking return value of btrfs_map_block(),we
    can only skip missing device safely if there are several mirrors.

mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: 4096/524288************* *************done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: c4b9a22f-cacb-44d6-80b9-cca217a61f5b
Superblock backups stored on blocks:
 32768, 98304, 163840, 229376, 294912

Allocating group tables: 0/16***** *****done
Writing inode tables: 0/16***** *****done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: 0/16***** *****done

mount: /tmp/mnt-5fbc7c59fd22c5a6531b40b0759624b680a95e52: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
ERROR: not a btrfs filesystem: /tmp/mnt-5fbc7c59fd22c5a6531b40b0759624b680a95e52
btrfs scrub start on /tmp/mnt-5fbc7c59fd22c5a6531b40b0759624b680a95e52 failed
umount: /tmp/mnt-5fbc7c59fd22c5a6531b40b0759624b680a95e52: not mounted.

FAIL: 5fbc7c59fd22c5a6531b40b0759624b680a95e52 (ret=1)

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: linux-image-4.15.0-43-generic 4.15.0-43.46
ProcVersionSignature: User Name 4.15.0-43.46-generic 4.15.18
Uname: Linux 4.15.0-43-generic x86_64
AlsaDevices:
 total 0
 crw-rw---- 1 root audio 116, 1 Dec 31 02:11 seq
 crw-rw---- 1 root audio 116, 33 Dec 31 02:11 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
ApportVersion: 2.20.9-0ubuntu7.5
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
Date: Thu Jan 3 07:37:01 2019
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig': 'iwconfig'
Lsusb: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
PciMultimedia:

ProcFB: 0 cirrusdrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.15.0-43-generic root=UUID=2f68c627-8ab4-40d5-8c06-6563436d0f96 ro console=ttyS0,115200n8
RelatedPackageVersions:
 linux-restricted-modules-4.15.0-43-generic N/A
 linux-backports-modules-4.15.0-43-generic N/A
 linux-firmware 1.173.2
RfKill: Error: [Errno 2] No such file or directory: 'rfkill': 'rfkill'
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/01/2014
dmi.bios.vendor: SeaBIOS
dmi.bios.version: Ubuntu-1.8.2-1ubuntu1
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.version: pc-i440fx-xenial
dmi.modalias: dmi:bvnSeaBIOS:bvrUbuntu-1.8.2-1ubuntu1:bd04/01/2014:svnQEMU:pnStandardPC(i440FX+PIIX,1996):pvrpc-i440fx-xenial:cvnQEMU:ct1:cvrpc-i440fx-xenial:
dmi.product.name: Standard PC (i440FX + PIIX, 1996)
dmi.product.version: pc-i440fx-xenial
dmi.sys.vendor: QEMU

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

The degraded mount command returns 32 (mount failure), but the script is expecting return value 0

dmesg for this:
Jan 4 09:48:21 moe kernel: [90357.890809] BTRFS info (device loop4): allowing degraded mounts
Jan 4 09:48:21 moe kernel: [90357.890814] BTRFS info (device loop4): disk space caching is enabled
Jan 4 09:48:21 moe kernel: [90357.890817] BTRFS info (device loop4): has skinny extents
Jan 4 09:48:21 moe kernel: [90357.890819] BTRFS info (device loop4): flagging fs with big metadata feature
Jan 4 09:48:21 moe kernel: [90357.893639] BTRFS warning (device loop4): devid 2 uuid c554bc24-532c-4444-ae11-dc8ed9e52416 is missing
Jan 4 09:48:21 moe kernel: [90357.894691] BTRFS warning (device loop4): chunk 894173184 missing 1 devices, max tolerance is 0 for writeable mount
Jan 4 09:48:21 moe kernel: [90357.894694] BTRFS warning (device loop4): writeable mount is not allowed due to too many missing devices
Jan 4 09:48:21 moe kernel: [90357.995021] BTRFS error (device loop4): open_ctree failed

Also, this fix 5fbc7c59fd22c5a6531b40b0759624b680a95e52 has been covered by another patch 7aff8cf4a6d6 [1]

[1] https://kernel.ubuntu.com/git/ubuntu/ubuntu-bionic.git/commit/?id=7aff8cf4a6d6

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

# btrfs fi show
warning, device 2 is missing
Label: none uuid: 197d7031-64a2-417b-b45a-74d5c9c9e278
 Total devices 5 FS bytes used 112.00KiB
 devid 1 size 2.00GiB used 412.69MiB path /dev/loop0
 devid 3 size 2.00GiB used 412.69MiB path /dev/loop2
 devid 4 size 2.00GiB used 412.69MiB path /dev/loop3
 devid 5 size 2.00GiB used 412.69MiB path /dev/loop4
 *** Some devices missing

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

The cause of this seems to be that we are just telling the SUT to create a metadata block groups with raid 5. The data block groups was not specified. It will be using RAID0.

So that when one disk corrupts, the raid will corrupt. The system will prevent user to mount the partition as rw to prevent data loss (you can mount it with read-only).

mkfs.btrfs -f -m raid5 $DEV0 $DEV1 $DEV2 $DEV3 $DEV4
btrfs-progs v4.15.1
See http://btrfs.wiki.kernel.org for more information.

Performing full device TRIM /dev/loop0 (2.00GiB) ...
Performing full device TRIM /dev/loop1 (2.00GiB) ...
Performing full device TRIM /dev/loop2 (2.00GiB) ...
Performing full device TRIM /dev/loop3 (2.00GiB) ...
Performing full device TRIM /dev/loop4 (2.00GiB) ...
Label: (null)
UUID: 21f732f9-2850-4732-9901-c4bce48c3efb
Node size: 16384
Sector size: 4096
Filesystem size: 10.00GiB
Block group profiles:
  Data: RAID0 1023.75MiB
  Metadata: RAID5 819.00MiB
  System: RAID5 12.75MiB
SSD detected: no
Incompat features: extref, raid56, skinny-metadata
Number of devices: 5
Devices:
   ID SIZE PATH
    1 2.00GiB /dev/loop0
    2 2.00GiB /dev/loop1
    3 2.00GiB /dev/loop2
    4 2.00GiB /dev/loop3
    5 2.00GiB /dev/loop4

If you create the raid with data block groups assigned with raid 5, the Block group profiles will become:
  Data: RAID5 819.00MiB
  Metadata: RAID5 819.00MiB
  System: RAID5 12.75MiB

Changed in ubuntu-kernel-tests:
assignee: nobody → Po-Hsu Lin (cypressyew)
importance: Undecided → Medium
status: New → In Progress
Changed in linux (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Changed in ubuntu-kernel-tests:
status: In Progress → Fix Released
Po-Hsu Lin (cypressyew)
no longer affects: linux (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.