]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Btrfs: Only delete roots from sysfs when they were added to sysfs
authorChris Mason <chris.mason@oracle.com>
Mon, 14 Jan 2008 19:41:16 +0000 (14:41 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:03:59 +0000 (11:03 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/disk-io.c

index 0338f8fd382d989748647f7c24ab079bc6bed7a1..87daed632f370d31142b7e4ec8644e476db76ba7 100644 (file)
@@ -795,7 +795,8 @@ int btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root)
 {
        radix_tree_delete(&fs_info->fs_roots_radix,
                          (unsigned long)root->root_key.objectid);
-       btrfs_sysfs_del_root(root);
+       if (root->in_sysfs)
+               btrfs_sysfs_del_root(root);
        if (root->inode)
                iput(root->inode);
        if (root->node)