]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: only update prefix path of DFS links in cifs_tree_connect()
authorPaulo Alcantara <pc@cjr.nz>
Tue, 21 Jul 2020 12:36:43 +0000 (09:36 -0300)
committerSteve French <stfrench@microsoft.com>
Sun, 2 Aug 2020 23:00:26 +0000 (18:00 -0500)
commita0733da15d96014c157c23f3728c0e5a9ed49bc6
tree4dd2c0b34fb7d2cd063f2dc1da11d490c15e415c
parentd84f54c42adc241a7a0daf1e66e79559f61d09a6
cifs: only update prefix path of DFS links in cifs_tree_connect()

For DFS root mounts that contain a prefix path, do not change them
after failover.

E.g., if the user mounts

//srvA/root/dir1

and then lost connection to srvA, it will reconnect to

//srvB/root/dir1

In case of DFS links, which may resolve to different prefix paths
depending on their list of targets, the following must be supported:

- mount //srvA/root/link/bar
- connect to //srvA/share
- set prefix path to "bar"
- lost connection to srvA
- reconnect to next target: //srvB/share/foo
- set new prefix path to "foo/bar"

In cifs_tree_connect(), check the server_type field of the cached DFS
referral to determine whether or not prefix path should be updated.

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