From patchwork Wed Nov 20 21:23:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 3215661 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 019699F26C for ; Wed, 20 Nov 2013 21:23:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A5F820776 for ; Wed, 20 Nov 2013 21:23:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C88020736 for ; Wed, 20 Nov 2013 21:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755251Ab3KTVXv (ORCPT ); Wed, 20 Nov 2013 16:23:51 -0500 Received: from mail-pd0-f176.google.com ([209.85.192.176]:40540 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755208Ab3KTVXu (ORCPT ); Wed, 20 Nov 2013 16:23:50 -0500 Received: by mail-pd0-f176.google.com with SMTP id w10so7935451pde.7 for ; Wed, 20 Nov 2013 13:23:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=eaC33TWVW2Z7V1gGJfHdlgwvZ3zBXjw+mt8vq3pmB+g=; b=nLZRlC8cqdOm3+Sk/OsW5qoPMpihjoiMTnrNQ0Zw8JaeDwJMUwnsD4BVZqHpiKbXVI r79nTB2ntiSCgDX/4HAwPVFgzmVxhtM7X2SDZVKyKhnC+zSmzw2ocBwmKysAjHZsMvS5 9tvW2Qc5Ghwq+bBY9vNQS/uoZJHP8DAMvL+7VxRFuOeTl57gnvHrBZv0Wc7wYP+JoS2s y4p33wbw7OagyJpcM0GpsuGGtPzUoyyxhynpy07hDuWuw4HZBwz/qckp2utBCAY8wuzA MdOrZ62kfQpWnSv1+Zcelb5AMhi+j8yfxtJepFPwCAfY4Hzj0s/0CQo/NoCSVAin/wiC vxhw== MIME-Version: 1.0 X-Received: by 10.66.250.129 with SMTP id zc1mr2706595pac.153.1384982629844; Wed, 20 Nov 2013 13:23:49 -0800 (PST) Received: by 10.68.143.10 with HTTP; Wed, 20 Nov 2013 13:23:49 -0800 (PST) Date: Wed, 20 Nov 2013 15:23:49 -0600 Message-ID: Subject: mapchars should be default on smb2 and later mounts From: Steve French To: "linux-cifs@vger.kernel.org" , samba-technical Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since we don't have posix pathnames in SMB2/SMB3, shouldn't mapchars be the default if unspecified at mount to smb2/smb3 server? char *nodename = utsname()->nodename; @@ -1339,9 +1340,11 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, break; case Opt_mapchars: vol->remap = 1; + mapchar_specified = true; break; case Opt_nomapchars: vol->remap = 0; + mapchar_specified = true; break; case Opt_sfu: vol->sfu_emul = 1; @@ -1882,6 +1885,10 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, printk(KERN_NOTICE "CIFS: ignoring forcegid mount option " "specified with no gid= option.\n"); + /* SMB2 and later do not support posix pathnames. default to mapchar */ + if ((mapchar_specified == false) && (vol->vals != &smb1_values)) + vol->remap = 1; + kfree(mountdata_copy); return 0; diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 8813ff7..cc24459 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1197,6 +1197,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, short int override_gid = -1; bool uid_specified = false; bool gid_specified = false; + bool mapchar_specified = false; bool sloppy = false; char *invalid = NULL;