aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-07-06 08:10:39 -0400
committerSteve French <sfrench@us.ibm.com>2011-07-09 17:25:57 -0400
commitb9bce2e9f9936cfd12fbc62ead11edcdd46dec7e (patch)
treedc2c4677b3530b612d11489800128e53d27b27ba /fs
parent20547490c12b0ee3d32152b85e9f9bd183aa7224 (diff)
cifs: fix expand_dfs_referral
Regression introduced in commit 724d9f1cfba. Prior to that, expand_dfs_referral would regenerate the mount data string and then call cifs_parse_mount_options to re-parse it (klunky, but it worked). The above commit moved cifs_parse_mount_options out of cifs_mount, so the re-parsing of the new mount options no longer occurred. Fix it by making expand_dfs_referral re-parse the mount options. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/connect.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 511176903e57..6ec366ff28b3 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -65,6 +65,8 @@ static int ip_connect(struct TCP_Server_Info *server);
65static int generic_ip_connect(struct TCP_Server_Info *server); 65static int generic_ip_connect(struct TCP_Server_Info *server);
66static void tlink_rb_insert(struct rb_root *root, struct tcon_link *new_tlink); 66static void tlink_rb_insert(struct rb_root *root, struct tcon_link *new_tlink);
67static void cifs_prune_tlinks(struct work_struct *work); 67static void cifs_prune_tlinks(struct work_struct *work);
68static int cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
69 const char *devname);
68 70
69/* 71/*
70 * cifs tcp session reconnection 72 * cifs tcp session reconnection
@@ -2830,12 +2832,9 @@ is_path_accessible(int xid, struct cifs_tcon *tcon,
2830 return rc; 2832 return rc;
2831} 2833}
2832 2834
2833void 2835static void
2834cifs_cleanup_volume_info(struct smb_vol *volume_info) 2836cleanup_volume_info_contents(struct smb_vol *volume_info)
2835{ 2837{
2836 if (!volume_info)
2837 return;
2838
2839 kfree(volume_info->username); 2838 kfree(volume_info->username);
2840 kzfree(volume_info->password); 2839 kzfree(volume_info->password);
2841 kfree(volume_info->UNC); 2840 kfree(volume_info->UNC);
@@ -2843,10 +2842,18 @@ cifs_cleanup_volume_info(struct smb_vol *volume_info)
2843 kfree(volume_info->domainname); 2842 kfree(volume_info->domainname);
2844 kfree(volume_info->iocharset); 2843 kfree(volume_info->iocharset);
2845 kfree(volume_info->prepath); 2844 kfree(volume_info->prepath);
2845}
2846
2847void
2848cifs_cleanup_volume_info(struct smb_vol *volume_info)
2849{
2850 if (!volume_info)
2851 return;
2852 cleanup_volume_info_contents(volume_info);
2846 kfree(volume_info); 2853 kfree(volume_info);
2847 return;
2848} 2854}
2849 2855
2856
2850#ifdef CONFIG_CIFS_DFS_UPCALL 2857#ifdef CONFIG_CIFS_DFS_UPCALL
2851/* build_path_to_root returns full path to root when 2858/* build_path_to_root returns full path to root when
2852 * we do not have an exiting connection (tcon) */ 2859 * we do not have an exiting connection (tcon) */
@@ -2915,15 +2922,18 @@ expand_dfs_referral(int xid, struct cifs_ses *pSesInfo,
2915 &fake_devname); 2922 &fake_devname);
2916 2923
2917 free_dfs_info_array(referrals, num_referrals); 2924 free_dfs_info_array(referrals, num_referrals);
2918 kfree(fake_devname);
2919
2920 if (cifs_sb->mountdata != NULL)
2921 kfree(cifs_sb->mountdata);
2922 2925
2923 if (IS_ERR(mdata)) { 2926 if (IS_ERR(mdata)) {
2924 rc = PTR_ERR(mdata); 2927 rc = PTR_ERR(mdata);
2925 mdata = NULL; 2928 mdata = NULL;
2929 } else {
2930 cleanup_volume_info_contents(volume_info);
2931 memset(volume_info, '\0', sizeof(*volume_info));
2932 rc = cifs_setup_volume_info(volume_info, mdata,
2933 fake_devname);
2926 } 2934 }
2935 kfree(fake_devname);
2936 kfree(cifs_sb->mountdata);
2927 cifs_sb->mountdata = mdata; 2937 cifs_sb->mountdata = mdata;
2928 } 2938 }
2929 kfree(full_path); 2939 kfree(full_path);