diff mbox series

[SMB3.1.1] incorrect initialization of the posix extensions in new mount API

Message ID CAH2r5muZqv0Zv415suhAjv5s9a=rU8nMkY1p7doq5koMYU0wBA@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series [SMB3.1.1] incorrect initialization of the posix extensions in new mount API | expand

Commit Message

Steve French Aug. 23, 2021, 7:07 p.m. UTC
We were incorrectly initializing the posix extensions in the
conversion to the new mount API.

CC: <stable@vger.kernel.org> # 5.11+
Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Suggested-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/fs_context.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

  ctx->nocase = 1;

Comments

Christian Brauner Aug. 24, 2021, 11:52 a.m. UTC | #1
On Mon, Aug 23, 2021 at 02:07:22PM -0500, Steve French wrote:
> We were incorrectly initializing the posix extensions in the
> conversion to the new mount API.
> 
> CC: <stable@vger.kernel.org> # 5.11+
> Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
> Suggested-by: Namjae Jeon <namjae.jeon@samsung.com>
> Signed-off-by: Steve French <stfrench@microsoft.com>
> ---

The indentation looks rather strange to me but maybe that's just mail
that got garbled. In any case, with the indentation fixed:

Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Steve French Aug. 24, 2021, 4:02 p.m. UTC | #2
Yes - the indentation is just cut-n-paste gmail strangeness - you can
see the proper indentation in the attachment


On Tue, Aug 24, 2021 at 6:52 AM Christian Brauner
<christian.brauner@ubuntu.com> wrote:
>
> On Mon, Aug 23, 2021 at 02:07:22PM -0500, Steve French wrote:
> > We were incorrectly initializing the posix extensions in the
> > conversion to the new mount API.
> >
> > CC: <stable@vger.kernel.org> # 5.11+
> > Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
> > Suggested-by: Namjae Jeon <namjae.jeon@samsung.com>
> > Signed-off-by: Steve French <stfrench@microsoft.com>
> > ---
>
> The indentation looks rather strange to me but maybe that's just mail
> that got garbled. In any case, with the indentation fixed:
>
> Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
diff mbox series

Patch

From bfb7d1b8806fe8decc977963b9eddbf9c4ced9d5 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Mon, 23 Aug 2021 13:52:12 -0500
Subject: [PATCH] smb3: fix posix extensions mount option

We were incorrectly initializing the posix extensions in the
conversion to the new mount API.

CC: <stable@vger.kernel.org> # 5.11+
Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Suggested-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/fs_context.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c
index 4515a0883262..3109def8e199 100644
--- a/fs/cifs/fs_context.c
+++ b/fs/cifs/fs_context.c
@@ -1252,10 +1252,17 @@  static int smb3_fs_context_parse_param(struct fs_context *fc,
 			ctx->posix_paths = 1;
 		break;
 	case Opt_unix:
-		if (result.negated)
+		if (result.negated) {
+			if (ctx->linux_ext == 1)
+				pr_warn_once("conflicting posix mount options specified\n");
 			ctx->linux_ext = 0;
-		else
 			ctx->no_linux_ext = 1;
+		} else {
+			if (ctx->no_linux_ext == 1)
+				pr_warn_once("conflicting posix mount options specified\n");
+			ctx->linux_ext = 1;
+			ctx->no_linux_ext = 0;
+		}
 		break;
 	case Opt_nocase:
 		ctx->nocase = 1;
-- 
2.30.2