diff mbox

Btrfs: setup blank root and fs_info for mount time

Message ID 1290392498.2602.21.camel@perseus.themaw.net (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Kent Nov. 22, 2010, 2:21 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 6b57da3..960b320 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -565,6 +565,12 @@  static int btrfs_test_super(struct super_block *s, void *data)
 	struct btrfs_fs_devices *test_fs_devices = data->fs_info->fs_devices;
 	struct btrfs_root *root = btrfs_sb(s);
 
+	/*
+	 * If this super block is going away, return false as it
+	 * can't match as an existing super block.
+	 */
+	if (!atomic_read(&s->s_active))
+		return 0;
 	return root->fs_info->fs_devices == test_fs_devices;
 }