Commit 61155aa04ebcba6a33f2a281c46f351ca150d816

Authored by David Sterba
Committed by Chris Mason
1 parent 521e0546c9

btrfs: assert that send is not in progres before root deletion

CC: Miao Xie <miaox@cn.fujitsu.com>
CC: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>

Showing 2 changed files with 1 additions and 13 deletions Side-by-side Diff

... ... @@ -2424,6 +2424,7 @@
2424 2424 shrink_dcache_sb(root->fs_info->sb);
2425 2425 btrfs_invalidate_inodes(dest);
2426 2426 d_delete(dentry);
  2427 + ASSERT(dest->send_in_progress == 0);
2427 2428  
2428 2429 /* the last ref */
2429 2430 if (dest->cache_inode) {
fs/btrfs/transaction.c
... ... @@ -1984,19 +1984,6 @@
1984 1984 }
1985 1985 root = list_first_entry(&fs_info->dead_roots,
1986 1986 struct btrfs_root, root_list);
1987   - /*
1988   - * Make sure root is not involved in send,
1989   - * if we fail with first root, we return
1990   - * directly rather than continue.
1991   - */
1992   - spin_lock(&root->root_item_lock);
1993   - if (root->send_in_progress) {
1994   - spin_unlock(&fs_info->trans_lock);
1995   - spin_unlock(&root->root_item_lock);
1996   - return 0;
1997   - }
1998   - spin_unlock(&root->root_item_lock);
1999   -
2000 1987 list_del_init(&root->root_list);
2001 1988 spin_unlock(&fs_info->trans_lock);
2002 1989