aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/link.c
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 /fs/cifs/link.c
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>
Diffstat (limited to 'fs/cifs/link.c')
-rw-r--r--fs/cifs/link.c4
1 files changed, 2 insertions, 2 deletions
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) {