On Thu, Jan 27, 2022 at 01:53:06PM +0800, Qu Wenruo wrote: > There is a long existing bug in btrfs defrag code that it will always > try to defrag compressed extents, even they are already at max capacity. As commended under the patch, this not considered a bug, because the defrag ioctl is expected to reshuffle the extents, with or without compression and improving the compression ratio if asked to recompress with hither level. What is not perfect is the kernel side that could try harder to merge extents into bigger contiguous chunks, but as long as the compression is involved it's not possible to decide if the extents should be skipped or not.