提交 c6e2bac1 编写于 作者: J Josef Bacik 提交者: Chris Mason

Btrfs: fix panic on error during mount

This needs to be applied on top of my previous patches, but is needed for more
than just my new stuff.  We're going to the wrong label when we have an error,
we try to stop the workers, but they are started below all of this code.  This
fixes it so we go to the right error label and not panic when we fail one of
these cases.
Signed-off-by: NJosef Bacik <jbacik@redhat.com>
上级 f2b636e8
...@@ -1579,12 +1579,12 @@ struct btrfs_root *open_ctree(struct super_block *sb, ...@@ -1579,12 +1579,12 @@ struct btrfs_root *open_ctree(struct super_block *sb,
disk_super = &fs_info->super_copy; disk_super = &fs_info->super_copy;
if (!btrfs_super_root(disk_super)) if (!btrfs_super_root(disk_super))
goto fail_sb_buffer; goto fail_iput;
ret = btrfs_parse_options(tree_root, options); ret = btrfs_parse_options(tree_root, options);
if (ret) { if (ret) {
err = ret; err = ret;
goto fail_sb_buffer; goto fail_iput;
} }
features = btrfs_super_incompat_flags(disk_super) & features = btrfs_super_incompat_flags(disk_super) &
...@@ -1594,7 +1594,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, ...@@ -1594,7 +1594,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
"unsupported optional features (%Lx).\n", "unsupported optional features (%Lx).\n",
features); features);
err = -EINVAL; err = -EINVAL;
goto fail_sb_buffer; goto fail_iput;
} }
features = btrfs_super_compat_ro_flags(disk_super) & features = btrfs_super_compat_ro_flags(disk_super) &
...@@ -1604,7 +1604,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, ...@@ -1604,7 +1604,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
"unsupported option features (%Lx).\n", "unsupported option features (%Lx).\n",
features); features);
err = -EINVAL; err = -EINVAL;
goto fail_sb_buffer; goto fail_iput;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册