]> git.karo-electronics.de Git - linux-beck.git/blobdiff - fs/cifs/cifs_dfs_ref.c
cifs: remove any preceding delimiter from prefix_path
[linux-beck.git] / fs / cifs / cifs_dfs_ref.c
index e956cba94338184416c96925690f21493fc61ab6..ec9dbbcca3b9031c9aa26aee7468d9123a39a320 100644 (file)
@@ -151,8 +151,12 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
        if (sb_mountdata == NULL)
                return ERR_PTR(-EINVAL);
 
-       if (strlen(fullpath) - ref->path_consumed)
+       if (strlen(fullpath) - ref->path_consumed) {
                prepath = fullpath + ref->path_consumed;
+               /* skip initial delimiter */
+               if (*prepath == '/' || *prepath == '\\')
+                       prepath++;
+       }
 
        *devname = cifs_build_devname(ref->node_name, prepath);
        if (IS_ERR(*devname)) {
@@ -302,7 +306,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
        if (full_path == NULL)
                goto cdda_exit;
 
-       cifs_sb = CIFS_SB(d_inode(mntpt)->i_sb);
+       cifs_sb = CIFS_SB(mntpt->d_sb);
        tlink = cifs_sb_tlink(cifs_sb);
        if (IS_ERR(tlink)) {
                mnt = ERR_CAST(tlink);