• Filipe Manana's avatar
    btrfs: add back missing dirty page rate limiting to defrag · 3c9d31c7
    Filipe Manana authored
    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: 7b508037 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()")
    CC: stable@vger.kernel.org # 5.16
    Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    3c9d31c7
ioctl.c 127 KB