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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

CC: <stable@xxxxxxxxxxxxxxx> # 5.11+
Reported-by: Christian Brauner <christian.brauner@xxxxxxxxxx>
Suggested-by: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
---
 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;

-- 
Thanks,

Steve
From bfb7d1b8806fe8decc977963b9eddbf9c4ced9d5 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxx> # 5.11+
Reported-by: Christian Brauner <christian.brauner@xxxxxxxxxx>
Suggested-by: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
---
 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


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux