From: Chris Mason Date: Mon, 14 Jan 2008 19:41:16 +0000 (-0500) Subject: Btrfs: Only delete roots from sysfs when they were added to sysfs X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b99aa6cb548ae9461c5dc0e38f88ebc618ea68d7;p=linux-beck.git Btrfs: Only delete roots from sysfs when they were added to sysfs Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 0338f8fd382d..87daed632f37 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -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)