History

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.

Jeff Layton committed 15 years ago

Commit b9bce2e1 parent 20547491 file · +20 −10Browse files

Unified · Split

fs/cifs/connect.c+20−10
@@ -65,6 +65,8 @@ static int ip_connect(struct TCP_Server_Info *server); · 64 unmodified lines
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 reconnection72 * cifs tcp session reconnection
@@ -2830,12 +2832,9 @@ is_path_accessible(int xid, struct cifs_tcon *tcon, · 2759 unmodified lines
2830 return rc;2832 return rc;
2831}2833}
2832 2834
2833void2835static 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) · 1 unmodified line
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_UPCALL2857#ifdef CONFIG_CIFS_DFS_UPCALL
2851/* build_path_to_root returns full path to root when2858/* 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, · 62 unmodified lines
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);