summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-06-17 18:02:59 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-06-25 02:39:43 +0400
commit9403c9c598e91d473c0582066e47ed2289292e45 (patch)
tree95f3da790bd27de1b4a16e1f1f6f3952d274b8ab
parent5c4f1ad7c6aa3b729bd3a93b80f9417d7e978c32 (diff)
downloadlinux-9403c9c598e91d473c0582066e47ed2289292e45.tar.xz
cifs: propagate errors from cifs_get_root() to mount(2)
... instead of just failing with -EINVAL Acked-by: Pavel Shilovsky <piastryyy@gmail.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/cifs/cifsfs.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 9a6696a5eb78..35f9154615fa 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -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,
cifs_sb_master_tcon(cifs_sb));
if (full_path == NULL)
- return NULL;
+ return ERR_PTR(-ENOMEM);
cFYI(1, "Get root dentry for %s", full_path);
@@ -583,7 +583,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
dchild = d_alloc(dparent, &name);
if (dchild == NULL) {
dput(dparent);
- dparent = NULL;
+ dparent = ERR_PTR(-ENOMEM);
goto out;
}
}
@@ -601,7 +601,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
if (rc) {
dput(dchild);
dput(dparent);
- dparent = NULL;
+ dparent = ERR_PTR(rc);
goto out;
}
alias = d_materialise_unique(dchild, inode);
@@ -609,7 +609,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
dput(dchild);
if (IS_ERR(alias)) {
dput(dparent);
- dparent = NULL;
+ dparent = ERR_PTR(-EINVAL); /* XXX */
goto out;
}
dchild = alias;
@@ -704,10 +704,8 @@ cifs_do_mount(struct file_system_type *fs_type,
}
root = cifs_get_root(volume_info, sb);
- if (root == NULL) {
- root = ERR_PTR(-EINVAL); /* XXX */
+ if (IS_ERR(root))
goto out_super;
- }
cFYI(1, "dentry root is: %p", root);
goto out;