From: Sachin Prabhu Date: Tue, 16 Jun 2015 15:36:17 +0000 (+0100) Subject: cifs: Unset CIFS_MOUNT_POSIX_PATHS flag when following dfs mounts X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~6347^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=1dfd18d0571231d030f325bfcd80f5c42a56a53e;p=mirror_ubuntu-zesty-kernel.git cifs: Unset CIFS_MOUNT_POSIX_PATHS flag when following dfs mounts In a dfs setup where the client transitions from a server which supports posix paths to a server which doesn't support posix paths, the flag CIFS_MOUNT_POSIX_PATHS is not reset. This leads to the wrong directory separator being used causing smb commands to fail. Consider the following case where a dfs share on a samba server points to a share on windows smb server. # mount -t cifs -o .. //vm140-31/dfsroot/testwin/ # ls -l /mnt; touch /mnt/a total 0 touch: cannot touch ‘/mnt/a’: No such file or directory Signed-off-by: Sachin Prabhu Acked-by: Jeff Layton Signed-off-by: Steve French --- diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 247f4dd228cc..773f4dc77630 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3472,6 +3472,8 @@ try_mount_again: else if (ses) cifs_put_smb_ses(ses); + cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_POSIX_PATHS; + free_xid(xid); } #endif