From patchwork Mon Aug 9 17:07:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Metzmacher X-Patchwork-Id: 118432 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o79H7HtF004237 for ; Mon, 9 Aug 2010 17:07:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757190Ab0HIRHg (ORCPT ); Mon, 9 Aug 2010 13:07:36 -0400 Received: from mo-p05-ob.rzone.de ([81.169.146.181]:64456 "EHLO mo-p05-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757178Ab0HIRHg (ORCPT ); Mon, 9 Aug 2010 13:07:36 -0400 X-RZG-AUTH: :IXQkeEW8Yfo/5haL0ckzWIsAYh739YBunhBBa3aCCCbZv/tK/4QIFiQT X-RZG-CLASS-ID: mo05 Received: from localhost.localdomain (xdsl-87-79-84-185.netcologne.de [87.79.84.185]) by post.strato.de (mrclete mo45) (RZmta 23.4) with (EDH-RSA-DES-CBC3-SHA encrypted) ESMTP id 600304m79Go2DV ; Mon, 9 Aug 2010 19:07:33 +0200 (MEST) From: Stefan Metzmacher To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Stefan Metzmacher Subject: [PATCH 7/7] cifs: add "mfsymlinks" mount option Date: Mon, 9 Aug 2010 19:07:15 +0200 Message-Id: <1281373635-16202-8-git-send-email-metze@samba.org> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1281373635-16202-7-git-send-email-metze@samba.org> References: <1281373635-16202-1-git-send-email-metze@samba.org> <1281373635-16202-2-git-send-email-metze@samba.org> <1281373635-16202-3-git-send-email-metze@samba.org> <1281373635-16202-4-git-send-email-metze@samba.org> <1281373635-16202-5-git-send-email-metze@samba.org> <1281373635-16202-6-git-send-email-metze@samba.org> <1281373635-16202-7-git-send-email-metze@samba.org> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 09 Aug 2010 17:07:37 +0000 (UTC) diff --git a/fs/cifs/README b/fs/cifs/README index a7081ee..6baf1b4 100644 --- a/fs/cifs/README +++ b/fs/cifs/README @@ -517,6 +517,11 @@ A partial list of the supported mount options follows: SFU does). In the future the bottom 9 bits of the mode also will be emulated using queries of the security descriptor (ACL). + mfsymlinks Enable support for Minshall+French symlinks + (see http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks) + This option is ignored when specified together with the + 'sfu' option. Minshall+French symlinks are used even if + the server supports the CIFS Unix Extensions. sign Must use packet signing (helps avoid unwanted data modification by intermediate systems in the route). Note that signing does not work with lanman or plaintext authentication. diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index a5ed10c..8121a86 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -420,6 +420,8 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) seq_printf(s, ",dynperm"); if (m->mnt_sb->s_flags & MS_POSIXACL) seq_printf(s, ",acl"); + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) + seq_printf(s, ",mfsymlinks"); seq_printf(s, ",rsize=%d", cifs_sb->rsize); seq_printf(s, ",wsize=%d", cifs_sb->wsize); diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 95c2ea6..1a8472d 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -100,6 +100,7 @@ struct smb_vol { bool noautotune:1; bool nostrictsync:1; /* do not force expensive SMBflush on every sync */ bool fsc:1; /* enable fscache */ + bool mfsymlinks:1; /* use Minshall+French Symlinks */ unsigned int rsize; unsigned int wsize; bool sockopt_tcp_nodelay:1; @@ -1343,6 +1344,8 @@ cifs_parse_mount_options(char *options, const char *devname, "/proc/fs/cifs/LookupCacheEnabled to 0\n"); } else if (strnicmp(data, "fsc", 3) == 0) { vol->fsc = true; + } else if (strnicmp(data, "mfsymlinks", 10) == 0) { + vol->mfsymlinks = true; } else printk(KERN_WARNING "CIFS: Unknown mount option %s\n", data); @@ -2482,6 +2485,14 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, cFYI(1, "mounting share using direct i/o"); cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; } + if (pvolume_info->mfsymlinks) { + if (pvolume_info->sfu_emul) { + cERROR(1, "mount option mfsymlinks ignored if sfu " + "mount option is used"); + } else { + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MF_SYMLINKS; + } + } if ((pvolume_info->cifs_acl) && (pvolume_info->dynperm)) cERROR(1, "mount option dynperm ignored if cifsacl "