Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2221363/?format=api
{ "id": 2221363, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2221363/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260409095926.905020-1-rajasimandalos@gmail.com/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/1.2/projects/12/?format=api", "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": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260409095926.905020-1-rajasimandalos@gmail.com>", "list_archive_url": null, "date": "2026-04-09T09:59:18", "name": "[1/9] smb: client: block non-reconfigurable option changes on remount", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "a156b081ae9fa2a427855b3225cb2ab26b397402", "submitter": { "id": 91740, "url": "http://patchwork.ozlabs.org/api/1.2/people/91740/?format=api", "name": "Rajasi Mandal", "email": "rajasimandalos@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260409095926.905020-1-rajasimandalos@gmail.com/mbox/", "series": [ { "id": 499267, "url": "http://patchwork.ozlabs.org/api/1.2/series/499267/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=499267", "date": "2026-04-09T09:59:18", "name": "[1/9] smb: client: block non-reconfigurable option changes on remount", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499267/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2221363/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221363/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10729-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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=LOSQAhaw;\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-10729-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"LOSQAhaw\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.210.173", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.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 4frwW31FHJz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 20:03:43 +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 3105A3028F55\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 9 Apr 2026 10:00:34 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id CACB43BB9FD;\n\tThu, 9 Apr 2026 09:59:56 +0000 (UTC)", "from mail-pf1-f173.google.com (mail-pf1-f173.google.com\n [209.85.210.173])\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 E08AD3BA251\n\tfor <linux-cifs@vger.kernel.org>; Thu, 9 Apr 2026 09:59:49 +0000 (UTC)", "by mail-pf1-f173.google.com with SMTP id\n d2e1a72fcca58-82cf636dac8so385028b3a.3\n for <linux-cifs@vger.kernel.org>;\n Thu, 09 Apr 2026 02:59:49 -0700 (PDT)", "from dev-vm-rm.hzz4ddxqtfeetjrh00qlbgyytb.rx.internal.cloudapp.net\n ([20.197.52.255])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82cf9c6b80dsm29113671b3a.42.2026.04.09.02.59.44\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 09 Apr 2026 02:59:47 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775728794; cv=none;\n b=BeEMUjL3Kjdg/d7cS99M14VAALwniWWXcqTXQSx5TIKvPVYTbQG3L+dn+2lCfzljp8upOUQ3T8SndDQPcnk17MOMTbelcEjObovBU1hV1Rl2CcOCwdZXBxvpKoYMCPVIg8Vx2d0dkMJp3RtsdvX+5i9i7MHuXm+reiPA4N9nbWY=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775728794; c=relaxed/simple;\n\tbh=rkm0/pi9YghhxDH0ulln+DH0cJ9iPyFICvyPWtK1vMM=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=JuSGnfHVContiU2C33IfsQFj7dtwci1knqKPCz8/1H1Jr+pYfZ8yRw2IkafcsmpLuME3njJES/MQBjLJeK7vOhNr/0lSLQG8JVRKhHphim7K5POSFQJMjmgz3gBXXDjAGzGDn/dRIcvnd4TWU8s5LpvxgHoukhGJzKXK4aV5dOo=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=LOSQAhaw; arc=none smtp.client-ip=209.85.210.173", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775728788; x=1776333588;\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=t3d1+K0IsnZoRFwAfRvvY9wcvriTXGWHVjUeeK00nBA=;\n b=LOSQAhawJkNeXATpTPD9df3RoBRCixzfCvGCzfpxy2XHn2lJ4sGKVEaJaBbrNyzPlU\n DGLwDwo+HswDUXGVb+RRdImKDdTaUb63omNZQues4a9gxqqYO/bqO4ixFn2NzANz+wTv\n Vjax8QCaJda7vfPa909L5u/PI6H6XRbyOqyS6EpdfLGu5R2vLpPwxwzi/h4W2CHlu8jp\n xwEuHTwutU2dryngRZi7c9jFemq7xOAKIHvz3/5wuZfq59HZk7U6XNIX4LBPpnuiLyno\n gkhaX9CtwbfrN/sUcLE2WujrOAbq7oa3SWLlmT37pce3Qi7Iygnh5RpkPYeDwTfx+FyK\n ayXQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775728788; x=1776333588;\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=t3d1+K0IsnZoRFwAfRvvY9wcvriTXGWHVjUeeK00nBA=;\n b=MncE7l0/rBM9zFwNKk0r3DEUTbOc4/T8vAPDK82b4CKXv+lve3J4KyFnYDTF82qMlJ\n AnvmuLx/rPe85tExqUxV5UVTwqe5k6Itei7iqsah2ZndcR51BusrOjDaBS+ULnTff2LP\n 2feMKMnMf9c27o4wT7IW8qxzaNDw3JeuwTSLS1FVhF6xMHL3RdADK3I2JLsOZ0llqMJH\n uRr2ZNgmZ7OlkskQ4DzmDXazQ9AH4T+HGQwmLIT7kU2XTt3TmLsCEkJrBrr4YNxc9Xjp\n ljaQu4i9nus3MuVgr6Kd046nKd7Gh3bRWREYcihL89wFpe9lmmGxsL5ydvflwjl0BFkj\n aVOw==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCWniEve/rw5RiPqiTC2N4ZxFOtud0Z7cxMituQZWCAWfWw1QFJ1hEh8yBOpYTJnke0ha8Cus1UQxEtT@vger.kernel.org", "X-Gm-Message-State": "AOJu0Ywwxz7WT5TkIWUAMXFqdg0996oGW5nX8A0M27T93BLyQ97i1mDe\n\tToL1bHAUdVOhYO1qDIv8XmwyRl03KdPHttnF7dwxKaSKA8CkBc970Jc21NaltA==", "X-Gm-Gg": "AeBDievBS8s/IipIPiBbWeW+/XMDKhHrArMOON8Ix9nhaDF2Vvxcq6YXM46M4zDylGw\n\tpWs9ko+VjV/U6Mv3/wumnvQSNDSPzfZhNW222vcC8R5QVlloIa4mp2MThkNCCGCZ3lvQmbYsTMi\n\tZU/xymZxshHZXWf4OoUAFRQjbZoThhHC/m6xY4B6BHZWscLP/HXM9/JYRnaME5njAiIHGjnn7E9\n\tmmv7D5z5kekRvsvexg6ej01OpFBa8xDbgF9SwlwWhvBki9IdtbW342vxlcxoPhsVNxGk5RgW/7N\n\tVxmvRNeRQU+seVMwry6mkbcR+rBYWAz17ti1OBjeiIT1hIW0dALLaww2rE4VKYMVFFrJVIq+HAy\n\tYuQMRYkEOVYGSPHXLUHOXxioe77r84TywnwuXV/TwBFKfQqcqE9I+FGH0O7A6mdqr7hvrFlpov6\n\tzKWGJD8LdfLH0DqqBPTUBe3randXXoRv562G+AGIcreasECStQfnrOWk8/Pti8oSTgk8q1d5RLV\n\tVKWIaETMmxrM54g/tRyDWU=", "X-Received": "by 2002:a05:6a00:987:b0:82c:db50:ef77 with SMTP id\n d2e1a72fcca58-82dd8b0388emr3210268b3a.49.1775728788079;\n Thu, 09 Apr 2026 02:59:48 -0700 (PDT)", "From": "rajasimandalos@gmail.com", "To": "sfrench@samba.org,\n\tlinux-cifs@vger.kernel.org", "Cc": "pc@manguebit.org,\n\tronniesahlberg@gmail.com,\n\tsprasad@microsoft.com,\n\ttom@talpey.com,\n\tmetze@samba.org,\n\tbharathsm@microsoft.com,\n\tsamba-technical@lists.samba.org,\n\tlinux-kernel@vger.kernel.org,\n\tRajasi Mandal <rajasimandal@microsoft.com>", "Subject": "[PATCH 1/9] smb: client: block non-reconfigurable option changes on\n remount", "Date": "Thu, 9 Apr 2026 09:59:18 +0000", "Message-ID": "<20260409095926.905020-1-rajasimandalos@gmail.com>", "X-Mailer": "git-send-email 2.43.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": "From: Rajasi Mandal <rajasimandal@microsoft.com>\n\nOptions like seal, sign, vers, ip, rdma and others require tearing\ndown the connection to take effect, so they cannot be changed on\nremount. Previously they were silently accepted and ignored.\n\nAdd checks in smb3_verify_reconfigure_ctx() to reject changes to\nthese options on remount. Options shown in /proc/mounts use a bare\n!= comparison since libmount feeds them back automatically. Options\nnot shown in /proc/mounts use an 'if (new && new != old)' guard so\ntheir init default does not cause a false mismatch.\n\nIntroduce smb3_preserve_non_reconfig_opts() to copy hidden option\nvalues from the old context into the new one before\nsmb3_fs_context_dup() overwrites them with init defaults. Without\nthis, a bare remount silently corrupts the stored mount context by\nreplacing live values with zero/init defaults for every option not\nshown in /proc/mounts.\n\nIntroduce smb3_sync_ctx_from_negotiated() to sync the stored mount\ncontext with runtime state (persistenthandles, unix, nosharesock,\nresilienthandles, domainname, ops/vals) before the verify step, since\ncifs_show_options() reads these from tcon/server and they can diverge\nfrom ctx when the server auto-enables a feature or negotiates a\ndifferent dialect than what was parsed (e.g. default -> SMB 3.1.1).\nWithout this sync, the fed-back /proc/mounts values mismatch the\nstale ctx and the verify step incorrectly rejects a bare remount.\n\nSigned-off-by: Rajasi Mandal <rajasimandal@microsoft.com>\n---\n fs/smb/client/fs_context.c | 232 +++++++++++++++++++++++++++++++++++++\n 1 file changed, 232 insertions(+)", "diff": "diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c\nindex 3f0faae99ed5..0f6c1eb8e274 100644\n--- a/fs/smb/client/fs_context.c\n+++ b/fs/smb/client/fs_context.c\n@@ -1021,10 +1021,238 @@ static int smb3_verify_reconfigure_ctx(struct fs_context *fc,\n \t\tcifs_errorf(fc, \"can not change nbsessinit during remount\\n\");\n \t\treturn -EINVAL;\n \t}\n+\t/* init default: compress = false */\n+\tif (new_ctx->compress &&\n+\t new_ctx->compress != old_ctx->compress) {\n+\t\tcifs_errorf(fc, \"can not change compress during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->noblocksnd != old_ctx->noblocksnd) {\n+\t\tcifs_errorf(fc, \"can not change noblocksend during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->noautotune != old_ctx->noautotune) {\n+\t\tcifs_errorf(fc, \"can not change noautotune during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->no_sparse != old_ctx->no_sparse) {\n+\t\tcifs_errorf(fc, \"can not change nosparse during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->nodelete != old_ctx->nodelete) {\n+\t\tcifs_errorf(fc, \"can not change nodelete during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->cruid_specified &&\n+\t !uid_eq(new_ctx->cred_uid, old_ctx->cred_uid)) {\n+\t\tcifs_errorf(fc, \"can not change cruid during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\t/* init default: port = 0 */\n+\tif (new_ctx->port &&\n+\t new_ctx->port != old_ctx->port) {\n+\t\tcifs_errorf(fc, \"can not change port during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->min_offload != old_ctx->min_offload) {\n+\t\tcifs_errorf(fc, \"can not change min_enc_offload during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->snapshot_time != old_ctx->snapshot_time) {\n+\t\tcifs_errorf(fc, \"can not change snapshot during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->max_credits != old_ctx->max_credits) {\n+\t\tcifs_errorf(fc, \"can not change max_credits during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->handle_timeout != old_ctx->handle_timeout) {\n+\t\tcifs_errorf(fc, \"can not change handletimeout during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->got_ip &&\n+\t !cifs_match_ipaddr((struct sockaddr *)&new_ctx->dstaddr,\n+\t\t\t (struct sockaddr *)&old_ctx->dstaddr)) {\n+\t\tcifs_errorf(fc, \"can not change ip during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (((struct sockaddr *)&new_ctx->srcaddr)->sa_family != AF_UNSPEC &&\n+\t memcmp(&new_ctx->srcaddr, &old_ctx->srcaddr, sizeof(new_ctx->srcaddr))) {\n+\t\tcifs_errorf(fc, \"can not change srcaddr during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\t/* source_rfc1001_name: both init from same nodename, safe to compare */\n+\tif (memcmp(new_ctx->source_rfc1001_name, old_ctx->source_rfc1001_name,\n+\t\t RFC1001_NAME_LEN)) {\n+\t\tcifs_errorf(fc, \"can not change netbiosname during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\t/* init default: target_rfc1001_name[0] = 0 */\n+\tif (new_ctx->target_rfc1001_name[0] &&\n+\t memcmp(new_ctx->target_rfc1001_name, old_ctx->target_rfc1001_name,\n+\t\t RFC1001_NAME_LEN)) {\n+\t\tcifs_errorf(fc, \"can not change servern during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->got_version &&\n+\t (new_ctx->ops != old_ctx->ops || new_ctx->vals != old_ctx->vals)) {\n+\t\tcifs_errorf(fc, \"can not change vers during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->witness != old_ctx->witness) {\n+\t\tcifs_errorf(fc, \"can not change witness during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\t/* init default: rootfs = false */\n+\tif (new_ctx->rootfs &&\n+\t new_ctx->rootfs != old_ctx->rootfs) {\n+\t\tcifs_errorf(fc, \"can not change rootfs during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->linux_ext != old_ctx->linux_ext ||\n+\t new_ctx->no_linux_ext != old_ctx->no_linux_ext) {\n+\t\tcifs_errorf(fc, \"can not change unix during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->nocase != old_ctx->nocase) {\n+\t\tcifs_errorf(fc, \"can not change nocase during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\t/* init default: intr = false */\n+\tif (new_ctx->intr &&\n+\t new_ctx->intr != old_ctx->intr) {\n+\t\tcifs_errorf(fc, \"can not change intr during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\t/* init default: no_psx_acl = 0 */\n+\tif (new_ctx->no_psx_acl &&\n+\t new_ctx->no_psx_acl != old_ctx->no_psx_acl) {\n+\t\tcifs_errorf(fc, \"can not change acl during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->local_lease != old_ctx->local_lease) {\n+\t\tcifs_errorf(fc, \"can not change locallease during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->sign != old_ctx->sign) {\n+\t\tcifs_errorf(fc, \"can not change sign during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->ignore_signature != old_ctx->ignore_signature) {\n+\t\tcifs_errorf(fc, \"can not change ignore_signature during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->seal != old_ctx->seal) {\n+\t\tcifs_errorf(fc, \"can not change seal during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->nosharesock != old_ctx->nosharesock) {\n+\t\tcifs_errorf(fc, \"can not change nosharesock during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\t/*\n+\t * persistent is shown in /proc/mounts (bare !=).\n+\t * nopersistent is NOT shown, so guard with init default check.\n+\t */\n+\tif (new_ctx->persistent != old_ctx->persistent ||\n+\t (new_ctx->nopersistent &&\n+\t new_ctx->nopersistent != old_ctx->nopersistent)) {\n+\t\tcifs_errorf(fc, \"can not change persistenthandles during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->resilient != old_ctx->resilient) {\n+\t\tcifs_errorf(fc, \"can not change resilienthandles during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (new_ctx->sockopt_tcp_nodelay != old_ctx->sockopt_tcp_nodelay) {\n+\t\tcifs_errorf(fc, \"can not change tcpnodelay during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\t/* init default: domainauto = false */\n+\tif (new_ctx->domainauto &&\n+\t new_ctx->domainauto != old_ctx->domainauto) {\n+\t\tcifs_errorf(fc, \"can not change domainauto during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\t/* init default: rdma = false */\n+\tif (new_ctx->rdma &&\n+\t new_ctx->rdma != old_ctx->rdma) {\n+\t\tcifs_errorf(fc, \"can not change rdma during remount\\n\");\n+\t\treturn -EINVAL;\n+\t}\n \n \treturn 0;\n }\n \n+/*\n+ * Sync cifs_sb->ctx with negotiated runtime values for fields that\n+ * cifs_show_options() reads from tcon/server rather than from ctx.\n+ * The mount.cifs helper reads /proc/mounts and feeds these values back\n+ * on remount, so ctx must match the runtime state to avoid false\n+ * rejection by smb3_verify_reconfigure_ctx().\n+ */\n+static void smb3_sync_ctx_from_negotiated(struct cifs_sb_info *cifs_sb)\n+{\n+\tstruct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);\n+\tstruct TCP_Server_Info *server = tcon->ses->server;\n+\tstruct smb3_fs_context *ctx = cifs_sb->ctx;\n+\n+\t/* /proc/mounts shows persistenthandles from tcon->use_persistent */\n+\tif (tcon->use_persistent && !ctx->persistent) {\n+\t\tctx->persistent = true;\n+\t\tctx->nopersistent = false;\n+\t}\n+\t/* /proc/mounts shows resilienthandles from tcon->use_resilient */\n+\tctx->resilient = tcon->use_resilient;\n+\t/* /proc/mounts shows nounix/unix/posix from tcon */\n+\tif (tcon->posix_extensions) {\n+\t\tctx->linux_ext = 1;\n+\t\tctx->no_linux_ext = 0;\n+\t} else if (!tcon->unix_ext) {\n+\t\tctx->linux_ext = 0;\n+\t\tctx->no_linux_ext = 1;\n+\t}\n+\t/* /proc/mounts shows nosharesock from server->nosharesock */\n+\tif (server->nosharesock)\n+\t\tctx->nosharesock = true;\n+\t/*\n+\t * /proc/mounts shows vers= from server->vals->version_string,\n+\t * which reflects the negotiated dialect. When mounted without\n+\t * an explicit vers=, ctx stores smbdefault ops/vals while the\n+\t * server may have negotiated e.g. SMB 3.1.1. Sync so the\n+\t * verify check does not reject the fed-back vers= on remount.\n+\t */\n+\tctx->ops = server->ops;\n+\tctx->vals = server->vals;\n+}\n+\n+/*\n+ * Carry forward non-reconfigurable mount options that are NOT\n+ * displayed by cifs_show_options() into the new remount context\n+ * before smb3_fs_context_dup() overwrites cifs_sb->ctx.\n+ *\n+ * Options that cifs_show_options() outputs are automatically\n+ * re-fed by libmount (which reads /proc/mounts) on remount,\n+ * so they do not need to be preserved here.\n+ *\n+ * Without this, a bare remount would silently reset these hidden\n+ * fields to their init defaults.\n+ */\n+static void smb3_preserve_non_reconfig_opts(struct smb3_fs_context *new_ctx,\n+\t\t\t\t\t struct smb3_fs_context *old_ctx)\n+{\n+\tnew_ctx->compress = old_ctx->compress;\n+\tnew_ctx->port = old_ctx->port;\n+\tnew_ctx->rootfs = old_ctx->rootfs;\n+\tnew_ctx->intr = old_ctx->intr;\n+\tnew_ctx->no_psx_acl = old_ctx->no_psx_acl;\n+\tnew_ctx->domainauto = old_ctx->domainauto;\n+\tnew_ctx->rdma = old_ctx->rdma;\n+\tnew_ctx->nopersistent = old_ctx->nopersistent;\n+\tmemcpy(new_ctx->target_rfc1001_name, old_ctx->target_rfc1001_name,\n+\t RFC1001_NAME_LEN_WITH_NULL);\n+}\n+\n #define STEAL_STRING(cifs_sb, ctx, field)\t\t\t\t\\\n do {\t\t\t\t\t\t\t\t\t\\\n \tkfree(ctx->field);\t\t\t\t\t\t\\\n@@ -1093,6 +1321,8 @@ static int smb3_reconfigure(struct fs_context *fc)\n \tif (ses->expired_pwd)\n \t\tneed_recon = true;\n \n+\tsmb3_sync_ctx_from_negotiated(cifs_sb);\n+\n \trc = smb3_verify_reconfigure_ctx(fc, ctx, cifs_sb->ctx, need_recon);\n \tif (rc)\n \t\treturn rc;\n@@ -1205,6 +1435,8 @@ static int smb3_reconfigure(struct fs_context *fc)\n \tctx->rsize = rsize ? CIFS_ALIGN_RSIZE(fc, rsize) : cifs_sb->ctx->rsize;\n \tctx->wsize = wsize ? CIFS_ALIGN_WSIZE(fc, wsize) : cifs_sb->ctx->wsize;\n \n+\tsmb3_preserve_non_reconfig_opts(ctx, cifs_sb->ctx);\n+\n \tsmb3_cleanup_fs_context_contents(cifs_sb->ctx);\n \trc = smb3_fs_context_dup(cifs_sb->ctx, ctx);\n \tsmb3_update_mnt_flags(cifs_sb);\n", "prefixes": [ "1/9" ] }