All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: linux-btrfs@vger.kernel.org
Cc: clm@fb.com, David Sterba <dsterba@suse.cz>,
	Miao Xie <miaox@cn.fujitsu.com>,
	Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Subject: [PATCH 2/2] btrfs: assert that send is not in progres before root deletion
Date: Tue, 15 Apr 2014 16:42:03 +0200	[thread overview]
Message-ID: <d3b3541addf25947ff6c6fa7b7d2ff3e7f952111.1397572052.git.dsterba@suse.cz> (raw)
In-Reply-To: <cover.1397572052.git.dsterba@suse.cz>

CC: Miao Xie <miaox@cn.fujitsu.com>
CC: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
 fs/btrfs/ioctl.c       |    1 +
 fs/btrfs/transaction.c |   13 -------------
 2 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index a385d88bd8d5..3cdb62e7cab8 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2352,6 +2352,7 @@ out_unlock:
 		shrink_dcache_sb(root->fs_info->sb);
 		btrfs_invalidate_inodes(dest);
 		d_delete(dentry);
+		ASSERT(dest->send_in_progress == 0);
 
 		/* the last ref */
 		if (dest->cache_inode) {
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 34cd83184c4a..c2ae9bb1c308 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1977,19 +1977,6 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root)
 	}
 	root = list_first_entry(&fs_info->dead_roots,
 			struct btrfs_root, root_list);
-	/*
-	 * Make sure root is not involved in send,
-	 * if we fail with first root, we return
-	 * directly rather than continue.
-	 */
-	spin_lock(&root->root_item_lock);
-	if (root->send_in_progress) {
-		spin_unlock(&fs_info->trans_lock);
-		spin_unlock(&root->root_item_lock);
-		return 0;
-	}
-	spin_unlock(&root->root_item_lock);
-
 	list_del_init(&root->root_list);
 	spin_unlock(&fs_info->trans_lock);
 
-- 
1.7.9


      parent reply	other threads:[~2014-04-15 14:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 14:41 [PATCH 0/2] Snapshot deletion vs send (for 3.15) David Sterba
2014-04-15 14:41 ` [PATCH 1/2] btrfs: protect snapshots from deleting during send David Sterba
2014-04-15 14:52   ` Chris Mason
2014-04-15 15:44     ` David Sterba
2014-04-15 16:00       ` Chris Mason
2014-04-15 16:27         ` David Sterba
2014-04-15 17:21           ` Chris Mason
2014-04-16 13:32             ` David Sterba
2014-04-16 13:40               ` Chris Mason
2014-04-16 14:59                 ` Brendan Hide
2014-04-16 15:22                   ` David Sterba
2014-04-26 12:16                     ` Brendan Hide
2014-04-16 15:18                 ` David Sterba
2014-05-12 13:52   ` Chris Mason
2014-04-15 14:42 ` David Sterba [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d3b3541addf25947ff6c6fa7b7d2ff3e7f952111.1397572052.git.dsterba@suse.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=miaox@cn.fujitsu.com \
    --cc=wangsl.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.