btrfs: test that defrag on small files does not hang or crashes
Test that defragging files with very small sizes works and does not
result in any crash, hang or corruption.
This is motivated by a regression introduced in kernel 5.16 where
attempting to defrag a file with a size of 1 byte would result in
the kernel code hitting an "infinite" loop (iterating from 0 to
(u64)-1 in increments of 256K, which in practice is an eternity).
The regression is fixed by a patch with the following subject:
"btrfs: fix too long loop when defragging a 1 byte file"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>