cifs: document and cleanup dfs mount
authorPaulo Alcantara <pc@cjr.nz>
Tue, 21 Jul 2020 12:36:44 +0000 (09:36 -0300)
committerSteve French <stfrench@microsoft.com>
Sun, 2 Aug 2020 23:00:26 +0000 (18:00 -0500)
commit7efd081582619e7c270d1c0a422385dcaa99fa9f
treed082b1ad3471ab55508ff7428ba145c00378f553
parent11375a59a99ca05086a1837c27d79e92dd8d4aed
cifs: document and cleanup dfs mount

cifs_mount() for DFS mounts is for a long time way too complex to
follow, mostly because it lacks some documentation, does a lot of
operations like resolving DFS roots and links, checking for path
components, perform failover, crap code, etc.

Besides adding some documentation to it, do some cleanup and ensure
that the following is implemented and supported:

    * non-DFS mounts
    * DFS failover
    * DFS root mounts
        - tcon and cifs_sb must contain DFS path (NOT including prefix)
        - if prefix path, then save it in cifs_sb and it must not be
  changed
    * DFS link mounts
      - tcon and cifs_sb must contain DFS path (including prefix)
      - if prefix path, then save it in cifs_sb and it may be changed
    * prevent recursion on broken link referrals (MAX_NESTED_LINKS)
    * check every path component of the currently resolved
      target (including prefix), and chase them accordingly
    * make sure that DFS referrals go through newly resolved root
      servers

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c