diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-17 10:02:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-24 18:39:43 -0400 |
commit | 9403c9c598e91d473c0582066e47ed2289292e45 (patch) | |
tree | 95f3da790bd27de1b4a16e1f1f6f3952d274b8ab /fs/cifs | |
parent | 5c4f1ad7c6aa3b729bd3a93b80f9417d7e978c32 (diff) |
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>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 12 |
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) | |||
554 | full_path = cifs_build_path_to_root(vol, cifs_sb, | 554 | full_path = cifs_build_path_to_root(vol, cifs_sb, |
555 | cifs_sb_master_tcon(cifs_sb)); | 555 | cifs_sb_master_tcon(cifs_sb)); |
556 | if (full_path == NULL) | 556 | if (full_path == NULL) |
557 | return NULL; | 557 | return ERR_PTR(-ENOMEM); |
558 | 558 | ||
559 | cFYI(1, "Get root dentry for %s", full_path); | 559 | cFYI(1, "Get root dentry for %s", full_path); |
560 | 560 | ||
@@ -583,7 +583,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) | |||
583 | dchild = d_alloc(dparent, &name); | 583 | dchild = d_alloc(dparent, &name); |
584 | if (dchild == NULL) { | 584 | if (dchild == NULL) { |
585 | dput(dparent); | 585 | dput(dparent); |
586 | dparent = NULL; | 586 | dparent = ERR_PTR(-ENOMEM); |
587 | goto out; | 587 | goto out; |
588 | } | 588 | } |
589 | } | 589 | } |
@@ -601,7 +601,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) | |||
601 | if (rc) { | 601 | if (rc) { |
602 | dput(dchild); | 602 | dput(dchild); |
603 | dput(dparent); | 603 | dput(dparent); |
604 | dparent = NULL; | 604 | dparent = ERR_PTR(rc); |
605 | goto out; | 605 | goto out; |
606 | } | 606 | } |
607 | alias = d_materialise_unique(dchild, inode); | 607 | alias = d_materialise_unique(dchild, inode); |
@@ -609,7 +609,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) | |||
609 | dput(dchild); | 609 | dput(dchild); |
610 | if (IS_ERR(alias)) { | 610 | if (IS_ERR(alias)) { |
611 | dput(dparent); | 611 | dput(dparent); |
612 | dparent = NULL; | 612 | dparent = ERR_PTR(-EINVAL); /* XXX */ |
613 | goto out; | 613 | goto out; |
614 | } | 614 | } |
615 | dchild = alias; | 615 | dchild = alias; |
@@ -704,10 +704,8 @@ cifs_do_mount(struct file_system_type *fs_type, | |||
704 | } | 704 | } |
705 | 705 | ||
706 | root = cifs_get_root(volume_info, sb); | 706 | root = cifs_get_root(volume_info, sb); |
707 | if (root == NULL) { | 707 | if (IS_ERR(root)) |
708 | root = ERR_PTR(-EINVAL); /* XXX */ | ||
709 | goto out_super; | 708 | goto out_super; |
710 | } | ||
711 | 709 | ||
712 | cFYI(1, "dentry root is: %p", root); | 710 | cFYI(1, "dentry root is: %p", root); |
713 | goto out; | 711 | goto out; |