Bug ID 1191954
Summary btrfs fiemap results are inconsistent compared to XFS
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Other
Status NEW
Severity Minor
Priority P5 - None
Component Kernel
Assignee wqu@suse.com
Reporter ddiss@suse.com
QA Contact qa-bugs@suse.de
CC kernel-bugs@opensuse.org
Found By ---
Blocker ---

This is perhaps just a request for clarification rather than an actual bug.

The workload is performed by Dracut, when patched with dracut-cpio reflink
support. All files are on the same Btrfs FS / mount:
- clone files into staging area via "cp --reflink=auto"
- create initramfs cpio archive by cloning files in staging area as
copy_file_range() source, and initramfs img as destination
- fsync and close initramfs
- delete staging area (rm -rf)
- call fiemap on initramfs and count shared extents

The goal of fiemap is to check which initramfs extents are shared with the "cp
--reflink=auto" sources, not the staging area.

With the same initramfs source files, XFS provides consistent fiemap results
showing identical shared vs exclusive extents across multiple runs. On Btrfs
the shared vs exclusive extent ratio varies wildly, with shared extent count
often being much higher than would be expected possible with the "cp --reflink"
source. This leads me to believe that the shared extents are associated with
the deleted staging area, or are miscalculated by the filesystem.

Full reproducer is: install a default Btrfs tumbleweed root (no snapshots),
install reflink-capable Dracut from
https://download.opensuse.org/repositories/home:/dmdiss:/rust-15x-initcowfs/openSUSE_Tumbleweed/
and then rebuild initramfs with the following /etc/dracut.conf configuration:

do_strip=no
tmpdir=/boot
INITRD_COMPRESS=cat
enhanced_cpio=yes

run dracut and then: xfs_io -c "fiemap -v" initramfs


You are receiving this mail because: