• Paulo Alcantara's avatar
    cifs: support nested dfs links over reconnect · c88f7dcd
    Paulo Alcantara authored
    Mounting a dfs link that has nested links was already supported at
    mount(2), so make it work over reconnect as well.
    
    Make the following case work:
    
    * mount //root/dfs/link /mnt -o ...
      - final share: /server/share
    
    * in server settings
      - change target folder of /root/dfs/link3 to /server/share2
      - change target folder of /root/dfs/link2 to /root/dfs/link3
      - change target folder of /root/dfs/link to /root/dfs/link2
    
    * mount -o remount,... /mnt
     - refresh all dfs referrals
     - mark current connection for failover
     - cifs_reconnect() reconnects to root server
     - tree_connect()
       * checks that /root/dfs/link2 is a link, then chase it
       * checks that root/dfs/link3 is a link, then chase it
       * finally tree connect to /server/share2
    
    If the mounted share is no longer accessible and a reconnect had been
    triggered, the client will retry it from both last referral
    path (/root/dfs/link3) and original referral path (/root/dfs/link).
    
    Any new referral paths found while chasing dfs links over reconnect,
    it will be updated to TCP_Server_Info::leaf_fullpath, accordingly.
    Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    c88f7dcd
smb2ops.c 164 KB