From bce1f8f6855e74efa03c5ac2f9237573cc3a7d3f Mon Sep 17 00:00:00 2001 From: Steve French Date: Mon, 26 Jul 2010 18:20:16 +0000 Subject: [PATCH] --- yaml --- r: 201727 b: refs/heads/master c: f67909cf80051e8510194a51f88c4de323b92071 h: refs/heads/master i: 201725: eb6558758a4ba8cd08f4d3d9cac0957b1d9e2b1f 201723: 7d4e3e284136511942c8c75d7b1c9d9605a4b834 201719: 1bd76c2bf465fe15ba27f66e5d9e50180407ebbb 201711: 4c33f3178e650192622a72944739e48e5c3787ca 201695: 96c4f83d10ccd09f20d265a39a465b80d4893932 201663: af45f771fa7d4d18dec22c11fc2197e695f2abbb 201599: 1262ccbb2ac8ef2309a0848cfd080fd9d4bfb3fa 201471: a90e29614ea0e44241216af0bec0ba31fe52054f 201215: c63d122be64c6c95b909594f4958d025350bdbb3 200703: 6a551968e42efdf2150d8ec1cd4f9729bcc23b4b v: v3 --- [refs] | 2 +- trunk/fs/cifs/cifs_dfs_ref.c | 28 +++++++++++----------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index 4cd19548e330..13465dc3bc15 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f636a34802e3913415410c6e595df2bf84851cff +refs/heads/master: f67909cf80051e8510194a51f88c4de323b92071 diff --git a/trunk/fs/cifs/cifs_dfs_ref.c b/trunk/fs/cifs/cifs_dfs_ref.c index ac19a6f3dae0..dc1ed50ea06e 100644 --- a/trunk/fs/cifs/cifs_dfs_ref.c +++ b/trunk/fs/cifs/cifs_dfs_ref.c @@ -230,28 +230,22 @@ char *cifs_compose_mount_options(const char *sb_mountdata, goto compose_mount_options_out; } - -static struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent, - struct dentry *dentry, const struct dfs_info3_param *ref) +/** + * cifs_dfs_do_refmount - mounts specified path using provided refferal + * @cifs_sb: parent/root superblock + * @fullpath: full path in UNC format + * @ref: server's referral + */ +static struct vfsmount *cifs_dfs_do_refmount(struct cifs_sb_info *cifs_sb, + const char *fullpath, const struct dfs_info3_param *ref) { - struct cifs_sb_info *cifs_sb; struct vfsmount *mnt; char *mountdata; char *devname = NULL; - char *fullpath; - - cifs_sb = CIFS_SB(dentry->d_inode->i_sb); - /* - * this function gives us a path with a double backslash prefix. We - * require a single backslash for DFS. - */ - fullpath = build_path_from_dentry(dentry); - if (!fullpath) - return ERR_PTR(-ENOMEM); + /* strip first '\' from fullpath */ mountdata = cifs_compose_mount_options(cifs_sb->mountdata, fullpath + 1, ref, &devname); - kfree(fullpath); if (IS_ERR(mountdata)) return (struct vfsmount *)mountdata; @@ -357,8 +351,8 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) rc = -EINVAL; goto out_err; } - mnt = cifs_dfs_do_refmount(nd->path.mnt, - nd->path.dentry, referrals + i); + mnt = cifs_dfs_do_refmount(cifs_sb, + full_path, referrals + i); cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, referrals[i].node_name, mnt);