Merge tag '6.1-rc6-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
[sfrench/cifs-2.6.git] / fs / cifs / cifs_dfs_ref.c
index 007427ba75e5fbd3f75ccaeada446606fa0f075f..b0864da9ef4341ce8d19afef65b37c29f59842e3 100644 (file)
@@ -307,12 +307,8 @@ static struct vfsmount *cifs_dfs_do_mount(struct dentry *mntpt,
 static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
 {
        struct cifs_sb_info *cifs_sb;
-       struct cifs_ses *ses;
-       struct cifs_tcon *tcon;
        void *page;
-       char *full_path, *root_path;
-       unsigned int xid;
-       int rc;
+       char *full_path;
        struct vfsmount *mnt;
 
        cifs_dbg(FYI, "in %s\n", __func__);
@@ -324,8 +320,6 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
         * the double backslashes usually used in the UNC. This function
         * gives us the latter, so we must adjust the result.
         */
-       mnt = ERR_PTR(-ENOMEM);
-
        cifs_sb = CIFS_SB(mntpt->d_sb);
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS) {
                mnt = ERR_PTR(-EREMOTE);
@@ -341,60 +335,11 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
        }
 
        convert_delimiter(full_path, '\\');
-
        cifs_dbg(FYI, "%s: full_path: %s\n", __func__, full_path);
 
-       if (!cifs_sb_master_tlink(cifs_sb)) {
-               cifs_dbg(FYI, "%s: master tlink is NULL\n", __func__);
-               goto free_full_path;
-       }
-
-       tcon = cifs_sb_master_tcon(cifs_sb);
-       if (!tcon) {
-               cifs_dbg(FYI, "%s: master tcon is NULL\n", __func__);
-               goto free_full_path;
-       }
-
-       root_path = kstrdup(tcon->treeName, GFP_KERNEL);
-       if (!root_path) {
-               mnt = ERR_PTR(-ENOMEM);
-               goto free_full_path;
-       }
-       cifs_dbg(FYI, "%s: root path: %s\n", __func__, root_path);
-
-       ses = tcon->ses;
-       xid = get_xid();
-
-       /*
-        * If DFS root has been expired, then unconditionally fetch it again to
-        * refresh DFS referral cache.
-        */
-       rc = dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb),
-                           root_path + 1, NULL, NULL);
-       if (!rc) {
-               rc = dfs_cache_find(xid, ses, cifs_sb->local_nls,
-                                   cifs_remap(cifs_sb), full_path + 1,
-                                   NULL, NULL);
-       }
-
-       free_xid(xid);
-
-       if (rc) {
-               mnt = ERR_PTR(rc);
-               goto free_root_path;
-       }
-       /*
-        * OK - we were able to get and cache a referral for @full_path.
-        *
-        * Now, pass it down to cifs_mount() and it will retry every available
-        * node server in case of failures - no need to do it here.
-        */
        mnt = cifs_dfs_do_mount(mntpt, cifs_sb, full_path);
-       cifs_dbg(FYI, "%s: cifs_dfs_do_mount:%s , mnt:%p\n", __func__,
-                full_path + 1, mnt);
+       cifs_dbg(FYI, "%s: cifs_dfs_do_mount:%s , mnt:%p\n", __func__, full_path + 1, mnt);
 
-free_root_path:
-       kfree(root_path);
 free_full_path:
        free_dentry_path(page);
 cdda_exit: