aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifs_dfs_ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifs_dfs_ref.c')
-rw-r--r--fs/cifs/cifs_dfs_ref.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index f1e13ea45a17..f4aab6f01174 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -306,6 +306,7 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
306 int xid, i; 306 int xid, i;
307 int rc = 0; 307 int rc = 0;
308 struct vfsmount *mnt = ERR_PTR(-ENOENT); 308 struct vfsmount *mnt = ERR_PTR(-ENOENT);
309 struct tcon_link *tlink;
309 310
310 cFYI(1, "in %s", __func__); 311 cFYI(1, "in %s", __func__);
311 BUG_ON(IS_ROOT(dentry)); 312 BUG_ON(IS_ROOT(dentry));
@@ -315,14 +316,6 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
315 dput(nd->path.dentry); 316 dput(nd->path.dentry);
316 nd->path.dentry = dget(dentry); 317 nd->path.dentry = dget(dentry);
317 318
318 cifs_sb = CIFS_SB(dentry->d_inode->i_sb);
319 ses = cifs_sb_tcon(cifs_sb)->ses;
320
321 if (!ses) {
322 rc = -EINVAL;
323 goto out_err;
324 }
325
326 /* 319 /*
327 * The MSDFS spec states that paths in DFS referral requests and 320 * The MSDFS spec states that paths in DFS referral requests and
328 * responses must be prefixed by a single '\' character instead of 321 * responses must be prefixed by a single '\' character instead of
@@ -335,10 +328,20 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
335 goto out_err; 328 goto out_err;
336 } 329 }
337 330
338 rc = get_dfs_path(xid, ses , full_path + 1, cifs_sb->local_nls, 331 cifs_sb = CIFS_SB(dentry->d_inode->i_sb);
332 tlink = cifs_sb_tlink(cifs_sb);
333 if (IS_ERR(tlink)) {
334 rc = PTR_ERR(tlink);
335 goto out_err;
336 }
337 ses = tlink_tcon(tlink)->ses;
338
339 rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls,
339 &num_referrals, &referrals, 340 &num_referrals, &referrals,
340 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 341 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
341 342
343 cifs_put_tlink(tlink);
344
342 for (i = 0; i < num_referrals; i++) { 345 for (i = 0; i < num_referrals; i++) {
343 int len; 346 int len;
344 dump_referral(referrals+i); 347 dump_referral(referrals+i);