Move check for prefix path to within cifs_get_root()
authorSachin Prabhu <sprabhu@redhat.com>
Fri, 29 Jul 2016 21:38:21 +0000 (22:38 +0100)
committerSteve French <smfrench@gmail.com>
Sat, 10 Sep 2016 04:58:07 +0000 (23:58 -0500)
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Tested-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/cifsfs.c

index cc9cdab52dabd8b95b8059e44c6a5b13346e61b1..14ae4b8e1a3ce8370b282503c91a1ff428d61f5b 100644 (file)
@@ -609,6 +609,9 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
        char *s, *p;
        char sep;
 
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH)
+               return dget(sb->s_root);
+
        full_path = cifs_build_path_to_root(vol, cifs_sb,
                                            cifs_sb_master_tcon(cifs_sb));
        if (full_path == NULL)
@@ -731,11 +734,7 @@ cifs_do_mount(struct file_system_type *fs_type,
                sb->s_flags |= MS_ACTIVE;
        }
 
-       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH)
-               root = dget(sb->s_root);
-       else
-               root = cifs_get_root(volume_info, sb);
-
+       root = cifs_get_root(volume_info, sb);
        if (IS_ERR(root))
                goto out_super;