Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11b6d645 authored by Igor Mammedov's avatar Igor Mammedov Committed by Steve French
Browse files

[CIFS] Only convert / when server does not support posix paths



Also add warning if posix path setting changes on reconnect

Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 8aad018b
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -1722,8 +1722,15 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
			   originally at mount time */
			if ((saved_cap & CIFS_UNIX_POSIX_ACL_CAP) == 0)
				cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
			if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0)
			if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) {
				if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP)
					cERROR(1, ("POSIXPATH support change"));
				cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP;
			} else if ((cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) {
				cERROR(1, ("possible reconnect error"));
				cERROR(1,
					("server disabled POSIX path support"));
			}
		}

		cap &= CIFS_UNIX_CAP_MASK;
@@ -2243,7 +2250,9 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
			tcon->unix_ext = 0; /* server does not support them */

		/* convert forward to back slashes in prepath here if needed */
		convert_delimiter(cifs_sb->prepath, CIFS_DIR_SEP(cifs_sb));
		if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) == 0)
			convert_delimiter(cifs_sb->prepath,
					  CIFS_DIR_SEP(cifs_sb));

		if ((tcon->unix_ext == 0) && (cifs_sb->rsize > (1024 * 127))) {
			cifs_sb->rsize = 1024 * 127;