aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-03-01 22:24:57 -0500
committerSteve French <sfrench@us.ibm.com>2006-03-01 22:24:57 -0500
commit82940a465829b0c757dea45889aa150c8083e3d9 (patch)
tree3ef3b38f47d93f07b6b5ebc51a54f301f62ec11a /fs/cifs
parent46c79a645a00e71dbbfd5f52abe0ea7cf2d5daa3 (diff)
[CIFS] Make POSIX CIFS Extensions SetFSInfo match exactly what we want
not just the posix path feature. Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/README7
-rw-r--r--fs/cifs/cifspdu.h8
-rw-r--r--fs/cifs/connect.c37
-rw-r--r--fs/cifs/file.c8
4 files changed, 42 insertions, 18 deletions
diff --git a/fs/cifs/README b/fs/cifs/README
index b0070d1b149d..b2b4d0803761 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -422,6 +422,13 @@ A partial list of the supported mount options follows:
422 nomapchars Do not translate any of these seven characters (default). 422 nomapchars Do not translate any of these seven characters (default).
423 nocase Request case insensitive path name matching (case 423 nocase Request case insensitive path name matching (case
424 sensitive is the default if the server suports it). 424 sensitive is the default if the server suports it).
425 posixpaths If CIFS Unix extensions are supported, attempt to
426 negotiate posix path name support which allows certain
427 characters forbidden in typical CIFS filenames, without
428 requiring remapping. (default)
429 noposixpaths If CIFS Unix extensions are supported, do not request
430 posix path name support (this may cause servers to
431 reject creatingfile with certain reserved characters).
425 nobrl Do not send byte range lock requests to the server. 432 nobrl Do not send byte range lock requests to the server.
426 This is necessary for certain applications that break 433 This is necessary for certain applications that break
427 with cifs style mandatory byte range locks (and most 434 with cifs style mandatory byte range locks (and most
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index b75866115c21..b2233ac05bd2 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -1789,7 +1789,13 @@ typedef struct {
1789#define CIFS_UNIX_POSIX_ACL_CAP 0x00000002 /* support getfacl/setfacl */ 1789#define CIFS_UNIX_POSIX_ACL_CAP 0x00000002 /* support getfacl/setfacl */
1790#define CIFS_UNIX_XATTR_CAP 0x00000004 /* support new namespace */ 1790#define CIFS_UNIX_XATTR_CAP 0x00000004 /* support new namespace */
1791#define CIFS_UNIX_EXTATTR_CAP 0x00000008 /* support chattr/chflag */ 1791#define CIFS_UNIX_EXTATTR_CAP 0x00000008 /* support chattr/chflag */
1792#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x00000010 /* Use POSIX pathnames on the wire. */ 1792#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x00000010 /* Allow POSIX path chars */
1793#ifdef CONFIG_CIFS_POSIX
1794#define CIFS_UNIX_CAP_MASK 0x0000001b
1795#else
1796#define CIFS_UNIX_CAP_MASK 0x00000013
1797#endif /* CONFIG_CIFS_POSIX */
1798
1793 1799
1794#define CIFS_POSIX_EXTENSIONS 0x00000010 /* support for new QFSInfo */ 1800#define CIFS_POSIX_EXTENSIONS 0x00000010 /* support for new QFSInfo */
1795 1801
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index cf4bcf3a45e6..b8f1baabd343 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1920,27 +1920,34 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1920 cifs_sb->tcon = tcon; 1920 cifs_sb->tcon = tcon;
1921 tcon->ses = pSesInfo; 1921 tcon->ses = pSesInfo;
1922 1922
1923 /* do not care if following two calls succeed - informational only */ 1923 /* do not care if following two calls succeed - informational */
1924 CIFSSMBQFSDeviceInfo(xid, tcon); 1924 CIFSSMBQFSDeviceInfo(xid, tcon);
1925 CIFSSMBQFSAttributeInfo(xid, tcon); 1925 CIFSSMBQFSAttributeInfo(xid, tcon);
1926
1926 if (tcon->ses->capabilities & CAP_UNIX) { 1927 if (tcon->ses->capabilities & CAP_UNIX) {
1927 if(!CIFSSMBQFSUnixInfo(xid, tcon)) { 1928 if(!CIFSSMBQFSUnixInfo(xid, tcon)) {
1928 if(!volume_info.no_psx_acl) { 1929 __u64 cap =
1929 if(CIFS_UNIX_POSIX_ACL_CAP & 1930 le64_to_cpu(tcon->fsUnixInfo.Capability);
1930 le64_to_cpu(tcon->fsUnixInfo.Capability)) 1931 cap &= CIFS_UNIX_CAP_MASK;
1931 cFYI(1,("server negotiated posix acl support")); 1932 if(volume_info.no_psx_acl)
1932 sb->s_flags |= MS_POSIXACL; 1933 cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
1934 else if(CIFS_UNIX_POSIX_ACL_CAP & cap) {
1935 cFYI(1,("negotiated posix acl support"));
1936 sb->s_flags |= MS_POSIXACL;
1933 } 1937 }
1934 1938
1935 /* Try and negotiate POSIX pathnames if we can. */ 1939 if(volume_info.posix_paths == 0)
1936 if (volume_info.posix_paths && (CIFS_UNIX_POSIX_PATHNAMES_CAP & 1940 cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP;
1937 le64_to_cpu(tcon->fsUnixInfo.Capability))) { 1941 else if(cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
1938 if (!CIFSSMBSetFSUnixInfo(xid, tcon, CIFS_UNIX_POSIX_PATHNAMES_CAP)) { 1942 cFYI(1,("negotiate posix pathnames"));
1939 cFYI(1,("negotiated posix pathnames support")); 1943 cifs_sb->mnt_cifs_flags |=
1940 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS; 1944 CIFS_MOUNT_POSIX_PATHS;
1941 } else { 1945 }
1942 cFYI(1,("posix pathnames support requested but not supported")); 1946
1943 } 1947 cFYI(1,("Negotiate caps 0x%x",(int)cap));
1948
1949 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) {
1950 cFYI(1,("setting capabilities failed"));
1944 } 1951 }
1945 } 1952 }
1946 } 1953 }
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index bd135c4e4958..71a30fd76aa8 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -649,7 +649,9 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
649 wire */ 649 wire */
650 if (IS_GETLK(cmd)) { 650 if (IS_GETLK(cmd)) {
651 if(experimEnabled && 651 if(experimEnabled &&
652 (cifs_sb->tcon->ses->capabilities & CAP_UNIX)) { 652 (cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
653 (CIFS_UNIX_FCNTL_CAP &
654 le64_to_cpu(cifs_sb->tcon->fsUnixInfo.Capability))) {
653 int posix_lock_type; 655 int posix_lock_type;
654 if(lockType & LOCKING_ANDX_SHARED_LOCK) 656 if(lockType & LOCKING_ANDX_SHARED_LOCK)
655 posix_lock_type = CIFS_RDLCK; 657 posix_lock_type = CIFS_RDLCK;
@@ -686,7 +688,9 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
686 return rc; 688 return rc;
687 } 689 }
688 if (experimEnabled && 690 if (experimEnabled &&
689 (cifs_sb->tcon->ses->capabilities & CAP_UNIX)) { 691 (cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
692 (CIFS_UNIX_FCNTL_CAP &
693 le64_to_cpu(cifs_sb->tcon->fsUnixInfo.Capability))) {
690 int posix_lock_type; 694 int posix_lock_type;
691 if(lockType & LOCKING_ANDX_SHARED_LOCK) 695 if(lockType & LOCKING_ANDX_SHARED_LOCK)
692 posix_lock_type = CIFS_RDLCK; 696 posix_lock_type = CIFS_RDLCK;