On 2019/9/24 下午5:12, Nikolay Borisov wrote: > > > On 16.09.19 г. 15:02 ч., Qu Wenruo wrote: >> [BUG] >> The following script can cause btrfs qgroup data space leak: >> >> mkfs.btrfs -f $dev >> mount $dev -o nospace_cache $mnt >> >> btrfs subv create $mnt/subv >> btrfs quota en $mnt >> btrfs quota rescan -w $mnt >> btrfs qgroup limit 128m $mnt/subv >> >> for (( i = 0; i < 3; i++)); do >> # Create 3 64M holes for latter fallocate to fail >> truncate -s 192m $mnt/subv/file >> xfs_io -c "pwrite 64m 4k" $mnt/subv/file > /dev/null >> xfs_io -c "pwrite 128m 4k" $mnt/subv/file > /dev/null >> sync >> >> # it's supposed to fail, and each failure will leak at least 64M >> # data space >> xfs_io -f -c "falloc 0 192m" $mnt/subv/file &> /dev/null >> rm $mnt/subv/file >> sync >> done >> >> # Shouldn't fail after we removed the file >> xfs_io -f -c "falloc 0 64m" $mnt/subv/file > > Was this sent as a separate fstest case? Yep. https://patchwork.kernel.org/patch/11145871/ Thanks, Qu > > <snip> >
