Linux 5.16.5 Released To Fix Up Btrfs' Botched Up Defragging
Linux 5.16 had a refactoring of the Btrfs file-system defrag code and this sadly ended up regressing things, which fortunately are fixed now for v5.16.5. Btrfs up to now on Linux 5.16 was consuming high amounts of I/O and causing performance degradation of the system.
With Linux 5.16.5 this is fixed up with changes including the possibility of a nearly infinite loop when defragging a 1 byte file and fixing the wrong number of defragged sectors. The latter change caused for much more I/O when using the "autodefrag" mount option than necessary, stemming from the v5.16 work that ended up accidentally using a byte size rather than sector size. For helping to fight off issues like this in the future, there is also restored support for allowing the defragging to be interruptible so it can be cancelled by a signal rather than needing to reboot the system.
There are also other autodefrag fixes stemming from the recent refactoring too, including a possible deadlock condition.
At least not a data loss bug, but the state Btrfs shipped for Linux 5.16 was initially less than desirable..
Long story short, if using Btrfs on Linux 5.16 you will want to make sure you are now using Linux 5.16.5 or later.
The full list of Linux 5.16.5 fixes can be found via the release announcement.