The same failure can be found in Mantic 6.5.0-1005 as well:
ubuntu@autovm4:~/autotest-client-tests/ubuntu_btrfs_kernel_fixes/fixes$ sudo ./5fbc7c59fd22c5a6531b40b0759624b680a95e52.sh
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.47.0 (5-Feb-2023)
/dev/loop4 contains a btrfs file system
Discarding device blocks: done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 2d62988f-a1b2-425d-9dd9-1695390d9317
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.
mount /dev/loop3 on degraded raid5 failed
ubuntu@autovm4:~/autotest-client-tests/ubuntu_btrfs_kernel_fixes/fixes$ uname -a
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
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