aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8b341a8599f8..e93da7ad9002 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -85,6 +85,7 @@ struct smb_vol {
85 unsigned direct_io:1; 85 unsigned direct_io:1;
86 unsigned remap:1; /* set to remap seven reserved chars in filenames */ 86 unsigned remap:1; /* set to remap seven reserved chars in filenames */
87 unsigned posix_paths:1; /* unset to not ask for posix pathnames. */ 87 unsigned posix_paths:1; /* unset to not ask for posix pathnames. */
88 unsigned no_linux_ext:1;
88 unsigned sfu_emul:1; 89 unsigned sfu_emul:1;
89 unsigned nullauth:1; /* attempt to authenticate with null user */ 90 unsigned nullauth:1; /* attempt to authenticate with null user */
90 unsigned nocase; /* request case insensitive filenames */ 91 unsigned nocase; /* request case insensitive filenames */
@@ -1192,6 +1193,10 @@ cifs_parse_mount_options(char *options, const char *devname,
1192 vol->posix_paths = 1; 1193 vol->posix_paths = 1;
1193 } else if (strnicmp(data, "noposixpaths", 12) == 0) { 1194 } else if (strnicmp(data, "noposixpaths", 12) == 0) {
1194 vol->posix_paths = 0; 1195 vol->posix_paths = 0;
1196 } else if (strnicmp(data, "nounix", 6) == 0) {
1197 vol->no_linux_ext = 1;
1198 } else if (strnicmp(data, "nolinux", 7) == 0) {
1199 vol->no_linux_ext = 1;
1195 } else if ((strnicmp(data, "nocase", 6) == 0) || 1200 } else if ((strnicmp(data, "nocase", 6) == 0) ||
1196 (strnicmp(data, "ignorecase", 10) == 0)) { 1201 (strnicmp(data, "ignorecase", 10) == 0)) {
1197 vol->nocase = 1; 1202 vol->nocase = 1;
@@ -1665,6 +1670,18 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
1665 * and once without posixacls or posix paths? */ 1670 * and once without posixacls or posix paths? */
1666 __u64 saved_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); 1671 __u64 saved_cap = le64_to_cpu(tcon->fsUnixInfo.Capability);
1667 1672
1673 if (vol_info && vol_info->no_linux_ext) {
1674 tcon->fsUnixInfo.Capability = 0;
1675 tcon->unix_ext = 0; /* Unix Extensions disabled */
1676 cFYI(1, ("Linux protocol extensions disabled"));
1677 return;
1678 } else if (vol_info)
1679 tcon->unix_ext = 1; /* Unix Extensions supported */
1680
1681 if (tcon->unix_ext == 0) {
1682 cFYI(1, ("Unix extensions disabled so not set on reconnect"));
1683 return;
1684 }
1668 1685
1669 if (!CIFSSMBQFSUnixInfo(xid, tcon)) { 1686 if (!CIFSSMBQFSUnixInfo(xid, tcon)) {
1670 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); 1687 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability);
@@ -1678,10 +1695,6 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
1678 cap &= ~CIFS_UNIX_POSIX_ACL_CAP; 1695 cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
1679 if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) 1696 if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0)
1680 cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP; 1697 cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP;
1681
1682
1683
1684
1685 } 1698 }
1686 1699
1687 cap &= CIFS_UNIX_CAP_MASK; 1700 cap &= CIFS_UNIX_CAP_MASK;
@@ -2176,13 +2189,17 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2176 2189
2177 /* tell server which Unix caps we support */ 2190 /* tell server which Unix caps we support */
2178 if (tcon->ses->capabilities & CAP_UNIX) 2191 if (tcon->ses->capabilities & CAP_UNIX)
2192 /* reset of caps checks mount to see if unix extensions
2193 disabled for just this mount */
2179 reset_cifs_unix_caps(xid, tcon, sb, &volume_info); 2194 reset_cifs_unix_caps(xid, tcon, sb, &volume_info);
2180 else if (cifs_sb->rsize > (1024 * 127)) { 2195 else
2196 tcon->unix_ext = 0; /* server does not support them */
2197
2198 if ((tcon->unix_ext == 0) && (cifs_sb->rsize > (1024 * 127))) {
2181 cifs_sb->rsize = 1024 * 127; 2199 cifs_sb->rsize = 1024 * 127;
2182#ifdef CONFIG_CIFS_DEBUG2 2200#ifdef CONFIG_CIFS_DEBUG2
2183 cFYI(1, ("no very large read support, rsize 127K")); 2201 cFYI(1, ("no very large read support, rsize now 127K"));
2184#endif 2202#endif
2185
2186 } 2203 }
2187 if (!(tcon->ses->capabilities & CAP_LARGE_WRITE_X)) 2204 if (!(tcon->ses->capabilities & CAP_LARGE_WRITE_X))
2188 cifs_sb->wsize = min(cifs_sb->wsize, 2205 cifs_sb->wsize = min(cifs_sb->wsize,