From patchwork Sat Aug 27 16:18:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1104582 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7RGIvHN021333 for ; Sat, 27 Aug 2011 16:18:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750973Ab1H0QS4 (ORCPT ); Sat, 27 Aug 2011 12:18:56 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:54854 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750939Ab1H0QSz (ORCPT ); Sat, 27 Aug 2011 12:18:55 -0400 Received: by bke11 with SMTP id 11so3209679bke.19 for ; Sat, 27 Aug 2011 09:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=lJYiCMM0JHwYTMQPdfZ7/tlEhXbN+9Ni94d3e7WNgx8=; b=mV028AiB89DLlWaq+gYhKnNkVK7n7/61PwU8ZDgjlGZXpkr6jVATjtoFsKyUsIMWXM 2FwUO5lESu9EnXc/qt3Zuqz2cxiYgz5VasAoK47VM6N+nuYoMVvljyJtoHjBQrugPDWg cT2oubkY3CASFktO9kRKrCE/2Y0IDkg+tWUCk= Received: by 10.204.129.201 with SMTP id p9mr1230319bks.253.1314461934226; Sat, 27 Aug 2011 09:18:54 -0700 (PDT) Received: from localhost.localdomain ([85.26.233.164]) by mx.google.com with ESMTPS id m24sm742430bkm.33.2011.08.27.09.18.51 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Aug 2011 09:18:53 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: Subject: [PATCH] CIFS: Fix the conflict between rwpidforward and rw mount options Date: Sat, 27 Aug 2011 20:18:40 +0400 Message-Id: <1314461920-6116-1-git-send-email-piastry@etersoft.ru> X-Mailer: git-send-email 1.7.1 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.6 (demeter2.kernel.org [140.211.167.43]); Sat, 27 Aug 2011 16:18:57 +0000 (UTC) Both these options are started with "rw" - that's why the first one isn't switched on even if it is specified. Fix this by adding a length check for "rw" option check. Cc: Signed-off-by: Pavel Shilovsky --- fs/cifs/connect.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 633c246..f4af4cc 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1298,7 +1298,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, /* ignore */ } else if (strnicmp(data, "guest", 5) == 0) { /* ignore */ - } else if (strnicmp(data, "rw", 2) == 0) { + } else if (strnicmp(data, "rw", 2) == 0 && strlen(data) == 2) { /* ignore */ } else if (strnicmp(data, "ro", 2) == 0) { /* ignore */ @@ -1401,7 +1401,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, vol->server_ino = 1; } else if (strnicmp(data, "noserverino", 9) == 0) { vol->server_ino = 0; - } else if (strnicmp(data, "rwpidforward", 4) == 0) { + } else if (strnicmp(data, "rwpidforward", 12) == 0) { vol->rwpidforward = 1; } else if (strnicmp(data, "cifsacl", 7) == 0) { vol->cifs_acl = 1;