Bug 216522

Summary: divide error: 0000 btrfs_qgroup_reserve_data
Product: File System Reporter: MarkW (instruform)
Component: btrfsAssignee: BTRFS virtual assignee (fs_btrfs)
Status: RESOLVED CODE_FIX    
Severity: normal CC: dsterba
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.19.7-arch1-1 Subsystem:
Regression: No Bisected commit-id:
Attachments: Kernel message

Description MarkW 2022-09-24 03:59:45 UTC
Created attachment 301858 [details]
Kernel message

This is a human-induced core dump, but should be checked by the kernel/driver to prevent data loss. Two BTRFS filesystems on different drives (sde1 and sdf1 in the example below) with the same UUID were mounted on the same machine. What is needed for achieving a robust production filesystem is to warn users about this and refuse to mount multiple filesystems with the same UUID.

Example steps:
sudo mkdir /mnt/backup-drive /mnt/backup-drive2
sudo mount /dev/sde1 /mnt/backup-drive
sudo mount /dev/sdf1 /mnt/backup-drive2
sudo cp /var/backup/full/data/202209* /mnt/backup-drive/

The kernel panics at this point.

df -h yields:
Filesystem Size Used Avail Use% Mounted on
...
/dev/sde1 3.7T 2.4T 1.3T 66% /mnt/backup-drive
/dev/sdf1 3.7T 2.8T 909G 76% /mnt/backup-drive2
Comment 1 David Sterba 2024-04-10 18:55:14 UTC
Mounting same UUID on different devices is supported as the temp-fsid feature added in 6.8. On a single device this would assign a temporary UUID and will recognize that there are different devices.