Message ID | 20130127124154.GA16722@liubo (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index f154946..d4ee66b 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -885,7 +885,15 @@ static noinline int commit_cowonly_roots(struct btrfs_trans_handle *trans, int btrfs_add_dead_root(struct btrfs_root *root) { spin_lock(&root->fs_info->trans_lock); + if (!list_empty(&root->root_list)) { + struct btrfs_root *tmp; + list_for_each_entry(tmp, &root->fs_info->dead_roots, root_list) + if (tmp == root) + goto unlock; + } + list_add(&root->root_list, &root->fs_info->dead_roots); +unlock: spin_unlock(&root->fs_info->trans_lock); return 0; }