]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: add back missing dirty page rate limiting to defrag
authorFilipe Manana <fdmanana@suse.com>
Thu, 20 Jan 2022 17:11:52 +0000 (17:11 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Jan 2022 17:10:56 +0000 (18:10 +0100)
commit024eedb73b4053963a705e8b69a197ebf5294570
treef912541aa7bc8ec0a76482f3901e21c5e6a6b05b
parentd6de446a8ceabb74bba30383f2830b4b424e907b
btrfs: add back missing dirty page rate limiting to defrag

A defrag operation can dirty a lot of pages, specially if operating on
the entire file or a large file range. Any task dirtying pages should
periodically call balance_dirty_pages_ratelimited(), as stated in that
function's comments, otherwise they can leave too many dirty pages in
the system. This is what we did before the refactoring in 5.16, and
it should have remained, just like in the buffered write path and
relocation. So restore that behaviour.

Fixes: 2caa54427157a6 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()")
CC: stable@vger.kernel.org # 5.16
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c