]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb3: fix posix extensions mount option
authorSteve French <stfrench@microsoft.com>
Mon, 23 Aug 2021 18:52:12 +0000 (13:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:00:56 +0000 (10:00 +0200)
commit 7321be2663da5922343cc121f1ff04924cee2e76 upstream.

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>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Suggested-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/fs_context.c

index 72742eb1df4a78fb3d49bdffd1e9200810a5c272..626bb7c552065e3e1888dc207752159f2153fe44 100644 (file)
@@ -1259,10 +1259,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;