← Back to team overview

debcrafters-packages team mailing list archive

[Bug 2091894] Re: btrfs receive allocates ALL space for DATA & makes it UNUSABLE (24.04.1)

 

I could reproduce it with Ubuntu's mainline kernel 6.11.11 on 24.04.
For the higher kernel version there was some compilation error, so I couldn't check it.

There's a number of related bugs, and its not always clear how to even distinguish between them:
https://bugzilla.kernel.org/show_bug.cgi?id=74101#c12
https://bugzilla.kernel.org/show_bug.cgi?id=74101#c6
https://bugzilla.kernel.org/show_bug.cgi?id=74101#c5
https://bugs.launchpad.net/ubuntu/+source/btrfs-tools/+bug/1664013
https://github.com/kdave/btrfs-progs/issues/657
https://github.com/kdave/btrfs-progs/issues/936

> What I need to understand is if there's an issue in the kernel which
need a patch

Kernel code is involved in this bug for sure, but this doesn't seem to be a simple yes/no type of issue that is easy to answer. I believe every btrfs-relevant commit could improve kernel's allocation algorithm behavior.
One must format the whole partition and start from scratch to even try to reproduce it.

Why not simply merge every btrfs-relevant kernel's commit?
Until both kernel btrfs and userspace version are up to date, I don't know how one could even attempt to answer this question.

At least some of the issues listed above should be fixed if both btrfs-related kernel's commits and userspace version are up to date.
I don't know  about specific kernel commits sorry. 
BTRFS team at https://github.com/kdave/btrfs-progs should be able to advise on this.

Hope this helps.

** Bug watch added: Linux Kernel Bug Tracker #74101
   https://bugzilla.kernel.org/show_bug.cgi?id=74101

** Bug watch added: github.com/kdave/btrfs-progs/issues #657
   https://github.com/kdave/btrfs-progs/issues/657

** Bug watch added: github.com/kdave/btrfs-progs/issues #936
   https://github.com/kdave/btrfs-progs/issues/936

-- 
You received this bug notification because you are a member of
Debcrafters packages, which is subscribed to btrfs-progs in Ubuntu.
https://bugs.launchpad.net/bugs/2091894

Title:
  btrfs receive allocates ALL space for DATA & makes it UNUSABLE
  (24.04.1)

Status in btrfs-progs package in Ubuntu:
  Triaged
Status in linux-meta package in Ubuntu:
  New
Status in btrfs-progs source package in Noble:
  New
Status in linux-meta source package in Noble:
  New

Bug description:
  Hi!

  'btrfs receive' ALLOCATES ALL the available space for DATA immediately
  right after 'btrfs receive'/BTRBK start.

  I did format on target partition with BTRFS.
  Started and interrupted BTRBK/'btrfs receive' after few seconds (on SSD).

  Note "Device unallocated: 1.00MiB"
  even though only "Used:2.11GiB (0.24%))" for DATA.

  BTRFS team believes this is a Ubuntu's Kernel related issue.
  The partition usually soon become UNUSABLE due to lack of unallocated space.
  This is a HIGH Priority bug in Ubuntu 24.04.1.

  What you expected to happen: 'btrfs receive' should NOT ALLOCATE all
  available space for DATA or even a large portion of it on a freshly
  formatted partition when only 0.24% used.

  The above behavior is confirmed on several drives, both internal(SATA)
  and USB.

  btrfs-progs v6.6.3
  Kernel 6.8.0-50-generic (default in Ubuntu 24.04.1 LTS for today, no custom build).
  The system is fully updated.

  lsb_release -rd
  No LSB modules are available.
  Description:	Ubuntu 24.04.1 LTS
  Release:	24.04

  apt-cache policy btrfs-progs
  btrfs-progs:
    Installed: 6.6.3-1.1build2
    Candidate: 6.6.3-1.1build2
    Version table:
   *** 6.6.3-1.1build2 500
          500 http://us.archive.ubuntu.com/ubuntu noble/main amd64 Packages
          100 /var/lib/dpkg/status
  ==============================================
  sudo btrfs fi usage .

  Overall:
  Device size: 870.10GiB
  Device allocated: 870.10GiB
  Device unallocated: 1.00MiB
  Device missing: 0.00B
  Device slack: 0.00B
  Used: 2.37GiB
  Free (estimated): 865.98GiB (min: 865.98GiB)
  Free (statfs, df): 865.98GiB
  Data ratio: 1.00
  Metadata ratio: 2.00
  Global reserve: 5.50MiB (used: 0.00B)
  Multiple profiles: no

  Data,single: Size:868.08GiB, Used:2.11GiB (0.24%)
  /dev/mapper/DELETED 868.08GiB

  Metadata,DUP: Size:1.00GiB, Used:135.81MiB (13.26%)
  /dev/mapper/DELETED 2.00GiB

  System,DUP: Size:8.00MiB, Used:112.00KiB (1.37%)
  /dev/mapper/DELETED 16.00MiB

  Unallocated:
  /dev/mapper/DELETED 1.00MiB

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/btrfs-progs/+bug/2091894/+subscriptions