From patchwork Sat Aug 27 16:19:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1104592 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 p7RGIvHP021333 for ; Sat, 27 Aug 2011 16:20:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974Ab1H0QUa (ORCPT ); Sat, 27 Aug 2011 12:20:30 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:32825 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750964Ab1H0QUa (ORCPT ); Sat, 27 Aug 2011 12:20:30 -0400 Received: by bke11 with SMTP id 11so3210241bke.19 for ; Sat, 27 Aug 2011 09:20:29 -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=WgyloYJG9Aj4x/xljSz1tfl+U4XkBRUxKlLpjJG8tyCfVCGDnZCaxZG+TE3+f/da+w TkX6NH7b9UQMA/k4YDBzB1QSAwhqdI/N1UJnUdvU/6tdG+8Vfyeenks3zRZ5Nj2bKoxk TftuhNmidBKf6irCXVlI1eCZygjg1oXwCvgNE= Received: by 10.204.137.77 with SMTP id v13mr1190450bkt.344.1314462029065; Sat, 27 Aug 2011 09:20:29 -0700 (PDT) Received: from localhost.localdomain ([85.26.233.164]) by mx.google.com with ESMTPS id z7sm743675bkt.6.2011.08.27.09.20.26 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Aug 2011 09:20:28 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: Subject: [PATCH v2] CIFS: Fix the conflict between rwpidforward and rw mount options Date: Sat, 27 Aug 2011 20:19:44 +0400 Message-Id: <1314461984-6161-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:20:31 +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;