linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel J Blueman <daniel@quora.org>
To: linux-btrfs@vger.kernel.org, "Chris Mason" <chris.mason@oracle.com>
Cc: "Josef Bacik" <josef@redhat.com>, Daniel J Blueman <daniel@quora.org>
Subject: [PATCH] Prevent root_list corruption
Date: Tue, 24 Apr 2012 13:11:40 +0800	[thread overview]
Message-ID: <1335244300-6599-1-git-send-email-daniel@quora.org> (raw)

I was seeing root_list corruption on unmount during fs resize in 3.4-rc4; add
correct locking to address this.

Signed-off-by: Daniel J Blueman <daniel@quora.org>
---
 fs/btrfs/relocation.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 017281d..5a105a0 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -1279,7 +1279,9 @@ static int __update_reloc_root(struct btrfs_root *root, int del)
 		if (rb_node)
 			backref_tree_panic(rb_node, -EEXIST, node->bytenr);
 	} else {
+		spin_lock(&root->fs_info->trans_lock);
 		list_del_init(&root->root_list);
+		spin_unlock(&root->fs_info->trans_lock);
 		kfree(node);
 	}
 	return 0;
-- 
1.7.9.5


             reply	other threads:[~2012-04-24  5:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24  5:11 Daniel J Blueman [this message]
2012-04-24 13:17 ` [PATCH] Prevent root_list corruption Josef Bacik

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=1335244300-6599-1-git-send-email-daniel@quora.org \
    --to=daniel@quora.org \
    --cc=chris.mason@oracle.com \
    --cc=josef@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).