]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: balance btree dirty pages and delayed items after clone and dedupe
authorFilipe Manana <fdmanana@suse.com>
Tue, 31 May 2022 15:06:34 +0000 (16:06 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:44:35 +0000 (17:44 +0200)
commit645ed44068361c0071ed1bb2852ba960193adf34
treea75f036be4114bdd535aca7baba1428228e9ca51
parent66c514fe2773bd944ccd7f80c72333850c700c40
btrfs: balance btree dirty pages and delayed items after clone and dedupe

When reflinking extents (clone and deduplication), we need to touch the
btree of the destination inode's subvolume, as well as potentially
create a delayed inode for the destination inode (if it was not created
before). However we are neither balancing the btree dirty pages nor the
delayed items after such operations, so if we have a task that is doing
a long series of clone or deduplication operations, it can result in
accumulation of too many btree dirty pages and delayed items.

So just call btrfs_btree_balance_dirty() after clone and deduplication,
just like we do for every other system call that results on modifying a
btree and adding delayed items.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/reflink.c