Bugzilla – Bug 1099147
btrfs: 16 EiB (and bigger) volumes running into kernel bug
Last modified: 2019-11-26 19:39:36 UTC
Created attachment 775294 [details] kernel oops [While testing for some other bug I run into this one.] btrfs lets you create filesystems > 8 EiB when using multiple devices (which is a very nice feature btw). BUT runs into a kernel bug when it gets to 16 EiB. Here's what I did: dd if=/dev/zero of=foo0 bs=1E count=0 seek=5 dd if=/dev/zero of=foo1 bs=1E count=0 seek=5 dd if=/dev/zero of=foo2 bs=1E count=0 seek=6 mkfs.btrfs -d single foo0 foo1 foo2 losetup /dev/loop10 foo0 losetup /dev/loop11 foo1 losetup /dev/loop12 foo2 mount /dev/loop10 /mnt This works so far but when you actually copy some data into /mnt, there's a kernel oops (attached). The (same) crash also happens with sizes slightly above 16EiB. Seen on Leap (this log) and TW.
Thanks for the test case. This is generating a pile of bugs even up to 5.0
This landed in btrfsprogs 5.2.2: commit d29f475108c8c8bc104fd8b79a789023e4acc755 Author: Jeff Mahoney <jeffm@suse.com> Date: Tue Aug 13 21:03:59 2019 -0400 btrfs-progs: check if adding device would overflow while scanning It's theoretically possible to add multiple devices with sizes that add up to or exceed 16EiB. A file system will be created successfully but will have a superblock with incorrect values for total_bytes and other fields. Kernels up to v5.0 will crash when they encounter this scenario. We need to check for overflow and reject the device if it would overflow. TW should already have that version. Leap will need a backport.