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

Igor Mammedov niallain at gmail.com
Mon Feb 2 12:51:35 GMT 2009


Shirish Pargaonkar wrote:
> On Mon, Feb 2, 2009 at 3:38 AM, Igor Mammedov <niallain at gmail.com> wrote:
>> Werner Maes wrote:
>>>> -----Original Message-----
>>>> From: Igor Mammedov [mailto:niallain at gmail.com]
>>>> Sent: vrijdag 30 januari 2009 13:45
>>>> To: Werner Maes
>>>> Cc: linux-cifs-client at lists.samba.org
>>>> Subject: Re: [linux-cifs-client] mount.cifs and dfs referrals
>>>>
>>>> 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.
>>> thank you for your answer !
>>> will the future code support something like that?
>>>
>>> kind regards
>>>
>>> werner
>>>
>> It will be supported someday.
>> I sorry but, I've no spare time for it in the near future.
>>
>>
>> --
>>
>> Best regards,
>>
>> -------------------------
>> Igor Mammedov,
>> niallain "at" gmail.com
>>
>>
>>
>>
>> _______________________________________________
>> linux-cifs-client mailing list
>> linux-cifs-client at lists.samba.org
>> https://lists.samba.org/mailman/listinfo/linux-cifs-client
>>
> 
> Igor,
> 
> I would love to work on this bug but I do not know how to recreate it.
> I can't mount a share using domain name in the UNC like Werner does.

Actually there where to problems on this thread.

1. Mounting remote dfs root. 
   1.1 The server that responds PATH_UNCOVERED on mount attempt.
       Mount returns with -EREMOTE. Often happens when attempting mount
       by domain name.
   1.2 Mounting with remote prefixpath. In this case tree connect is successful,
       but root inode lookup lead us to cifs_dfs_follow_mountpoint and assert
       "kernel BUG at fs/cifs/cifs_dfs_ref.c:274!".
       If you comment out this line then you'll be able to mount/use share but
       won't be able to unmount it anymore.

Problem 1 is almost solved, I just need some time to cleanup patches I've written.


2. Server returns referrals without any server holding storage.
   Todays implementation is a list scan in
   cifs_dfs_follow_mountpoint starting at cifs_dfs_ref.c:346
   attempting to mount any referral that has flag DFSREF_STORAGE_SERVER.

   Server may respond with referrals without flag DFSREF_STORAGE_SERVER set.
   That just tells us that a server in a referral may know the storage server name
   and we shall ask it for referrals instead of attempting to mount.
   Example:
       SRV1 returns 2 referrals SRV2 and SRV5 without DFSREF_STORAGE_SERVER flag set.
       Client should go down the tree and ask each server till it get referral with 
       DFSREF_STORAGE_SERVER flag set.

               SRV1
	      /   \
           SRV2   SRV5
           /         \    
        SRV3        SRV4
                       \
                    STORAGE
                 

   So essentially we need to implement a tree walk with a detection of 
   possible loops in case of misconfiguration to avoid infinite loop in kernel.


> 
> Regards,
> 
> Shirish

-- 

Best regards,

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






More information about the linux-cifs-client mailing list