Bug 1099147 - btrfs: 16 EiB (and bigger) volumes running into kernel bug
btrfs: 16 EiB (and bigger) volumes running into kernel bug
Status: NEW
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Kernel
Leap 15.0
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Goldwyn Rodrigues
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-26 11:15 UTC by Steffen Winterfeldt
Modified: 2019-11-26 19:39 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
kernel oops (13.71 KB, text/plain)
2018-06-26 11:15 UTC, Steffen Winterfeldt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Winterfeldt 2018-06-26 11:15:06 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.
Comment 1 Jeff Mahoney 2019-01-08 21:05:08 UTC
Thanks for the test case.  This is generating a pile of bugs even up to 5.0
Comment 2 Jeff Mahoney 2019-11-26 19:39:36 UTC
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.