Skip to content

Commit

Permalink
cifs: Unset CIFS_MOUNT_POSIX_PATHS flag when following dfs mounts
Browse files Browse the repository at this point in the history
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 <sprabhu@redhat.com>
Acked-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Steve French <steve.french@primarydata.com>
  • Loading branch information
Sachin Prabhu authored and Steve French committed Jun 29, 2015
1 parent ebb3a9d commit 1dfd18d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3472,6 +3472,8 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
else if (ses)
cifs_put_smb_ses(ses);

cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_POSIX_PATHS;

free_xid(xid);
}
#endif
Expand Down

0 comments on commit 1dfd18d

Please sign in to comment.