]> git.hungrycats.org Git - linux/commitdiff
Move check for prefix path to within cifs_get_root()
authorSachin Prabhu <sprabhu@redhat.com>
Thu, 26 Jan 2017 13:28:02 +0000 (14:28 +0100)
committerJiri Slaby <jslaby@suse.cz>
Fri, 27 Jan 2017 10:16:03 +0000 (11:16 +0100)
commit 348c1bfa84dfc47da1f1234b7f2bf09fa798edea upstream.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Tested-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Acked-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/cifs/cifsfs.c

index 846b9916fdcd7392b0a21b9d435787f0ae7f0d0a..75aacb731c54c78b31695e4558b5b3bda51fab61 100644 (file)
@@ -586,6 +586,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)
@@ -710,11 +713,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;