diff options
| author | David S. Miller <davem@davemloft.net> | 2019-10-05 13:37:23 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2019-10-05 13:37:23 -0700 |
| commit | 6f4c930e02355664d89c976eccea5d999a90de16 (patch) | |
| tree | bc08932fbf43b9560ba5bde3284674054e3b56eb /fs/btrfs/relocation.c | |
| parent | 26e0105550862a137eba701e2f4e3eeb343759e9 (diff) | |
| parent | 2d00aee21a5d4966e086d98f9d710afb92fb14e8 (diff) | |
| download | linux-6f4c930e02355664d89c976eccea5d999a90de16.tar.gz linux-6f4c930e02355664d89c976eccea5d999a90de16.tar.bz2 linux-6f4c930e02355664d89c976eccea5d999a90de16.zip | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Diffstat (limited to 'fs/btrfs/relocation.c')
| -rw-r--r-- | fs/btrfs/relocation.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 2f0e25afa486..00504657b602 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1435,6 +1435,13 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans, int clear_rsv = 0; int ret; + /* + * The subvolume has reloc tree but the swap is finished, no need to + * create/update the dead reloc tree + */ + if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state)) + return 0; + if (root->reloc_root) { reloc_root = root->reloc_root; reloc_root->last_trans = trans->transid; @@ -2187,7 +2194,6 @@ static int clean_dirty_subvols(struct reloc_control *rc) /* Merged subvolume, cleanup its reloc root */ struct btrfs_root *reloc_root = root->reloc_root; - clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state); list_del_init(&root->reloc_dirty_list); root->reloc_root = NULL; if (reloc_root) { @@ -2196,6 +2202,7 @@ static int clean_dirty_subvols(struct reloc_control *rc) if (ret2 < 0 && !ret) ret = ret2; } + clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state); btrfs_put_fs_root(root); } else { /* Orphan reloc tree, just clean it up */ |
