aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2014-09-27 03:19:01 -0400
committerSteve French <smfrench@gmail.com>2014-10-16 16:20:20 -0400
commit2baa2682531ff02928e2d3904800696d9e7193db (patch)
tree5da390e5e3d825b085481529205e5ca171ec9f38
parenta4153cb1d3cb7d7c16968b0a9cf7c8aacf31424e (diff)
Remap reserved posix characters by default (part 3/3)
This is a bigger patch, but its size is mostly due to a single change for how we check for remapping illegal characters in file names - a lot of repeated, small changes to the way callers request converting file names. The final patch in the series does the following: 1) changes default behavior for cifs to be more intuitive. Currently we do not map by default to seven reserved characters, ie those valid in POSIX but not in NTFS/CIFS/SMB3/Windows, unless a mount option (mapchars) is specified. Change this to by default always map and map using the SFM maping (like the Mac uses) unless the server negotiates the CIFS Unix Extensions (like Samba does when mounting with the cifs protocol) when the remapping of the characters is unnecessary. This should help SMB3 mounts in particular since Samba will likely be able to implement this mapping with its new "vfs_fruit" module as it will be doing for the Mac. 2) if the user specifies the existing "mapchars" mount option then use the "SFU" (Microsoft Services for Unix, SUA) style mapping of the seven characters instead. 3) if the user specifies "nomapposix" then disable SFM/MAC style mapping (so no character remapping would be used unless the user specifies "mapchars" on mount as well, as above). 4) change all the places in the code that check for the superblock flag on the mount which is set by mapchars and passed in on all path based operation and change it to use a small function call instead to set the mapping type properly (and check for the mapping type in the cifs unicode functions) Signed-off-by: Steve French <smfrench@gmail.com>
-rw-r--r--fs/cifs/cifs_unicode.c15
-rw-r--r--fs/cifs/cifs_unicode.h1
-rw-r--r--fs/cifs/cifsglob.h2
-rw-r--r--fs/cifs/cifssmb.c16
-rw-r--r--fs/cifs/connect.c30
-rw-r--r--fs/cifs/inode.c29
-rw-r--r--fs/cifs/link.c4
-rw-r--r--fs/cifs/readdir.c10
-rw-r--r--fs/cifs/smb1ops.c25
-rw-r--r--fs/cifs/smbencrypt.c1
-rw-r--r--fs/cifs/xattr.c32
11 files changed, 88 insertions, 77 deletions
diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
index 0aa2c5c2cfe2..0303c6793d90 100644
--- a/fs/cifs/cifs_unicode.c
+++ b/fs/cifs/cifs_unicode.c
@@ -20,6 +20,7 @@
20 */ 20 */
21#include <linux/fs.h> 21#include <linux/fs.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include "cifs_fs_sb.h"
23#include "cifs_unicode.h" 24#include "cifs_unicode.h"
24#include "cifs_uniupr.h" 25#include "cifs_uniupr.h"
25#include "cifspdu.h" 26#include "cifspdu.h"
@@ -61,6 +62,20 @@ cifs_utf16_bytes(const __le16 *from, int maxbytes,
61 return outlen; 62 return outlen;
62} 63}
63 64
65int cifs_remap(struct cifs_sb_info *cifs_sb)
66{
67 int map_type;
68
69 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SFM_CHR)
70 map_type = SFM_MAP_UNI_RSVD;
71 else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR)
72 map_type = SFU_MAP_UNI_RSVD;
73 else
74 map_type = NO_MAP_UNI_RSVD;
75
76 return map_type;
77}
78
64/* Convert character using the SFU - "Services for Unix" remapping range */ 79/* Convert character using the SFU - "Services for Unix" remapping range */
65static bool 80static bool
66convert_sfu_char(const __u16 src_char, char *target) 81convert_sfu_char(const __u16 src_char, char *target)
diff --git a/fs/cifs/cifs_unicode.h b/fs/cifs/cifs_unicode.h
index 30af32b55a94..bdc52cb9a676 100644
--- a/fs/cifs/cifs_unicode.h
+++ b/fs/cifs/cifs_unicode.h
@@ -112,6 +112,7 @@ char *cifs_strndup_from_utf16(const char *src, const int maxlen,
112 const struct nls_table *codepage); 112 const struct nls_table *codepage);
113extern int cifsConvertToUTF16(__le16 *target, const char *source, int maxlen, 113extern int cifsConvertToUTF16(__le16 *target, const char *source, int maxlen,
114 const struct nls_table *cp, int mapChars); 114 const struct nls_table *cp, int mapChars);
115extern int cifs_remap(struct cifs_sb_info *cifs_sb);
115#ifdef CONFIG_CIFS_SMB2 116#ifdef CONFIG_CIFS_SMB2
116extern __le16 *cifs_strndup_to_utf16(const char *src, const int maxlen, 117extern __le16 *cifs_strndup_to_utf16(const char *src, const int maxlen,
117 int *utf16_len, const struct nls_table *cp, 118 int *utf16_len, const struct nls_table *cp,
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index dae7e3709cc6..02a33e529904 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -466,6 +466,7 @@ struct smb_vol {
466 bool direct_io:1; 466 bool direct_io:1;
467 bool strict_io:1; /* strict cache behavior */ 467 bool strict_io:1; /* strict cache behavior */
468 bool remap:1; /* set to remap seven reserved chars in filenames */ 468 bool remap:1; /* set to remap seven reserved chars in filenames */
469 bool sfu_remap:1; /* remap seven reserved chars ala SFU */
469 bool posix_paths:1; /* unset to not ask for posix pathnames. */ 470 bool posix_paths:1; /* unset to not ask for posix pathnames. */
470 bool no_linux_ext:1; 471 bool no_linux_ext:1;
471 bool sfu_emul:1; 472 bool sfu_emul:1;
@@ -499,6 +500,7 @@ struct smb_vol {
499#define CIFS_MOUNT_MASK (CIFS_MOUNT_NO_PERM | CIFS_MOUNT_SET_UID | \ 500#define CIFS_MOUNT_MASK (CIFS_MOUNT_NO_PERM | CIFS_MOUNT_SET_UID | \
500 CIFS_MOUNT_SERVER_INUM | CIFS_MOUNT_DIRECT_IO | \ 501 CIFS_MOUNT_SERVER_INUM | CIFS_MOUNT_DIRECT_IO | \
501 CIFS_MOUNT_NO_XATTR | CIFS_MOUNT_MAP_SPECIAL_CHR | \ 502 CIFS_MOUNT_NO_XATTR | CIFS_MOUNT_MAP_SPECIAL_CHR | \
503 CIFS_MOUNT_MAP_SFM_CHR | \
502 CIFS_MOUNT_UNX_EMUL | CIFS_MOUNT_NO_BRL | \ 504 CIFS_MOUNT_UNX_EMUL | CIFS_MOUNT_NO_BRL | \
503 CIFS_MOUNT_CIFS_ACL | CIFS_MOUNT_OVERR_UID | \ 505 CIFS_MOUNT_CIFS_ACL | CIFS_MOUNT_OVERR_UID | \
504 CIFS_MOUNT_OVERR_GID | CIFS_MOUNT_DYNPERM | \ 506 CIFS_MOUNT_OVERR_GID | CIFS_MOUNT_DYNPERM | \
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 66f65001a6d8..61d00a6e398f 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -867,7 +867,7 @@ CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
867 int rc = 0; 867 int rc = 0;
868 int bytes_returned; 868 int bytes_returned;
869 int name_len; 869 int name_len;
870 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 870 int remap = cifs_remap(cifs_sb);
871 871
872DelFileRetry: 872DelFileRetry:
873 rc = smb_init(SMB_COM_DELETE, 1, tcon, (void **) &pSMB, 873 rc = smb_init(SMB_COM_DELETE, 1, tcon, (void **) &pSMB,
@@ -913,7 +913,7 @@ CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
913 int rc = 0; 913 int rc = 0;
914 int bytes_returned; 914 int bytes_returned;
915 int name_len; 915 int name_len;
916 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 916 int remap = cifs_remap(cifs_sb);
917 917
918 cifs_dbg(FYI, "In CIFSSMBRmDir\n"); 918 cifs_dbg(FYI, "In CIFSSMBRmDir\n");
919RmDirRetry: 919RmDirRetry:
@@ -958,7 +958,7 @@ CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
958 CREATE_DIRECTORY_RSP *pSMBr = NULL; 958 CREATE_DIRECTORY_RSP *pSMBr = NULL;
959 int bytes_returned; 959 int bytes_returned;
960 int name_len; 960 int name_len;
961 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 961 int remap = cifs_remap(cifs_sb);
962 962
963 cifs_dbg(FYI, "In CIFSSMBMkDir\n"); 963 cifs_dbg(FYI, "In CIFSSMBMkDir\n");
964MkDirRetry: 964MkDirRetry:
@@ -1280,7 +1280,7 @@ CIFS_open(const unsigned int xid, struct cifs_open_parms *oparms, int *oplock,
1280 __u16 count; 1280 __u16 count;
1281 struct cifs_sb_info *cifs_sb = oparms->cifs_sb; 1281 struct cifs_sb_info *cifs_sb = oparms->cifs_sb;
1282 struct cifs_tcon *tcon = oparms->tcon; 1282 struct cifs_tcon *tcon = oparms->tcon;
1283 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 1283 int remap = cifs_remap(cifs_sb);
1284 const struct nls_table *nls = cifs_sb->local_nls; 1284 const struct nls_table *nls = cifs_sb->local_nls;
1285 int create_options = oparms->create_options; 1285 int create_options = oparms->create_options;
1286 int desired_access = oparms->desired_access; 1286 int desired_access = oparms->desired_access;
@@ -2572,7 +2572,7 @@ CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
2572 int bytes_returned; 2572 int bytes_returned;
2573 int name_len, name_len2; 2573 int name_len, name_len2;
2574 __u16 count; 2574 __u16 count;
2575 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 2575 int remap = cifs_remap(cifs_sb);
2576 2576
2577 cifs_dbg(FYI, "In CIFSSMBRename\n"); 2577 cifs_dbg(FYI, "In CIFSSMBRename\n");
2578renameRetry: 2578renameRetry:
@@ -2968,7 +2968,7 @@ CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2968 int bytes_returned; 2968 int bytes_returned;
2969 int name_len, name_len2; 2969 int name_len, name_len2;
2970 __u16 count; 2970 __u16 count;
2971 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 2971 int remap = cifs_remap(cifs_sb);
2972 2972
2973 cifs_dbg(FYI, "In CIFSCreateHardLink\n"); 2973 cifs_dbg(FYI, "In CIFSCreateHardLink\n");
2974winCreateHardLinkRetry: 2974winCreateHardLinkRetry:
@@ -4367,7 +4367,7 @@ findFirstRetry:
4367 return rc; 4367 return rc;
4368 4368
4369 nls_codepage = cifs_sb->local_nls; 4369 nls_codepage = cifs_sb->local_nls;
4370 remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 4370 remap = cifs_remap(cifs_sb);
4371 4371
4372 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 4372 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
4373 name_len = 4373 name_len =
@@ -5527,7 +5527,7 @@ CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
5527 int name_len; 5527 int name_len;
5528 int rc = 0; 5528 int rc = 0;
5529 int bytes_returned = 0; 5529 int bytes_returned = 0;
5530 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 5530 int remap = cifs_remap(cifs_sb);
5531 5531
5532 __u16 params, byte_count, data_count, param_offset, offset; 5532 __u16 params, byte_count, data_count, param_offset, offset;
5533 5533
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index d8eb6a74b211..24fa08d261fb 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -70,6 +70,7 @@ enum {
70 Opt_forcegid, Opt_noforcegid, 70 Opt_forcegid, Opt_noforcegid,
71 Opt_noblocksend, Opt_noautotune, 71 Opt_noblocksend, Opt_noautotune,
72 Opt_hard, Opt_soft, Opt_perm, Opt_noperm, 72 Opt_hard, Opt_soft, Opt_perm, Opt_noperm,
73 Opt_mapposix, Opt_nomapposix,
73 Opt_mapchars, Opt_nomapchars, Opt_sfu, 74 Opt_mapchars, Opt_nomapchars, Opt_sfu,
74 Opt_nosfu, Opt_nodfs, Opt_posixpaths, 75 Opt_nosfu, Opt_nodfs, Opt_posixpaths,
75 Opt_noposixpaths, Opt_nounix, 76 Opt_noposixpaths, Opt_nounix,
@@ -124,8 +125,10 @@ static const match_table_t cifs_mount_option_tokens = {
124 { Opt_soft, "soft" }, 125 { Opt_soft, "soft" },
125 { Opt_perm, "perm" }, 126 { Opt_perm, "perm" },
126 { Opt_noperm, "noperm" }, 127 { Opt_noperm, "noperm" },
127 { Opt_mapchars, "mapchars" }, 128 { Opt_mapchars, "mapchars" }, /* SFU style */
128 { Opt_nomapchars, "nomapchars" }, 129 { Opt_nomapchars, "nomapchars" },
130 { Opt_mapposix, "mapposix" }, /* SFM style */
131 { Opt_nomapposix, "nomapposix" },
129 { Opt_sfu, "sfu" }, 132 { Opt_sfu, "sfu" },
130 { Opt_nosfu, "nosfu" }, 133 { Opt_nosfu, "nosfu" },
131 { Opt_nodfs, "nodfs" }, 134 { Opt_nodfs, "nodfs" },
@@ -1231,6 +1234,14 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1231 vol->linux_uid = current_uid(); 1234 vol->linux_uid = current_uid();
1232 vol->linux_gid = current_gid(); 1235 vol->linux_gid = current_gid();
1233 1236
1237 /*
1238 * default to SFM style remapping of seven reserved characters
1239 * unless user overrides it or we negotiate CIFS POSIX where
1240 * it is unnecessary. Can not simultaneously use more than one mapping
1241 * since then readdir could list files that open could not open
1242 */
1243 vol->remap = true;
1244
1234 /* default to only allowing write access to owner of the mount */ 1245 /* default to only allowing write access to owner of the mount */
1235 vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR; 1246 vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR;
1236 1247
@@ -1338,10 +1349,18 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1338 vol->noperm = 1; 1349 vol->noperm = 1;
1339 break; 1350 break;
1340 case Opt_mapchars: 1351 case Opt_mapchars:
1341 vol->remap = 1; 1352 vol->sfu_remap = true;
1353 vol->remap = false; /* disable SFM mapping */
1342 break; 1354 break;
1343 case Opt_nomapchars: 1355 case Opt_nomapchars:
1344 vol->remap = 0; 1356 vol->sfu_remap = false;
1357 break;
1358 case Opt_mapposix:
1359 vol->remap = true;
1360 vol->sfu_remap = false; /* disable SFU mapping */
1361 break;
1362 case Opt_nomapposix:
1363 vol->remap = false;
1345 break; 1364 break;
1346 case Opt_sfu: 1365 case Opt_sfu:
1347 vol->sfu_emul = 1; 1366 vol->sfu_emul = 1;
@@ -3197,6 +3216,8 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
3197 if (pvolume_info->server_ino) 3216 if (pvolume_info->server_ino)
3198 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_SERVER_INUM; 3217 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_SERVER_INUM;
3199 if (pvolume_info->remap) 3218 if (pvolume_info->remap)
3219 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SFM_CHR;
3220 if (pvolume_info->sfu_remap)
3200 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SPECIAL_CHR; 3221 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SPECIAL_CHR;
3201 if (pvolume_info->no_xattr) 3222 if (pvolume_info->no_xattr)
3202 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_XATTR; 3223 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_XATTR;
@@ -3340,8 +3361,7 @@ expand_dfs_referral(const unsigned int xid, struct cifs_ses *ses,
3340 ref_path = check_prefix ? full_path + 1 : volume_info->UNC + 1; 3361 ref_path = check_prefix ? full_path + 1 : volume_info->UNC + 1;
3341 3362
3342 rc = get_dfs_path(xid, ses, ref_path, cifs_sb->local_nls, 3363 rc = get_dfs_path(xid, ses, ref_path, cifs_sb->local_nls,
3343 &num_referrals, &referrals, 3364 &num_referrals, &referrals, cifs_remap(cifs_sb));
3344 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
3345 3365
3346 if (!rc && num_referrals > 0) { 3366 if (!rc && num_referrals > 0) {
3347 char *fake_devname = NULL; 3367 char *fake_devname = NULL;
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 4ff36ea8c693..c23bdec805c5 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -30,6 +30,7 @@
30#include "cifsproto.h" 30#include "cifsproto.h"
31#include "cifs_debug.h" 31#include "cifs_debug.h"
32#include "cifs_fs_sb.h" 32#include "cifs_fs_sb.h"
33#include "cifs_unicode.h"
33#include "fscache.h" 34#include "fscache.h"
34 35
35 36
@@ -546,7 +547,7 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
546 rc = tcon->ses->server->ops->query_all_EAs(xid, tcon, path, 547 rc = tcon->ses->server->ops->query_all_EAs(xid, tcon, path,
547 "SETFILEBITS", ea_value, 4 /* size of buf */, 548 "SETFILEBITS", ea_value, 4 /* size of buf */,
548 cifs_sb->local_nls, 549 cifs_sb->local_nls,
549 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 550 cifs_remap(cifs_sb));
550 cifs_put_tlink(tlink); 551 cifs_put_tlink(tlink);
551 if (rc < 0) 552 if (rc < 0)
552 return (int)rc; 553 return (int)rc;
@@ -1124,8 +1125,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
1124 /* rename the file */ 1125 /* rename the file */
1125 rc = CIFSSMBRenameOpenFile(xid, tcon, fid.netfid, NULL, 1126 rc = CIFSSMBRenameOpenFile(xid, tcon, fid.netfid, NULL,
1126 cifs_sb->local_nls, 1127 cifs_sb->local_nls,
1127 cifs_sb->mnt_cifs_flags & 1128 cifs_remap(cifs_sb));
1128 CIFS_MOUNT_MAP_SPECIAL_CHR);
1129 if (rc != 0) { 1129 if (rc != 0) {
1130 rc = -EBUSY; 1130 rc = -EBUSY;
1131 goto undo_setattr; 1131 goto undo_setattr;
@@ -1166,8 +1166,7 @@ out:
1166 */ 1166 */
1167undo_rename: 1167undo_rename:
1168 CIFSSMBRenameOpenFile(xid, tcon, fid.netfid, dentry->d_name.name, 1168 CIFSSMBRenameOpenFile(xid, tcon, fid.netfid, dentry->d_name.name,
1169 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 1169 cifs_sb->local_nls, cifs_remap(cifs_sb));
1170 CIFS_MOUNT_MAP_SPECIAL_CHR);
1171undo_setattr: 1170undo_setattr:
1172 if (dosattr != origattr) { 1171 if (dosattr != origattr) {
1173 info_buf->Attributes = cpu_to_le32(origattr); 1172 info_buf->Attributes = cpu_to_le32(origattr);
@@ -1233,7 +1232,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
1233 le64_to_cpu(tcon->fsUnixInfo.Capability))) { 1232 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
1234 rc = CIFSPOSIXDelFile(xid, tcon, full_path, 1233 rc = CIFSPOSIXDelFile(xid, tcon, full_path,
1235 SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls, 1234 SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls,
1236 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 1235 cifs_remap(cifs_sb));
1237 cifs_dbg(FYI, "posix del rc %d\n", rc); 1236 cifs_dbg(FYI, "posix del rc %d\n", rc);
1238 if ((rc == 0) || (rc == -ENOENT)) 1237 if ((rc == 0) || (rc == -ENOENT))
1239 goto psx_del_no_retry; 1238 goto psx_del_no_retry;
@@ -1356,8 +1355,7 @@ cifs_mkdir_qinfo(struct inode *parent, struct dentry *dentry, umode_t mode,
1356 } 1355 }
1357 CIFSSMBUnixSetPathInfo(xid, tcon, full_path, &args, 1356 CIFSSMBUnixSetPathInfo(xid, tcon, full_path, &args,
1358 cifs_sb->local_nls, 1357 cifs_sb->local_nls,
1359 cifs_sb->mnt_cifs_flags & 1358 cifs_remap(cifs_sb));
1360 CIFS_MOUNT_MAP_SPECIAL_CHR);
1361 } else { 1359 } else {
1362 struct TCP_Server_Info *server = tcon->ses->server; 1360 struct TCP_Server_Info *server = tcon->ses->server;
1363 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) && 1361 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) &&
@@ -1399,8 +1397,7 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode,
1399 mode &= ~current_umask(); 1397 mode &= ~current_umask();
1400 rc = CIFSPOSIXCreate(xid, tcon, SMB_O_DIRECTORY | SMB_O_CREAT, mode, 1398 rc = CIFSPOSIXCreate(xid, tcon, SMB_O_DIRECTORY | SMB_O_CREAT, mode,
1401 NULL /* netfid */, info, &oplock, full_path, 1399 NULL /* netfid */, info, &oplock, full_path,
1402 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 1400 cifs_sb->local_nls, cifs_remap(cifs_sb));
1403 CIFS_MOUNT_MAP_SPECIAL_CHR);
1404 if (rc == -EOPNOTSUPP) 1401 if (rc == -EOPNOTSUPP)
1405 goto posix_mkdir_out; 1402 goto posix_mkdir_out;
1406 else if (rc) { 1403 else if (rc) {
@@ -1624,8 +1621,7 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,
1624 if (rc == 0) { 1621 if (rc == 0) {
1625 rc = CIFSSMBRenameOpenFile(xid, tcon, fid.netfid, 1622 rc = CIFSSMBRenameOpenFile(xid, tcon, fid.netfid,
1626 (const char *) to_dentry->d_name.name, 1623 (const char *) to_dentry->d_name.name,
1627 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 1624 cifs_sb->local_nls, cifs_remap(cifs_sb));
1628 CIFS_MOUNT_MAP_SPECIAL_CHR);
1629 CIFSSMBClose(xid, tcon, fid.netfid); 1625 CIFSSMBClose(xid, tcon, fid.netfid);
1630 } 1626 }
1631do_rename_exit: 1627do_rename_exit:
@@ -1701,16 +1697,14 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
1701 tmprc = CIFSSMBUnixQPathInfo(xid, tcon, from_name, 1697 tmprc = CIFSSMBUnixQPathInfo(xid, tcon, from_name,
1702 info_buf_source, 1698 info_buf_source,
1703 cifs_sb->local_nls, 1699 cifs_sb->local_nls,
1704 cifs_sb->mnt_cifs_flags & 1700 cifs_remap(cifs_sb));
1705 CIFS_MOUNT_MAP_SPECIAL_CHR);
1706 if (tmprc != 0) 1701 if (tmprc != 0)
1707 goto unlink_target; 1702 goto unlink_target;
1708 1703
1709 tmprc = CIFSSMBUnixQPathInfo(xid, tcon, to_name, 1704 tmprc = CIFSSMBUnixQPathInfo(xid, tcon, to_name,
1710 info_buf_target, 1705 info_buf_target,
1711 cifs_sb->local_nls, 1706 cifs_sb->local_nls,
1712 cifs_sb->mnt_cifs_flags & 1707 cifs_remap(cifs_sb));
1713 CIFS_MOUNT_MAP_SPECIAL_CHR);
1714 1708
1715 if (tmprc == 0 && (info_buf_source->UniqueId == 1709 if (tmprc == 0 && (info_buf_source->UniqueId ==
1716 info_buf_target->UniqueId)) { 1710 info_buf_target->UniqueId)) {
@@ -2075,8 +2069,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
2075 rc = SMBLegacyOpen(xid, tcon, full_path, FILE_OPEN, 2069 rc = SMBLegacyOpen(xid, tcon, full_path, FILE_OPEN,
2076 GENERIC_WRITE, CREATE_NOT_DIR, &netfid, 2070 GENERIC_WRITE, CREATE_NOT_DIR, &netfid,
2077 &oplock, NULL, cifs_sb->local_nls, 2071 &oplock, NULL, cifs_sb->local_nls,
2078 cifs_sb->mnt_cifs_flags & 2072 cifs_remap(cifs_sb));
2079 CIFS_MOUNT_MAP_SPECIAL_CHR);
2080 if (rc == 0) { 2073 if (rc == 0) {
2081 unsigned int bytes_written; 2074 unsigned int bytes_written;
2082 2075
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index ce7d4bbf3120..190bf0eb71b0 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -28,6 +28,7 @@
28#include "cifsproto.h" 28#include "cifsproto.h"
29#include "cifs_debug.h" 29#include "cifs_debug.h"
30#include "cifs_fs_sb.h" 30#include "cifs_fs_sb.h"
31#include "cifs_unicode.h"
31#ifdef CONFIG_CIFS_SMB2 32#ifdef CONFIG_CIFS_SMB2
32#include "smb2proto.h" 33#include "smb2proto.h"
33#endif 34#endif
@@ -566,8 +567,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
566 if (tcon->unix_ext) 567 if (tcon->unix_ext)
567 rc = CIFSUnixCreateHardLink(xid, tcon, from_name, to_name, 568 rc = CIFSUnixCreateHardLink(xid, tcon, from_name, to_name,
568 cifs_sb->local_nls, 569 cifs_sb->local_nls,
569 cifs_sb->mnt_cifs_flags & 570 cifs_remap(cifs_sb));
570 CIFS_MOUNT_MAP_SPECIAL_CHR);
571 else { 571 else {
572 server = tcon->ses->server; 572 server = tcon->ses->server;
573 if (!server->ops->create_hardlink) { 573 if (!server->ops->create_hardlink) {
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 5bf3d0a746f8..8fd2a95860ba 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -239,7 +239,7 @@ int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb,
239 rc = CIFSSMBOpen(xid, ptcon, full_path, FILE_OPEN, GENERIC_READ, 239 rc = CIFSSMBOpen(xid, ptcon, full_path, FILE_OPEN, GENERIC_READ,
240 OPEN_REPARSE_POINT, &fid, &oplock, NULL, 240 OPEN_REPARSE_POINT, &fid, &oplock, NULL,
241 cifs_sb->local_nls, 241 cifs_sb->local_nls,
242 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 242 cifs_remap(cifs_sb);
243 if (!rc) { 243 if (!rc) {
244 tmpbuffer = kmalloc(maxpath); 244 tmpbuffer = kmalloc(maxpath);
245 rc = CIFSSMBQueryReparseLinkInfo(xid, ptcon, full_path, 245 rc = CIFSSMBQueryReparseLinkInfo(xid, ptcon, full_path,
@@ -706,13 +706,7 @@ static int cifs_filldir(char *find_entry, struct file *file,
706 struct nls_table *nlt = cifs_sb->local_nls; 706 struct nls_table *nlt = cifs_sb->local_nls;
707 int map_type; 707 int map_type;
708 708
709 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SFM_CHR) 709 map_type = cifs_remap(cifs_sb);
710 map_type = SFM_MAP_UNI_RSVD;
711 else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR)
712 map_type = SFU_MAP_UNI_RSVD;
713 else
714 map_type = NO_MAP_UNI_RSVD;
715
716 name.name = scratch_buf; 710 name.name = scratch_buf;
717 name.len = 711 name.len =
718 cifs_from_utf16((char *)name.name, (__le16 *)de.name, 712 cifs_from_utf16((char *)name.name, (__le16 *)de.name,
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 2aca620193cd..d2979036a4c7 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -23,6 +23,7 @@
23#include "cifsproto.h" 23#include "cifsproto.h"
24#include "cifs_debug.h" 24#include "cifs_debug.h"
25#include "cifspdu.h" 25#include "cifspdu.h"
26#include "cifs_unicode.h"
26 27
27/* 28/*
28 * An NT cancel request header looks just like the original request except: 29 * An NT cancel request header looks just like the original request except:
@@ -530,13 +531,11 @@ cifs_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
530 531
531 rc = CIFSSMBQPathInfo(xid, tcon, full_path, file_info, 532 rc = CIFSSMBQPathInfo(xid, tcon, full_path, file_info,
532 0 /* not legacy */, cifs_sb->local_nls, 533 0 /* not legacy */, cifs_sb->local_nls,
533 cifs_sb->mnt_cifs_flags & 534 cifs_remap(cifs_sb));
534 CIFS_MOUNT_MAP_SPECIAL_CHR);
535 535
536 if (rc == -EOPNOTSUPP || rc == -EINVAL) 536 if (rc == -EOPNOTSUPP || rc == -EINVAL)
537 rc = SMBQueryInformation(xid, tcon, full_path, file_info, 537 rc = SMBQueryInformation(xid, tcon, full_path, file_info,
538 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 538 cifs_sb->local_nls, cifs_remap(cifs_sb));
539 CIFS_MOUNT_MAP_SPECIAL_CHR);
540 kfree(file_info); 539 kfree(file_info);
541 return rc; 540 return rc;
542} 541}
@@ -552,8 +551,7 @@ cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
552 551
553 /* could do find first instead but this returns more info */ 552 /* could do find first instead but this returns more info */
554 rc = CIFSSMBQPathInfo(xid, tcon, full_path, data, 0 /* not legacy */, 553 rc = CIFSSMBQPathInfo(xid, tcon, full_path, data, 0 /* not legacy */,
555 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 554 cifs_sb->local_nls, cifs_remap(cifs_sb));
556 CIFS_MOUNT_MAP_SPECIAL_CHR);
557 /* 555 /*
558 * BB optimize code so we do not make the above call when server claims 556 * BB optimize code so we do not make the above call when server claims
559 * no NT SMB support and the above call failed at least once - set flag 557 * no NT SMB support and the above call failed at least once - set flag
@@ -562,8 +560,7 @@ cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
562 if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) { 560 if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) {
563 rc = SMBQueryInformation(xid, tcon, full_path, data, 561 rc = SMBQueryInformation(xid, tcon, full_path, data,
564 cifs_sb->local_nls, 562 cifs_sb->local_nls,
565 cifs_sb->mnt_cifs_flags & 563 cifs_remap(cifs_sb));
566 CIFS_MOUNT_MAP_SPECIAL_CHR);
567 *adjustTZ = true; 564 *adjustTZ = true;
568 } 565 }
569 566
@@ -611,8 +608,7 @@ cifs_get_srv_inum(const unsigned int xid, struct cifs_tcon *tcon,
611 */ 608 */
612 return CIFSGetSrvInodeNumber(xid, tcon, full_path, uniqueid, 609 return CIFSGetSrvInodeNumber(xid, tcon, full_path, uniqueid,
613 cifs_sb->local_nls, 610 cifs_sb->local_nls,
614 cifs_sb->mnt_cifs_flags & 611 cifs_remap(cifs_sb));
615 CIFS_MOUNT_MAP_SPECIAL_CHR);
616} 612}
617 613
618static int 614static int
@@ -703,8 +699,7 @@ cifs_mkdir_setinfo(struct inode *inode, const char *full_path,
703 dosattrs = cifsInode->cifsAttrs|ATTR_READONLY; 699 dosattrs = cifsInode->cifsAttrs|ATTR_READONLY;
704 info.Attributes = cpu_to_le32(dosattrs); 700 info.Attributes = cpu_to_le32(dosattrs);
705 rc = CIFSSMBSetPathInfo(xid, tcon, full_path, &info, cifs_sb->local_nls, 701 rc = CIFSSMBSetPathInfo(xid, tcon, full_path, &info, cifs_sb->local_nls,
706 cifs_sb->mnt_cifs_flags & 702 cifs_remap(cifs_sb));
707 CIFS_MOUNT_MAP_SPECIAL_CHR);
708 if (rc == 0) 703 if (rc == 0)
709 cifsInode->cifsAttrs = dosattrs; 704 cifsInode->cifsAttrs = dosattrs;
710} 705}
@@ -720,8 +715,7 @@ cifs_open_file(const unsigned int xid, struct cifs_open_parms *oparms,
720 oparms->create_options, 715 oparms->create_options,
721 &oparms->fid->netfid, oplock, buf, 716 &oparms->fid->netfid, oplock, buf,
722 oparms->cifs_sb->local_nls, 717 oparms->cifs_sb->local_nls,
723 oparms->cifs_sb->mnt_cifs_flags 718 cifs_remap(oparms->cifs_sb));
724 & CIFS_MOUNT_MAP_SPECIAL_CHR);
725 return CIFS_open(xid, oparms, oplock, buf); 719 return CIFS_open(xid, oparms, oplock, buf);
726} 720}
727 721
@@ -800,8 +794,7 @@ smb_set_file_info(struct inode *inode, const char *full_path,
800 tcon = tlink_tcon(tlink); 794 tcon = tlink_tcon(tlink);
801 795
802 rc = CIFSSMBSetPathInfo(xid, tcon, full_path, buf, cifs_sb->local_nls, 796 rc = CIFSSMBSetPathInfo(xid, tcon, full_path, buf, cifs_sb->local_nls,
803 cifs_sb->mnt_cifs_flags & 797 cifs_remap(cifs_sb));
804 CIFS_MOUNT_MAP_SPECIAL_CHR);
805 if (rc == 0) { 798 if (rc == 0) {
806 cinode->cifsAttrs = le32_to_cpu(buf->Attributes); 799 cinode->cifsAttrs = le32_to_cpu(buf->Attributes);
807 goto out; 800 goto out;
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c
index 43eb1367b103..6c1566366a66 100644
--- a/fs/cifs/smbencrypt.c
+++ b/fs/cifs/smbencrypt.c
@@ -29,6 +29,7 @@
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/kernel.h> 30#include <linux/kernel.h>
31#include <linux/random.h> 31#include <linux/random.h>
32#include "cifs_fs_sb.h"
32#include "cifs_unicode.h" 33#include "cifs_unicode.h"
33#include "cifspdu.h" 34#include "cifspdu.h"
34#include "cifsglob.h" 35#include "cifsglob.h"
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 5ac836a86b18..72a4d10653d6 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -28,6 +28,8 @@
28#include "cifsglob.h" 28#include "cifsglob.h"
29#include "cifsproto.h" 29#include "cifsproto.h"
30#include "cifs_debug.h" 30#include "cifs_debug.h"
31#include "cifs_fs_sb.h"
32#include "cifs_unicode.h"
31 33
32#define MAX_EA_VALUE_SIZE 65535 34#define MAX_EA_VALUE_SIZE 65535
33#define CIFS_XATTR_DOS_ATTRIB "user.DosAttrib" 35#define CIFS_XATTR_DOS_ATTRIB "user.DosAttrib"
@@ -85,8 +87,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
85 if (pTcon->ses->server->ops->set_EA) 87 if (pTcon->ses->server->ops->set_EA)
86 rc = pTcon->ses->server->ops->set_EA(xid, pTcon, 88 rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
87 full_path, ea_name, NULL, (__u16)0, 89 full_path, ea_name, NULL, (__u16)0,
88 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 90 cifs_sb->local_nls, cifs_remap(cifs_sb));
89 CIFS_MOUNT_MAP_SPECIAL_CHR);
90 } 91 }
91remove_ea_exit: 92remove_ea_exit:
92 kfree(full_path); 93 kfree(full_path);
@@ -154,8 +155,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
154 if (pTcon->ses->server->ops->set_EA) 155 if (pTcon->ses->server->ops->set_EA)
155 rc = pTcon->ses->server->ops->set_EA(xid, pTcon, 156 rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
156 full_path, ea_name, ea_value, (__u16)value_size, 157 full_path, ea_name, ea_value, (__u16)value_size,
157 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 158 cifs_sb->local_nls, cifs_remap(cifs_sb));
158 CIFS_MOUNT_MAP_SPECIAL_CHR);
159 } else if (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN) 159 } else if (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN)
160 == 0) { 160 == 0) {
161 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) 161 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
@@ -165,8 +165,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
165 if (pTcon->ses->server->ops->set_EA) 165 if (pTcon->ses->server->ops->set_EA)
166 rc = pTcon->ses->server->ops->set_EA(xid, pTcon, 166 rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
167 full_path, ea_name, ea_value, (__u16)value_size, 167 full_path, ea_name, ea_value, (__u16)value_size,
168 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 168 cifs_sb->local_nls, cifs_remap(cifs_sb));
169 CIFS_MOUNT_MAP_SPECIAL_CHR);
170 } else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL, 169 } else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL,
171 strlen(CIFS_XATTR_CIFS_ACL)) == 0) { 170 strlen(CIFS_XATTR_CIFS_ACL)) == 0) {
172#ifdef CONFIG_CIFS_ACL 171#ifdef CONFIG_CIFS_ACL
@@ -199,8 +198,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
199 rc = CIFSSMBSetPosixACL(xid, pTcon, full_path, 198 rc = CIFSSMBSetPosixACL(xid, pTcon, full_path,
200 ea_value, (const int)value_size, 199 ea_value, (const int)value_size,
201 ACL_TYPE_ACCESS, cifs_sb->local_nls, 200 ACL_TYPE_ACCESS, cifs_sb->local_nls,
202 cifs_sb->mnt_cifs_flags & 201 cifs_remap(cifs_sb));
203 CIFS_MOUNT_MAP_SPECIAL_CHR);
204 cifs_dbg(FYI, "set POSIX ACL rc %d\n", rc); 202 cifs_dbg(FYI, "set POSIX ACL rc %d\n", rc);
205#else 203#else
206 cifs_dbg(FYI, "set POSIX ACL not supported\n"); 204 cifs_dbg(FYI, "set POSIX ACL not supported\n");
@@ -212,8 +210,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
212 rc = CIFSSMBSetPosixACL(xid, pTcon, full_path, 210 rc = CIFSSMBSetPosixACL(xid, pTcon, full_path,
213 ea_value, (const int)value_size, 211 ea_value, (const int)value_size,
214 ACL_TYPE_DEFAULT, cifs_sb->local_nls, 212 ACL_TYPE_DEFAULT, cifs_sb->local_nls,
215 cifs_sb->mnt_cifs_flags & 213 cifs_remap(cifs_sb));
216 CIFS_MOUNT_MAP_SPECIAL_CHR);
217 cifs_dbg(FYI, "set POSIX default ACL rc %d\n", rc); 214 cifs_dbg(FYI, "set POSIX default ACL rc %d\n", rc);
218#else 215#else
219 cifs_dbg(FYI, "set default POSIX ACL not supported\n"); 216 cifs_dbg(FYI, "set default POSIX ACL not supported\n");
@@ -285,8 +282,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
285 if (pTcon->ses->server->ops->query_all_EAs) 282 if (pTcon->ses->server->ops->query_all_EAs)
286 rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon, 283 rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon,
287 full_path, ea_name, ea_value, buf_size, 284 full_path, ea_name, ea_value, buf_size,
288 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 285 cifs_sb->local_nls, cifs_remap(cifs_sb));
289 CIFS_MOUNT_MAP_SPECIAL_CHR);
290 } else if (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN) == 0) { 286 } else if (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN) == 0) {
291 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) 287 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
292 goto get_ea_exit; 288 goto get_ea_exit;
@@ -295,8 +291,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
295 if (pTcon->ses->server->ops->query_all_EAs) 291 if (pTcon->ses->server->ops->query_all_EAs)
296 rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon, 292 rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon,
297 full_path, ea_name, ea_value, buf_size, 293 full_path, ea_name, ea_value, buf_size,
298 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 294 cifs_sb->local_nls, cifs_remap(cifs_sb));
299 CIFS_MOUNT_MAP_SPECIAL_CHR);
300 } else if (strncmp(ea_name, POSIX_ACL_XATTR_ACCESS, 295 } else if (strncmp(ea_name, POSIX_ACL_XATTR_ACCESS,
301 strlen(POSIX_ACL_XATTR_ACCESS)) == 0) { 296 strlen(POSIX_ACL_XATTR_ACCESS)) == 0) {
302#ifdef CONFIG_CIFS_POSIX 297#ifdef CONFIG_CIFS_POSIX
@@ -304,8 +299,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
304 rc = CIFSSMBGetPosixACL(xid, pTcon, full_path, 299 rc = CIFSSMBGetPosixACL(xid, pTcon, full_path,
305 ea_value, buf_size, ACL_TYPE_ACCESS, 300 ea_value, buf_size, ACL_TYPE_ACCESS,
306 cifs_sb->local_nls, 301 cifs_sb->local_nls,
307 cifs_sb->mnt_cifs_flags & 302 cifs_remap(cifs_sb));
308 CIFS_MOUNT_MAP_SPECIAL_CHR);
309#else 303#else
310 cifs_dbg(FYI, "Query POSIX ACL not supported yet\n"); 304 cifs_dbg(FYI, "Query POSIX ACL not supported yet\n");
311#endif /* CONFIG_CIFS_POSIX */ 305#endif /* CONFIG_CIFS_POSIX */
@@ -316,8 +310,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
316 rc = CIFSSMBGetPosixACL(xid, pTcon, full_path, 310 rc = CIFSSMBGetPosixACL(xid, pTcon, full_path,
317 ea_value, buf_size, ACL_TYPE_DEFAULT, 311 ea_value, buf_size, ACL_TYPE_DEFAULT,
318 cifs_sb->local_nls, 312 cifs_sb->local_nls,
319 cifs_sb->mnt_cifs_flags & 313 cifs_remap(cifs_sb));
320 CIFS_MOUNT_MAP_SPECIAL_CHR);
321#else 314#else
322 cifs_dbg(FYI, "Query POSIX default ACL not supported yet\n"); 315 cifs_dbg(FYI, "Query POSIX default ACL not supported yet\n");
323#endif /* CONFIG_CIFS_POSIX */ 316#endif /* CONFIG_CIFS_POSIX */
@@ -421,8 +414,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
421 if (pTcon->ses->server->ops->query_all_EAs) 414 if (pTcon->ses->server->ops->query_all_EAs)
422 rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon, 415 rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon,
423 full_path, NULL, data, buf_size, 416 full_path, NULL, data, buf_size,
424 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 417 cifs_sb->local_nls, cifs_remap(cifs_sb));
425 CIFS_MOUNT_MAP_SPECIAL_CHR);
426list_ea_exit: 418list_ea_exit:
427 kfree(full_path); 419 kfree(full_path);
428 free_xid(xid); 420 free_xid(xid);