5fbc7c59fd22c5a6531b40b0759624b680a95e52 ubuntu_btrfs_kernel_fixes failed with J-oem-6.5
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-kernel-tests |
New
|
Undecided
|
Unassigned |
Bug Description
This issue can be found since 6.5.0-1003.3 when we start testing this kernel with bare-metal resources. (This test was not run on openstack VM)
Test failed with:
$ sudo ./5fbc7c59fd22c
fix 5fbc7c59fd22c5a
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_
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_
can only skip missing device safely if there are several mirrors.
mke2fs 1.46.5 (30-Dec-2021)
/dev/loop8 contains a btrfs file system
Discarding device blocks: done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 98040e90-
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
mount: /dev/loop7: can't find in /etc/fstab.
mount /dev/loop7 on degraded raid5 failed
dmesg output:
[67744.195644] loop7: detected capacity change from 0 to 4194304
[67744.204713] loop8: detected capacity change from 0 to 4194304
[67744.213210] loop9: detected capacity change from 0 to 4194304
[67744.220870] loop10: detected capacity change from 0 to 4194304
[67744.227971] loop11: detected capacity change from 0 to 4194304
[67747.181182] BTRFS: device fsid 140973c6-
[67747.222225] BTRFS: device fsid 140973c6-
[67747.253234] BTRFS: device fsid 140973c6-
[67747.279864] BTRFS: device fsid 140973c6-
[67747.294655] BTRFS: device fsid 140973c6-
[67795.394565] systemd-
[67867.395505] systemd-
The same failure can be found in Mantic 6.5.0-1005 as well: autovm4: ~/autotest- client- tests/ubuntu_ btrfs_kernel_ fixes/fixes$ sudo ./5fbc7c59fd22c 5a6531b40b07596 24b680a95e52. sh 6531b40b0759624 b680a95e52
ubuntu@
fix 5fbc7c59fd22c5a
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 READ_MIRRORS return 1 for RAID5/6 block
for RAID5/6, because REQ_GET_
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.47.0 (5-Feb-2023) a1b2-425d- 9dd9-1695390d93 17
/dev/loop4 contains a btrfs file system
Discarding device blocks: done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 2d62988f-
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
mount: /dev/loop3: can't find in /etc/fstab. autovm4: ~/autotest- client- tests/ubuntu_ btrfs_kernel_ fixes/fixes$ uname -a
mount /dev/loop3 on degraded raid5 failed
ubuntu@
Linux autovm4 6.5.0-5-generic #5-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 6 15:11:07 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux