{"id":2230532,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2230532/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260429205236.456099-1-henrique.carvalho@suse.com/","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/1.1/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260429205236.456099-1-henrique.carvalho@suse.com>","date":"2026-04-29T20:52:34","name":"[1/3] smb: client: fix conflicting option validation for new mount API","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"000fa53d5824b92912d42191a7424010369dced3","submitter":{"id":89563,"url":"http://patchwork.ozlabs.org/api/1.1/people/89563/?format=json","name":"Henrique Carvalho","email":"henrique.carvalho@suse.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260429205236.456099-1-henrique.carvalho@suse.com/mbox/","series":[{"id":502149,"url":"http://patchwork.ozlabs.org/api/1.1/series/502149/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=502149","date":"2026-04-29T20:52:34","name":"[1/3] smb: client: fix conflicting option validation for new mount API","version":1,"mbox":"http://patchwork.ozlabs.org/series/502149/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2230532/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2230532/checks/","tags":{},"headers":{"Return-Path":"\n <linux-cifs+bounces-11298-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256\n header.s=google header.b=fpGBKwYt;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-11298-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com\n header.b=\"fpGBKwYt\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.128.53","smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=suse.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=suse.com"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5Tz80kw0z1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 06:53:08 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 9A479301705E\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 20:53:05 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5580F394462;\n\tWed, 29 Apr 2026 20:53:03 +0000 (UTC)","from mail-wm1-f53.google.com (mail-wm1-f53.google.com\n [209.85.128.53])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 685B82FE58C\n\tfor <linux-cifs@vger.kernel.org>; Wed, 29 Apr 2026 20:53:01 +0000 (UTC)","by mail-wm1-f53.google.com with SMTP id\n 5b1f17b1804b1-488b0046078so1717555e9.1\n        for <linux-cifs@vger.kernel.org>;\n Wed, 29 Apr 2026 13:53:01 -0700 (PDT)","from precision ([2a01:4b00:c007:bb00:be9d:a3c4:18b1:4a25])\n        by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-12de3269b41sm3925240c88.13.2026.04.29.13.52.54\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Wed, 29 Apr 2026 13:52:58 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777495983; cv=none;\n b=RalZ1ykukZx/PmBqdUCbCyjlb5l7nP42I6zWydLBFNttzowtMVfeS+8I1Wolzf4S1G6LtfQgMEnJv/HorAc4efV8FkMiEwHCOReVJRLYh5Te/lrDO4SAyc1gqfJAtYZhlCO7TZ0yXYfeapdITU2EQA0fxMMMKIucwVIJcVi6gu4=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777495983; c=relaxed/simple;\n\tbh=H95xvPfekRcV6kcCfZnWxct/d3WkScr/5zfu4CeTb74=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=ZC66xSL6BOLhdedeaow0sqpPUL4tm3lGtPTsPXySQjkKqluGxiCE7A7YKXt/WLWREuYziJfyZs6jN8WJpP9yvjh5sFoBRexblfREJeu9O+B0xLpG2J8TWEXEn1o2MaOW0YpbDgkVQVCgNE+PmlR/k8ThG7bq01+XO6XO+eJw0kk=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=suse.com;\n spf=pass smtp.mailfrom=suse.com;\n dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com\n header.b=fpGBKwYt; arc=none smtp.client-ip=209.85.128.53","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=suse.com; s=google; t=1777495980; x=1778100780;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=tb24MkyjLzb8BmTwEPAd5bKVggSokaYwMRLyJVXZm4g=;\n        b=fpGBKwYtS9J65Egz1e+qq1gHrLbrGMlnPZkOfDmPCgTPWC9HF7lDwH+aUERDnnkqJd\n         ggKmlIS9eA9r+ZeI8dLDxK9X68rMYIQGBxfC6eNm45UIe8b1EEu6Mc0eh2HwvAHWbinp\n         WleOeSL/i0cahlv8tcXluqlVCEKE+8MZrGTGDrE+XXVG//4WM5iTgXNBDIHeimE3Xxtz\n         xzXRHbnfUJYO5kQ1a5MQjrCXTKixfYErjXdOLn4Gndb3wlNmZWacnqHftZ33DYwmeyhr\n         Bjnt4i03G3LDeiXb8RmYblhqh2/iEXEPPZE/IaQ5WypGp5jRpmsMHhzJDFwYcs63+Hjo\n         YCsA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777495980; x=1778100780;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=tb24MkyjLzb8BmTwEPAd5bKVggSokaYwMRLyJVXZm4g=;\n        b=nsBl7AkuWyD3POMDYFOnzMf01Zr30CK+R89K+12jxyjTDBtkSV5P+9bHo+gdDJFy3/\n         0VfjcWFtyzTa/KTKpgIQ7BS04FsP2oqwj63OuVGEgfXiRohtRX0wGOxRC6IjZeOnCkH8\n         tXQhnmeuij8AJuILglRXZOe43+9d2CiZelo6vC+xUL2BAQ3vPU+P5LNSHTGfoAiPAvfa\n         lRpAnaRslZ3CfRE1EQVFe9D9oX5zMeNiB/92UqabW1zdgrIIuMIq+rafIW0g/zVJqXu1\n         5nW3SSp3IANMiKZeMLhYWANV4M1MpZgYfSCDw/WOSHWD4t6S7WIhqeFacDeVWWVv3fNk\n         O6zg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ9jq9EheMJJsy72jB52b2aPR5pSBS9XlhonLTdHF3iBlVCjBwEMIZgdeb5Lt5RVmhtTG1imZVyglsju@vger.kernel.org","X-Gm-Message-State":"AOJu0YzNHhEG/GjHfBMtDFW/ncJjmPz6+J/KnWHXDDMIm7YpgneumY8e\n\tk2nBO8v5QeP7z7HXsnWHDwXkS685YIv814cL0LY6oTrObCcIcftVf6MvUNuLLeC/SYo=","X-Gm-Gg":"AeBDiesWmvlTUGTg5Pg1fttWydhjJKiukb4Qx0NVpSFy1lahGOOMBnpQbHU3BP9Gvq8\n\tBqd0r8JpedoNy2E8aQNYJ32NzjSoH9TN8KBiqI6kiW+vXr/B55UHJ92lx5Kz8RKRUvR2Lgn2cxr\n\tAUARKaJFNrHwxey8lqWcxxUybWIqiXPrSDPjEU0NzMtuKix+zqrzJDqRAAygaU8K1hN0FmPgM04\n\toQc8em8loVmvg217MZ5PHntUGgenxKOv+/jj8zjFpgR22KWAwRW1LWlVIXIGFZgqjhdBOl+oduw\n\tfkPiJGGU6vgvnMigtJj+Mtq+cCaurFwFTgIrIlNsMPYvZ3sryMs+zL9wfIyRvujMRoTz/XIfQ1/\n\tfQGEPy/XXPJKL49XYZ5O5scngIxcsciL1gWgF7OPcF4un1JT6jL5Co62cNmU45GXfVISh1BZ1if\n\t9m9cz3QTXmL2uC1Fv/XhGRvADqbGVS80EVthH7AcMwRsjK","X-Received":"by 2002:a05:600c:a409:b0:489:1fa5:997f with SMTP id\n 5b1f17b1804b1-48a83d6c37cmr2425015e9.9.1777495979623;\n        Wed, 29 Apr 2026 13:52:59 -0700 (PDT)","From":"Henrique Carvalho <henrique.carvalho@suse.com>","To":"sfrench@samba.org","Cc":"metze@samba.org,\n\tpc@manguebit.org,\n\tronniesahlberg@gmail.com,\n\tsprasad@microsoft.com,\n\ttom@talpey.com,\n\tbharathsm@microsoft.com,\n\tematsumiya@suse.de,\n\tlinux-cifs@vger.kernel.org","Subject":"[PATCH 1/3] smb: client: fix conflicting option validation for new\n mount API","Date":"Wed, 29 Apr 2026 17:52:34 -0300","Message-ID":"<20260429205236.456099-1-henrique.carvalho@suse.com>","X-Mailer":"git-send-email 2.53.0","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"Apply conflicting option validation consistently across all the new\nmount API paths, for both mount and remount.\n\nSome checks were only applied during initial mount validation, while\nothers were handled during option parsing, causing mount and\nremount/reconfigure to behave differently.\n\nMove the conflicting option checks into smb3_handle_conflicting_options()\nand call it from the common validation paths, including for\nmultichannel/max_channels handling.\n\nFixes: ef529f655a2c (\"cifs: client: allow changing multichannel mount options on remount\")\nFixes: 1ef15fbe6771 (\"cifs: client: enforce consistent handling of multichannel and max_channels\")\nFixes: 77d8aa79ecfb (\"cifs: reinstate original behavior again for forceuid/forcegid\")\nFixes: 24e0a1eff9e2 (\"cifs: switch to new mount api\")\nSigned-off-by: Henrique Carvalho <henrique.carvalho@suse.com>\n---\n fs/smb/client/fs_context.c | 87 +++++++++++++++++++++-----------------\n 1 file changed, 48 insertions(+), 39 deletions(-)","diff":"diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c\nindex b9544eb0381b..41384e1f0f3c 100644\n--- a/fs/smb/client/fs_context.c\n+++ b/fs/smb/client/fs_context.c\n@@ -724,6 +724,41 @@ static int smb3_handle_conflicting_options(struct fs_context *fc)\n {\n \tstruct smb3_fs_context *ctx = smb3_fc2context(fc);\n \n+\tif (ctx->rdma && ctx->vals->protocol_id < SMB30_PROT_ID) {\n+\t\tcifs_errorf(fc, \"SMB Direct requires Version >=3.0\\n\");\n+\t\treturn -EOPNOTSUPP;\n+\t}\n+\n+\tif (ctx->multiuser && !IS_ENABLED(CONFIG_KEYS)) {\n+\t\tcifs_errorf(fc, \"Multiuser mounts require kernels with CONFIG_KEYS enabled\\n\");\n+\t\treturn -EOPNOTSUPP;\n+\t}\n+\n+\tif (ctx->multiuser && ctx->upcall_target == UPTARGET_MOUNT) {\n+\t\tcifs_errorf(fc, \"multiuser mount option not supported with upcalltarget set as 'mount'\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (ctx->uid_specified && !ctx->forceuid_specified) {\n+\t\tctx->override_uid = 1;\n+\t\tpr_notice(\"enabling forceuid mount option implicitly because uid= option is specified\\n\");\n+\t}\n+\n+\tif (ctx->gid_specified && !ctx->forcegid_specified) {\n+\t\tctx->override_gid = 1;\n+\t\tpr_notice(\"enabling forcegid mount option implicitly because gid= option is specified\\n\");\n+\t}\n+\n+\tif (ctx->override_uid && !ctx->uid_specified) {\n+\t\tctx->override_uid = 0;\n+\t\tpr_notice(\"ignoring forceuid mount option specified with no uid= option\\n\");\n+\t}\n+\n+\tif (ctx->override_gid && !ctx->gid_specified) {\n+\t\tctx->override_gid = 0;\n+\t\tpr_notice(\"ignoring forcegid mount option specified with no gid= option\\n\");\n+\t}\n+\n \tif (ctx->multichannel_specified) {\n \t\tif (ctx->multichannel) {\n \t\t\tif (!ctx->max_channels_specified) {\n@@ -835,28 +870,23 @@ static int smb3_fs_context_parse_monolithic(struct fs_context *fc,\n \t\tif (ret < 0)\n \t\t\tbreak;\n \t}\n-\treturn ret ?: smb3_handle_conflicting_options(fc);\n+\treturn ret;\n }\n \n /*\n- * Validate the preparsed information in the config.\n+ * smb3_fs_context_validate - check initial-mount-only constraints: UNC presence, address resolution,\n+ * dialect warnings\n+ *\n+ * @fc: generic mount context\n  */\n static int smb3_fs_context_validate(struct fs_context *fc)\n {\n \tstruct smb3_fs_context *ctx = smb3_fc2context(fc);\n+\tint rc;\n \n-\tif (ctx->rdma && ctx->vals->protocol_id < SMB30_PROT_ID) {\n-\t\tcifs_errorf(fc, \"SMB Direct requires Version >=3.0\\n\");\n-\t\treturn -EOPNOTSUPP;\n-\t}\n-\n-#ifndef CONFIG_KEYS\n-\t/* Muliuser mounts require CONFIG_KEYS support */\n-\tif (ctx->multiuser) {\n-\t\tcifs_errorf(fc, \"Multiuser mounts require kernels with CONFIG_KEYS enabled\\n\");\n-\t\treturn -1;\n-\t}\n-#endif\n+\trc = smb3_handle_conflicting_options(fc);\n+\tif (rc)\n+\t\treturn rc;\n \n \tif (ctx->got_version == false)\n \t\tpr_warn_once(\"No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.\\n\");\n@@ -891,26 +921,6 @@ static int smb3_fs_context_validate(struct fs_context *fc)\n \t/* set the port that we got earlier */\n \tcifs_set_port((struct sockaddr *)&ctx->dstaddr, ctx->port);\n \n-\tif (ctx->uid_specified && !ctx->forceuid_specified) {\n-\t\tctx->override_uid = 1;\n-\t\tpr_notice(\"enabling forceuid mount option implicitly because uid= option is specified\\n\");\n-\t}\n-\n-\tif (ctx->gid_specified && !ctx->forcegid_specified) {\n-\t\tctx->override_gid = 1;\n-\t\tpr_notice(\"enabling forcegid mount option implicitly because gid= option is specified\\n\");\n-\t}\n-\n-\tif (ctx->override_uid && !ctx->uid_specified) {\n-\t\tctx->override_uid = 0;\n-\t\tpr_notice(\"ignoring forceuid mount option specified with no uid= option\\n\");\n-\t}\n-\n-\tif (ctx->override_gid && !ctx->gid_specified) {\n-\t\tctx->override_gid = 0;\n-\t\tpr_notice(\"ignoring forcegid mount option specified with no gid= option\\n\");\n-\t}\n-\n \treturn 0;\n }\n \n@@ -1097,6 +1107,10 @@ static int smb3_reconfigure(struct fs_context *fc)\n \tif (rc)\n \t\treturn rc;\n \n+\trc = smb3_handle_conflicting_options(fc);\n+\tif (rc)\n+\t\treturn rc;\n+\n \t/*\n \t * We can not change UNC/username/password/domainname/\n \t * workstation_name/nodename/iocharset\n@@ -1909,11 +1923,6 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,\n \t}\n \t/* case Opt_ignore: - is ignored as expected ... */\n \n-\tif (ctx->multiuser && ctx->upcall_target == UPTARGET_MOUNT) {\n-\t\tcifs_errorf(fc, \"multiuser mount option not supported with upcalltarget set as 'mount'\\n\");\n-\t\tgoto cifs_parse_mount_err;\n-\t}\n-\n \treturn 0;\n \n  cifs_parse_mount_err:\n","prefixes":["1/3"]}