[linux-cifs-client] mount.cifs and dfs referrals

Igor Mammedov niallain at gmail.com
Fri Jan 30 12:44:36 GMT 2009


Werner Maes wrote:
> in attachment you'll find
> 
> badcase.pcap (tcpdump output) & badcase.log (the kernel log).
> 
> what's may be strange:
> 
> If I do a mount of the domain first:
> 
> fs/cifs/cifssmb.c: num_referrals: 2 dfs flags: 0x1 ... 

The current code supports only referrals with dfs flags: 0x2. (i.e. refs to storage servers).

In this case, the domain server returns referrals without any server holding storage.
This case is not implemented yet.


> number of referrals is two
> 
> If I mount the dfsserver and only get one
> 
> fs/cifs/cifssmb.c: num_referrals: 1 dfs flags: 0x2 ...
> 
> anyway, if you need more info let me know
> 
> werner
> 
>> -----Original Message-----
>> From: Igor Mammedov [mailto:niallain at gmail.com]
>> Sent: vrijdag 30 januari 2009 10:39
>> To: Werner Maes
>> Cc: linux-cifs-client at lists.samba.org
>> Subject: Re: [linux-cifs-client] mount.cifs and dfs referrals
>>
>> Werner Maes wrote:
>>> I tried Jeff Layton testkernel "kernel-2.6.18-
>> 129.el5.jtltest.60.i686.rpm" for RHEL5 with CIFS version 1.56RH but
>> with the same results. No luck...
>>> more log info below. what's interesting are the first two lines.
>>> apparently it translates the AD-DOMAIN to the dfsserver (which is
>> good). But on the dfsserver there are dfs links that refer to shares on
>> a NAS. And it only translates once?
>>> AD-DOMAIN ==> DFSSERVER ==> SHARE ON NASSERVER
>>>
>>> fs/cifs/cifs_dfs_ref.c: DFS: ref path: \AD-DOMAIN\CRD\Shares
>>>  fs/cifs/cifs_dfs_ref.c: DFS: node path:
>> \dfsserver.ad.icts.kuleuven.be\Shares
>>>  fs/cifs/cifs_dfs_ref.c: DFS: fl: 1, srv_type: 0
>>>  fs/cifs/cifs_dfs_ref.c: DFS: ref_flags: 0, path_consumed: 30
>>>  fs/cifs/cifs_dfs_ref.c: DFS: ref path:
>> Full log for this bad case may be helpful, (not just some lines from
>> it).
>> And a network conversation between servers with command:
>>  tcpdump -s0 -w /tmp/badcase.pcap port 445
>>
>>
>>
>>> So I do mount.cifs directly on the dfsserver I get (and this works):
>>>
>>> fs/cifs/cifs_dfs_ref.c: DFS: ref path:
>> \dfdserver.ad.icts.kuleuven.be\Shares\
>>>  fs/cifs/cifs_dfs_ref.c: DFS: node path:
>> \nasserver.ad.icts.kuleuven.be\CRD_SHARES$\
>>>  fs/cifs/cifs_dfs_ref.c: DFS: fl: 2, srv_type: 0
>>>  fs/cifs/cifs_dfs_ref.c: DFS: ref_flags: 0, path_consumed: 52
>>>  fs/cifs/dns_resolve.c: dns_resolve_server_name_to_ip: resolved:
>> nasserver.ad.icts.kuleuven.be to a.b.c.d (ipadress)
>>>  fs/cifs/cifsfs.c: Devname:
>> \\nasserver.ad.icts.kuleuven.be\CRD_SHARES$ flags: 0
>>>  fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 128 with uid: 0
>>>  fs/cifs/connect.c: Domain name set
>>>  fs/cifs/connect.c: prefix path /sharepoint-03
>>>  fs/cifs/connect.c: Username: xxxxxx
>>>  fs/cifs/connect.c: UNC: \\nasserver.ad.icts.kuleuven.be\CRD_SHARES$
>> ip: a.b.c.d
>>>  fs/cifs/connect.c: Socket created
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: Werner Maes
>>>> Sent: donderdag 29 januari 2009 21:07
>>>> To: Q (Igor Mammedov)
>>>> Cc: linux-cifs-client at lists.samba.org
>>>> Subject: RE: [linux-cifs-client] mount.cifs and dfs referrals
>>>>
>>>> What exactly do you need?
>>>>
>>>> ________________________________________
>>>> Van: Q (Igor Mammedov) [niallain at gmail.com]
>>>> Verzonden: donderdag 29 januari 2009 20:29
>>>> Aan: Werner Maes
>>>> CC: linux-cifs-client at lists.samba.org
>>>> Onderwerp: Re: [linux-cifs-client] mount.cifs and dfs referrals
>>>>
>>>> It is hard to comment on issue, without log and dump of the packets.
>>>>
>>>> On Thu, Jan 29, 2009 at 8:23 PM, Werner Maes
>>>> <Werner.Maes at icts.kuleuven.be> wrote:
>>>>> yes
>>>>>
>>>>> I had configured it:
>>>>>
>>>>> # cat /etc/request-key.conf
>>>>> create cifs.spnego * * /usr/sbin/cifs.upcall %k
>>>>> create dns_resolver * * /usr/sbin/cifs.upcall %k
>>>>>
>>>>> this resolved some issues e.g:
>>>>> I can now follow a dfs link in this mounted share:
>>>>>
>>>>> mount.cifs //dfsserver.icts.kuleuven.be/shares /mnt -o ... (dfs
>> root
>>>> level)
>>>>> this share on the dfs-server contains dfs links and they work.
>>>>>
>>>>> HOWEVER:
>>>>>
>>>>> what does not work if I access it through the domain level e.g.:
>>>>>
>>>>> mount.cifs //AD-DOMAIN/shares /mnt
>>>>>
>>>>> the mount works without kernel failures but I can't follow the link
>>>>>
>>>>> [root at fedora10 Users]# ls
>>>>> ls: reading directory .: Object is remote
>>>>>
>>>>> Jan 29 17:52:43 localhost kernel: Status code returned 0xc0000257
>>>> NT_STATUS_PATH_NOT_COVERED
>>>>> (Users being a dfs link)
>>>>>
>>>>> I enabled some error logging with echo 7 > /proc/fs/cifs/cifsFYI
>>>>> but I can't work out what's wrong..
>>>>> maybe some issues with Active Directory??
>>>>>
>>>>> werner
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Igor Mammedov [mailto:niallain at gmail.com]
>>>>>> Sent: donderdag 29 januari 2009 17:56
>>>>>> To: Werner Maes
>>>>>> Cc: 'linux-cifs-client at lists.samba.org'
>>>>>> Subject: Re: [linux-cifs-client] mount.cifs and dfs referrals
>>>>>>
>>>>>> Werner Maes wrote:
>>>>>>> I also get this message
>>>>>>>
>>>>>>> CIFS VFS: dns_resolve_server_name_to_ip: unable to resolve:
>>>>>> xxx.icts.kuleuven.be
>>>>>>> CIFS VFS: compose_mount_options: Failed to resolve server part of
>>>>>> \\xxx.icts.kuleuven.be\share to IP
>>>>>>> which seems strange since I can ping the server name in question.
>>>>>> Check if your samba package have cifs.upcall program.
>>>>>> Then add into /etc/request-key.conf a line like this:
>>>>>>
>>>>>> create dns_resolver     *       *     /bla/bla/cifs.upcall %k
>>>>>>
>>>>>>
>>>>>>
>>>>>>> what does mount.cifs use for name resolution?
>>>>>>>
>>>>>>> werner
>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: Igor Mammedov [mailto:niallain at gmail.com]
>>>>>>>> Sent: donderdag 29 januari 2009 14:16
>>>>>>>> To: Werner Maes
>>>>>>>> Cc: 'linux-cifs-client at lists.samba.org'
>>>>>>>> Subject: Re: [linux-cifs-client] mount.cifs and dfs referrals
>>>>>>>>
>>>>>>>> At the present moment cifs is able to follow DFS links only
>>>> inside
>>>>>>>> mounted share.
>>>>>>>> You are attempting to mount share that itself is remote, and
>> cifs
>>>>>> can't
>>>>>>>> do it now.
>>>>>>>> However there is workaround, you can find out what server works
>>>> as a
>>>>>>>> real storage
>>>>>>>> for your share and mount it.
>>>>>>>>
>>>>>>>> Werner Maes wrote:
>>>>>>>>> hello
>>>>>>>>>
>>>>>>>>> I wanted to know whether mount.cifs is able to follow dfs
>>>>>> referrals.
>>>>>>>>> On my system I get a kernel failure if I try this
>>>>>>>>>
>>>>>>>>> mount.cifs //AD-DOMAIN/DFS /mnt -o username="AD\user"
>>>>>>>>>
>>>>>>>>> /mnt seems to be mounted
>>>>>>>>> //xx.yy.KULEUVEN.BE/xx/ on /mnt type cifs (rw,mand)
>>>>>>>>>
>>>>>>>>> but if I do ll /mnt, I get a segmentation fault and this
>> appears
>>>> in
>>>>>>>> dmesg (see below):
>>>>>>>>> so my question is: is mount.cifs able to follow dfs links like
>>>>>>>> smbclient can?
>>>>>>>>> kind regards
>>>>>>>>>
>>>>>>>>> werner
>>>>>>>>>
>>>>>>>>> kernel BUG at fs/cifs/cifs_dfs_ref.c:274!
>>>>>>>>> invalid opcode: 0000 [#1] SMP
>>>>>>>>> Modules linked in: nls_utf8 cifs fuse sunrpc ipv6 dm_multipath
>>>>>> uinput
>>>>>>>> ppdev floppy pcspkr i2c_piix4 pcnet32 mii parport_pc i2c_core
>>>>>> parport
>>>>>>>> BusLogic [last unloaded: microcode]
>>>>>>>>> Pid: 5110, comm: ls Not tainted (2.6.27.12-170.2.5.fc10.i686
>> #1)
>>>>>>>>> EIP: 0060:[<d09d6ef1>] EFLAGS: 00010246 CPU: 0
>>>>>>>>> EIP is at cifs_dfs_follow_mountpoint+0x3b/0x627 [cifs]
>>>>>>>>> EAX: c68ce7f8 EBX: c68ce7f8 ECX: d09ec7dc EDX: cfb85f38
>>>>>>>>> ESI: cfb85f38 EDI: ce5d3000 EBP: cfb85e88 ESP: cfb85e3c
>>>>>>>>>  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
>>>>>>>>> Process ls (pid: 5110, ti=cfb85000 task=c1613340
>>>> task.ti=cfb85000)
>>>>>>>>> Stack: cfb85e58 cfb85f38 cf84af68 cf84af00 ce5d3000 cfb85e70
>>>>>> c04a4a55
>>>>>>>> c06a9411
>>>>>>>>>        cf0565d8 cfb85edc cfb85f38 cfb85edc ce5d3000 cfb85e78
>>>>>> 00000000
>>>>>>>> 00000000
>>>>>>>>>        00000000 cfb85f38 ce5d3000 cfb85eb4 c049941c cfb85edc
>>>>>> cfb85edc
>>>>>>>> c68ce7f8
>>>>>>>>> Call Trace:
>>>>>>>>>  [<c04a4a55>] ? mntput_no_expire+0x1a/0xf7
>>>>>>>>>  [<c06a9411>] ? _spin_lock+0x8/0xb
>>>>>>>>>  [<c049941c>] ? do_follow_link+0xdb/0x272
>>>>>>>>>  [<c0499110>] ? __link_path_walk+0x5b2/0x6b5
>>>>>>>>>  [<c04995ff>] ? path_walk+0x4c/0x9b
>>>>>>>>>  [<c04997fb>] ? do_path_lookup+0x12d/0x175
>>>>>>>>>  [<c049a8fa>] ? user_path_at+0x3c/0x62
>>>>>>>>>  [<c04a4a55>] ? mntput_no_expire+0x1a/0xf7
>>>>>>>>>  [<c0497986>] ? mntput+0x13/0x15
>>>>>>>>>  [<c04a9021>] ? sys_getxattr+0x1e/0x49
>>>>>>>>>  [<c051edbc>] ? trace_hardirqs_on_thunk+0xc/0x10
>>>>>>>>>  [<c0403c6e>] ? syscall_call+0x7/0xb
>>>>>>>>>  =======================
>>>>>>>>> Code: d0 01 89 55 b8 c7 45 f0 00 00 00 00 c7 45 ec 00 00 00 00
>>>> 74
>>>>>> 11
>>>>>>>> 68 94 a6 9d d0 68 2f 64 9e d0 e8 82 08 cd ef 59 5e 3b 5b 18 75
>> 04
>>>>>> <0f>
>>>>>>>> 0b eb fe e8 20 7c ff ff f6 05 00 da 9e d0 01 89 45 bc 74 21
>>>>>>>>> EIP: [<d09d6ef1>] cifs_dfs_follow_mountpoint+0x3b/0x627 [cifs]
>>>>>> SS:ESP
>>>>>>>> 0068:cfb85e3c
>>>>>>>>> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> linux-cifs-client mailing list
>>>>>>>>> linux-cifs-client at lists.samba.org
>>>>>>>>> https://lists.samba.org/mailman/listinfo/linux-cifs-client
>>>>>>>> --
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>>
>>>>>>>> -------------------------
>>>>>>>> Igor Mammedov,
>>>>>>>> niallain "at" gmail.com
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>>>>>>>
>>>>>> --
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> -------------------------
>>>>>> Igor Mammedov,
>>>>>> niallain "at" gmail.com
>>>>>>
>>>>>>
>>>>>>
>>>>> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>>>>>
>>>>>
>>> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>>>
>> --
>>
>> Best regards,
>>
>> -------------------------
>> Igor Mammedov,
>> niallain "at" gmail.com
>>
>>
>>
> 
> 
> 
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

-- 

Best regards,

-------------------------
Igor Mammedov,
niallain "at" gmail.com






More information about the linux-cifs-client mailing list