[patch] Allow all DFS failover/multi-target referrals to be followed

Darren Williams <[email protected]> Thu, 26 Nov 2009 06:01:33 +0800
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
--===============0194870418949884906==
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="utf-8"

<HTML>
Hi Guys<BR>
<BR>
Currently the CIFS code only parses and returns the first target of a<BR>
multi-target DFS referral, this patch fixes multi-target DFS referrals.<BR>
<BR>
Signed-off-by: Darren Williams darren.w(AT)computer.org<BR>
<BR>
---<BR>
<BR>
After testing and playing with DFS and DFS failover, I discovered that<BR>
the code was not parsing the DFS referral link correctly and only<BR>
returning the first target of a multi target path, this patch fixes the<BR>
issue and allow Linux CIFS to handle DFS failover.<BR>
<BR>
I have only test my scenario which is DFS referrals based users home<BR>
directory locations, i.e. <BR>
<BR>
&gt; test-home -&gt; msdfs:test-samba2.xxxx.com\test-home,test-samba1.xxxx.=
com\test-home<BR>
<BR>
I have not tested true DFS failover since I do not have the resources<BR>
available.<BR>
<BR>
Hope this helps<BR>
Darren<BR>
<BR>
--- linux-2.6.31.6.new/fs/cifs/cifssmb.c.orig&nbsp;&nbsp; 2009-11-26<BR>
01:47:05.000000000 +1100<BR>
+++ linux-2.6.31.6.new/fs/cifs/cifssmb.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; 2009-11-26<BR>
01:32:34.000000000 +1100<BR>
@@ -3952,7 +3952,7 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* collect neccessary data from =
referrals */<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i =3D 0; i &lt; *num_of_nodes; i=
++) {<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i =3D 0; i &lt; *num_of_nodes; i=
++, ref++) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; char *temp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; int max_len;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; struct dfs_info3_param *node =3D (*target_nodes)+i;<BR>
<BR>
<BR>
 </HTML>
<BR>=

--===============0194870418949884906==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
linux-cifs-client mailing list
[email protected]
https://lists.samba.org/mailman/listinfo/linux-cifs-client

--===============0194870418949884906==--