diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 915077725fea..88f866f85e7a 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -104,7 +104,6 @@ static noinline int record_root_in_trans(struct btrfs_trans_handle *trans, | |||
104 | { | 104 | { |
105 | if (root->ref_cows && root->last_trans < trans->transid) { | 105 | if (root->ref_cows && root->last_trans < trans->transid) { |
106 | WARN_ON(root == root->fs_info->extent_root); | 106 | WARN_ON(root == root->fs_info->extent_root); |
107 | WARN_ON(root->root_item.refs == 0); | ||
108 | WARN_ON(root->commit_root != root->node); | 107 | WARN_ON(root->commit_root != root->node); |
109 | 108 | ||
110 | radix_tree_tag_set(&root->fs_info->fs_roots_radix, | 109 | radix_tree_tag_set(&root->fs_info->fs_roots_radix, |
@@ -1078,8 +1077,13 @@ int btrfs_clean_old_snapshots(struct btrfs_root *root) | |||
1078 | 1077 | ||
1079 | while (!list_empty(&list)) { | 1078 | while (!list_empty(&list)) { |
1080 | root = list_entry(list.next, struct btrfs_root, root_list); | 1079 | root = list_entry(list.next, struct btrfs_root, root_list); |
1081 | list_del_init(&root->root_list); | 1080 | list_del(&root->root_list); |
1082 | btrfs_drop_snapshot(root, 0); | 1081 | |
1082 | if (btrfs_header_backref_rev(root->node) < | ||
1083 | BTRFS_MIXED_BACKREF_REV) | ||
1084 | btrfs_drop_snapshot(root, 0); | ||
1085 | else | ||
1086 | btrfs_drop_snapshot(root, 1); | ||
1083 | } | 1087 | } |
1084 | return 0; | 1088 | return 0; |
1085 | } | 1089 | } |