Commit 9403c9c5 authored by Al Viro's avatar Al Viro

cifs: propagate errors from cifs_get_root() to mount(2)

... instead of just failing with -EINVAL
Acked-by: default avatarPavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5c4f1ad7
...@@ -554,7 +554,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) ...@@ -554,7 +554,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
full_path = cifs_build_path_to_root(vol, cifs_sb, full_path = cifs_build_path_to_root(vol, cifs_sb,
cifs_sb_master_tcon(cifs_sb)); cifs_sb_master_tcon(cifs_sb));
if (full_path == NULL) if (full_path == NULL)
return NULL; return ERR_PTR(-ENOMEM);
cFYI(1, "Get root dentry for %s", full_path); cFYI(1, "Get root dentry for %s", full_path);
...@@ -583,7 +583,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) ...@@ -583,7 +583,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
dchild = d_alloc(dparent, &name); dchild = d_alloc(dparent, &name);
if (dchild == NULL) { if (dchild == NULL) {
dput(dparent); dput(dparent);
dparent = NULL; dparent = ERR_PTR(-ENOMEM);
goto out; goto out;
} }
} }
...@@ -601,7 +601,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) ...@@ -601,7 +601,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
if (rc) { if (rc) {
dput(dchild); dput(dchild);
dput(dparent); dput(dparent);
dparent = NULL; dparent = ERR_PTR(rc);
goto out; goto out;
} }
alias = d_materialise_unique(dchild, inode); alias = d_materialise_unique(dchild, inode);
...@@ -609,7 +609,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) ...@@ -609,7 +609,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
dput(dchild); dput(dchild);
if (IS_ERR(alias)) { if (IS_ERR(alias)) {
dput(dparent); dput(dparent);
dparent = NULL; dparent = ERR_PTR(-EINVAL); /* XXX */
goto out; goto out;
} }
dchild = alias; dchild = alias;
...@@ -704,10 +704,8 @@ cifs_do_mount(struct file_system_type *fs_type, ...@@ -704,10 +704,8 @@ cifs_do_mount(struct file_system_type *fs_type,
} }
root = cifs_get_root(volume_info, sb); root = cifs_get_root(volume_info, sb);
if (root == NULL) { if (IS_ERR(root))
root = ERR_PTR(-EINVAL); /* XXX */
goto out_super; goto out_super;
}
cFYI(1, "dentry root is: %p", root); cFYI(1, "dentry root is: %p", root);
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment