dfs links anywhere?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

dfs links anywhere?

Samba - General mailing list
Hi all,
   Is 'msdfs root = yes' required in any share (along with 'host msdfs =
yes' in global) where you'd like msdfs links to work (redirect the client)?
   Can more than one server have a share with 'msdfs root = yes'?  Or
can there be only one root?  (Setting 'msdfs root = yes' on shares on
more than one server seems to be working at the moment, but I'd thought
I tried this earlier and had problems....)

Running Samba 4.2

Thanks!
Chad.

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
Hi,

Chad William Seys via samba <[hidden email]> writes:
> Hi all,
>    Is 'msdfs root = yes' required in any share (along with 'host msdfs =
> yes' in global) where you'd like msdfs links to work (redirect the client)?

yes

>    Can more than one server have a share with 'msdfs root = yes'?  Or
> can there be only one root?  (Setting 'msdfs root = yes' on shares on

yes

Cheers,

--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
Hello,

>>     Can more than one server have a share with 'msdfs root = yes'?  Or
>> can there be only one root?  (Setting 'msdfs root = yes' on shares on
>
> yes

Thanks!  It works great for all clients* except the linux kernel (v4.9)
mount, which was what led me astray.

Any idea if this works in more recent kernels?  If not where do I wish
list this. :)

Thanks,
Chad.

* clients tested Windows 10, Mac OS X 10.12, gnome 3.22 vfs, linux
kernel v4.9 .

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
Chad William Seys <[hidden email]> writes:
> Thanks!  It works great for all clients* except the linux kernel (v4.9)
> mount, which was what led me astray.

Which smb version are you using (mount option)? Support for DFS on smb2+
was only added in linux 4.11.

Cheers,

--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
> Which smb version are you using (mount option)? Support for DFS on smb2+
> was only added in linux 4.11.

smbstatus shows the connection as NT1.

DFS links do work like this:
serverA_msdfsrootYES => serverB_msdfsrootNO

But not like this:
serverA_msdfsrootYES => serverB_msdfsrootYES

Somehow the destination having 'msdfsroot yes' prevents the cifs kernel
module from following the link.

Thanks!
C.

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
Chad William Seys <[hidden email]> writes:
> Somehow the destination having 'msdfsroot yes' prevents the cifs kernel
> module from following the link.

Could you provide a network trace from the linux client of you mounting
and accessing this multi-level target, along with verbose kernel logs?

    echo 'module cifs +p' > /sys/kernel/debug/dynamic_debug/control
    echo 'file fs/cifs/* +p' > /sys/kernel/debug/dynamic_debug/control
    echo 1 > /proc/fs/cifs/cifsFYI
    echo 1 > /sys/module/dns_resolver/parameters/debug
   
    dmesg --clear
    tcpdump -w trace.pcap & pid=$!
    sleep 3
    mount.cifs ....cd ... ls.. blahblah
    sleep 3
    kill $pid
    dmesg > trace.log

this should produce a trace.pcap and trace.log file.

--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
(Let's keep this on the list)

Aurélien Aptel via samba <[hidden email]> writes:
> Chad William Seys <[hidden email]> writes:
>> Somehow the destination having 'msdfsroot yes' prevents the cifs kernel
>> module from following the link.

I've taken a look at your traces and right off the bat I see things like
this:

[...] /linux-4.9.30/fs/cifs/smb1ops.c: cifs_query_symlink: target path: \smb03.physics.wisc.edu\smb\instr_files
[...] /linux-4.9.30/fs/cifs/link.c: CIFS VFS: leaving cifs_get_link (xid = 35208) rc = 0
[...] /linux-4.9.30/fs/cifs/dir.c: CIFS VFS: in cifs_lookup as Xid: 35209 with uid: 1494
[...] /linux-4.9.30/fs/cifs/dir.c: parent inode = 0xffff893b14d610a8 name is: \smb03.physics.wisc.edu\smb\instr_files and dentry = 0xffff893b79dda3c0
[...] /linux-4.9.30/fs/cifs/dir.c: name: /\smb03.physics.wisc.edu\smb\instr_files
[...] /linux-4.9.30/fs/cifs/dir.c: name: /itadmin/\smb03.physics.wisc.edu\smb\instr_files
[...] /linux-4.9.30/fs/cifs/dir.c: NULL inode in lookup
[...] /linux-4.9.30/fs/cifs/dir.c: Full path: //smb.physics.wisc.edu/smb/itadmin/\smb03.physics.wisc.edu\smb\instr_files inode = 0x          (null)

Note the weird looking path:

  //smb.physics.wisc.edu/smb/itadmin/\smb03.physics.wisc.edu\smb\instr_files

Look to me the link is not properly substituted and there might some
issues with Unix Extensions mixing path separators.

I couldn't reproduce this on recent master kernel but I'll give it a try
on v4.9 which you seem to be using. My setup is

   cifs.ko connecting to sambaA/shareA -> sambaB/shareB -> sambaB/shareC
 
using unix extensions and both servers having 'msdfs host = yes' and
shareA, shareB with 'msdfs root = yes'.

Also, how did you create your symbolic links on the samba machine?
(exact command). Just a hunch at this point but you might want to check
you properly used _two_ backslashes at the start of the link target.

Cheers,

--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
Hi again,
   I had a look at your hunch and it seems to be fruitful:

This link style allows following the DFS link with cifs.ko:
ln -s msdfs://smb03.physics.wisc.edu/share/path testforward

BUT this link style (from Samba Wiki[1]) does NOT work:
ln -s msdfs:smb03.physics.wisc.edu\\share\\path testback

Thanks for you help!
C.

[1] Samba Wiki
https://wiki.samba.org/index.php/Distributed_File_System_(DFS)

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
Hi Chad,

Sorry for the late reply. Looking at this now.

Chad William Seys <[hidden email]> writes:
> I've attached traces and logs of these situations:
>
> msdfs root = yes, link points to share, link CAN be followed
> trace_msdfsrootyes_share.*
>
> msdfs root = yes, link points to path, link CANNOT be followed
> trace_msdfsrootyes_path.*

In this one I still see things mixing directory separators, e.g.:

  Update attributes: //smb03.physics.wisc.edu/smb\instr_files inode
  0xffff893c53c0e0a8 count 1 dentry: 0xffff893c596bbd80 d_time 0 jiffies
  5742081270


What about making your symlink like this:

    ln -s 'msdfs:\\smb03.physics.wisc.edu\share\path' testback

Note the use of simple quote and double _back_slash. I get unexpected
result with zsh (\ gets interpreted..) but with bash it results in this:

    d55:/tmp/share # ls -l link*
    lrwxrwxrwx 1 aaptel users 28 Aug 30 16:51 link -> msdfs:\\10.160.65.191\target
    lrwxrwxrwx 1 aaptel users 32 Aug 30 16:50 linksub -> msdfs:\\10.160.65.191\target\sub

And both link works, with msdfs root = yes

> msdfs root = no, link points to path, link CAN be followed
> trace_msdfsrootno_path.*

--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
Good news!
Kernel 4.13 can resolve either style of link, so I don't think we need
to spend more time with it!
gvfs in Debian 9 also works (as do Windows 7+ and Mac 10.12+).

What does not work is
Debian's 4.9.30-2+deb9u3
and Centos 7 3.10.0-514.26.2

If anyone could point out the patch which fixed this, possibly it could
be backported....

Thanks!
Chad.

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
In reply to this post by Samba - General mailing list
Hi Aurélien,
    Thanks for the continued help!
    I created the links as you suggested.  Similar to before, the link
to the share works, but the link to the directory in the share does not
work.

# to share
ln -sf 'msdfs:\\smb03.physics.wisc.edu\smb' smb03_smb

# to directory in share
ln -sf 'msdfs:\\smb03.physics.wisc.edu\smb\instr_files' smb03_smb_instrfiles

I still see the mixed / \ in the logs (attached).

Chad.

P.S. As a reminder, we've also tried the below variant with the same result:

# to share
ln -sf msdfs://smb03.physics.wisc.edu/smb smb03_smb

# to directory in share
ln -sf msdfs://smb03.physics.wisc.edu/smb/instr_files smb03_smb_instrfiles


--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
In reply to this post by Samba - General mailing list
Chad William Seys <[hidden email]> writes:
> Kernel 4.13 can resolve either style of link, so I don't think we need
> to spend more time with it!
> gvfs in Debian 9 also works (as do Windows 7+ and Mac 10.12+).

Good. I actually remember fixing something similar now, ha.

If you cannot update your kernel I think disabling the unix extension
might be a workaround (-o nounix). It will force the use of backslashes.

--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: dfs links anywhere?

Samba - General mailing list
> Good. I actually remember fixing something similar now, ha.

Must have been a yawner! :)

> If you cannot update your kernel I think disabling the unix extension
> might be a workaround (-o nounix). It will force the use of backslashes.

Unfortunately we use POSIX acl.  Is there a more targeted option, server
or client side?

Thanks!
Chad.

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba