kdave / btrfsmaintenance

Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag on selected mountpoints or directories.
GNU General Public License v2.0
897 stars 79 forks source link

btrfs-defrag.sh should respect BTRFS_ALLOW_CONCURRENCY #115

Open DarwinAwardWinner opened 11 months ago

DarwinAwardWinner commented 11 months ago

I recently ran into a situation where defrag and scrub were running simultaneously, which brought my entire system to a grinding halt. Looking into it, I see that btrfs-defrag.sh does not use run_task, which means it doesn't respect the setting of BTRFS_ALLOW_CONCURRENCY. From a cursory look at the code, I assume fixing this is as simple as adding run_task on line 30.