提交 fa18f1bd 编写于 作者: A Al Viro

cifs: more breakage on mount failures

if cifs_get_root() fails, we end up with ->mount() returning NULL,
which is not what callers expect.  Moreover, in case of superblock
reuse we end up leaking a superblock reference...
Acked-by: NPavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 ee01a14d
......@@ -710,19 +710,16 @@ cifs_do_mount(struct file_system_type *fs_type,
sb->s_flags |= MS_ACTIVE;
out_shared:
root = cifs_get_root(volume_info, sb);
if (root == NULL)
if (root == NULL) {
root = ERR_PTR(-EINVAL); /* XXX */
goto out_super;
}
cFYI(1, "dentry root is: %p", root);
goto out;
out_shared:
root = cifs_get_root(volume_info, sb);
if (root)
cFYI(1, "dentry root is: %p", root);
goto out;
out_super:
deactivate_locked_super(sb);
out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册