btrfs-convert fails and corrupts ext4 FS because of bit overflow

Bug #1913527 reported by vinibali
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
btrfs-tools (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hello!

Btrfs-convert fails to convert and corrupts an EXT4 filesystem, please see the example below. The kernel developers are aware of this problem and the fix has been applied after the current 5.7.1 version. Please apply the patch or jump to the fixed version in the repo.
I used the btrfs-progs_5.10-1_amd64.deb package from the dev branch and it worked!

Regards

https://github.com/kdave/btrfs-progs/commit/c9c4eb1f3fd343512d50b075b40bba656cbd02cb
https://bugzilla.kernel.org/show_bug.cgi?id=206995
https://www.spinics.net/lists/linux-btrfs/msg103379.html

xubuntu@xubuntu:/tmp$ sudo btrfs-convert /dev/nvme0n1p1
create btrfs filesystem:
        blocksize: 4096
        nodesize: 16384
        features: extref, skinny-metadata (default)
        checksum: crc32c
creating ext2 image file
ERROR: missing data block for bytenr 1048576
ERROR: failed to create ext2_saved/image: -2
WARNING: an error occurred during conversion, filesystem is partially created but not finalized and not mountable
xubuntu@xubuntu:/tmp$ sudo fsck.ext4 -f -y /dev/nvme0n1p1
.
.
.
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Inode 4001 (...) is an illegal FIFO.
Clear? yes

Inode 4002 (...) has invalid mode (00).
Clear? yes

Inode 4003 ref count is 192, should be 1. Fix? yes

Inode 4005 (...) has invalid mode (00).
Clear? yes

Pass 5: Checking group summary information
Free blocks count wrong for group #0 (75, counted=76).
Fix? yes

Free blocks count wrong (31948715, counted=31948716).
Fix? yes

Free inodes count wrong for group #0 (962, counted=959).
Fix? yes

Free inodes count wrong (12276349, counted=12276346).
Fix? yes

/dev/nvme0n1p1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/nvme0n1p1: 830854/13107200 files (0.3% non-contiguous), 20480084/52428800 blocks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.