diff options
-rw-r--r-- | fs/btrfs/disk-io.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 0f75a01f69e2..21d1d066758e 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1584,8 +1584,11 @@ struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info, | |||
1584 | ERR_PTR(-ENOENT); | 1584 | ERR_PTR(-ENOENT); |
1585 | again: | 1585 | again: |
1586 | root = btrfs_lookup_fs_root(fs_info, location->objectid); | 1586 | root = btrfs_lookup_fs_root(fs_info, location->objectid); |
1587 | if (root) | 1587 | if (root) { |
1588 | if (btrfs_root_refs(&root->root_item) == 0) | ||
1589 | return ERR_PTR(-ENOENT); | ||
1588 | return root; | 1590 | return root; |
1591 | } | ||
1589 | 1592 | ||
1590 | root = btrfs_read_fs_root(fs_info->tree_root, location); | 1593 | root = btrfs_read_fs_root(fs_info->tree_root, location); |
1591 | if (IS_ERR(root)) | 1594 | if (IS_ERR(root)) |