Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2234253/?format=api
{ "id": 2234253, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2234253/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260507134448.168602-7-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": "<20260507134448.168602-7-rajasimandalos@gmail.com>", "list_archive_url": null, "date": "2026-05-07T13:44:46", "name": "[v2,6/8] smb: client: allow nolease option to be reconfigured on remount", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "4e4e863b96af079ccc5039a41a72c43a04b319bc", "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/20260507134448.168602-7-rajasimandalos@gmail.com/mbox/", "series": [ { "id": 503184, "url": "http://patchwork.ozlabs.org/api/1.2/series/503184/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=503184", "date": "2026-05-07T13:44:40", "name": "Remount patches v2", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/503184/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2234253/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2234253/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-11415-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=I5IvvLol;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-cifs+bounces-11415-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=\"I5IvvLol\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.216.50", "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 sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBD5p6Fjsz1y04\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 07 May 2026 23:45:18 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 7CF493003624\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 7 May 2026 13:45:16 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 3DB273F7878;\n\tThu, 7 May 2026 13:45:15 +0000 (UTC)", "from mail-pj1-f50.google.com (mail-pj1-f50.google.com\n [209.85.216.50])\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 C43383F54AD\n\tfor <linux-cifs@vger.kernel.org>; Thu, 7 May 2026 13:45:13 +0000 (UTC)", "by mail-pj1-f50.google.com with SMTP id\n 98e67ed59e1d1-366330b6751so162078a91.1\n for <linux-cifs@vger.kernel.org>;\n Thu, 07 May 2026 06:45:13 -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 98e67ed59e1d1-365b4c8a8e7sm8316609a91.13.2026.05.07.06.45.09\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 07 May 2026 06:45:11 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778161515; cv=none;\n b=tN+EoRcsVYt3HIcaCUV0y8SZShA3+G42W9PKyDydrnpot3kGK3mT9oIt+AnfGWN8/3No+/nGks1cmDU7sjMs01ey+9pLX4wg3uHbP7wPSNF6q1376Wkciqo6AizjCffu0NX5jJo0XRNOt2F44joe9D2fmibusAj6e71dAuvbt5g=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778161515; c=relaxed/simple;\n\tbh=YZc6dnL6ScN6M9zfwr03lJvePA6UD9W9i/GwXSHIKEw=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Gts7HL39BB6LFnmbfwxuDNsjwrCouRx22MN6f3pi4FNI5FMsc3QARRaYWwhQORdF7p7RFpVqGNBfolrb7KW4YcpVRTVqnNoHQ/zBsicVzognpPHzmTFkXfqXWeavng+rCQrvGv1tyXfeuc/04wCPCbpolaWPaUq+dpZw83obSaE=", "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=I5IvvLol; arc=none smtp.client-ip=209.85.216.50", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1778161513; x=1778766313;\n darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=zZv6TKeVYbBMMgwVmFzJrgb9YvlsmZ81FdayKJqs7qY=;\n b=I5IvvLolenKLxk4DS2wRjC40ztySLCYoMGf5vvbH8OVar/s9Qy+/PWY+cZEqo9YqU8\n 6oKOxZtei1cPvTjmOJ9XgaJAKxNqQX0KxgIfIspu4cevaZGYPzGx2QoqDc/hyj09m+jX\n Sy3x3otFcwIgyfEFcg/RyFgoMLC84sqdujBJrLBLXkgaARUvwqABpWZ18SKBvvPYntVx\n SW4BU8N+AZ8k/fLumbIfn1L4XsrhlDx85N/PoemCN+dAIpy+EiABX4hEbdTn9MaOqVha\n wibHg98uIgLPgMFN0mumc9NZJuP6L3qul+AXK043to4VuLed83VuET8aiMHzz7jaCfmQ\n gtlw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778161513; x=1778766313;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=zZv6TKeVYbBMMgwVmFzJrgb9YvlsmZ81FdayKJqs7qY=;\n b=fgKArszOD/jp0XPWHeO/FrpQxXih/iK1LsZA40gtmULGjvtCTPLnz6a7RFX7uAKR6+\n GJO41grpmsvZm3ggg/KmBYIpgjWLkdADhx+lXAKMs5syVeIwYgoT9uY1ZtokFdCVHGMV\n ZLyz5rwjzCcmpySe77UTW3BY4ja2vyBUHrWEgap5QBIEeV6tIvOJwip6b3fdR/zTVjm/\n g1aFl47o/Gky0M8S6rabsIg8s4xptshNQZrZKn39aZ3+1EFSSyNsOWXKYKSZDCtcoJHn\n ay9xI5Q2tjp7mpYKXNp7Sufggisy1A5kh34yFeiCExIacFaXG88K7bwacrUC3a2/JBQI\n bGXA==", "X-Gm-Message-State": "AOJu0YzhggizuMlYCDusMjeT0roFy8xsMvzXl+bRUFjtCgE8XIe/DOUb\n\tdf7hz0IPFmJspFBSM64RDJNMINMGMpiTYsCaPYHhCUFG2iCK6SjUKpXdsJKUIA==", "X-Gm-Gg": "AeBDiesGHU+HbJdg4NPpfCQDf3hiifAUS+6ChhAWdm35HO/9FH0/wnoLJYXIBH1cKwQ\n\tONCrsqd+D0ygtSmE896Tnn4K8KilPvDeV2jsNFwkDx38QQPba6PADmLZxs014rfFfkMZqPVTL+9\n\tmuuYHVEPNmCQvMk+Qn1072q+R6CyH9q5v8tgly2RMj38OlfhcJCtFTZeVHK81BnnYyofYMyKwMY\n\tAic7wloeU6w9QFNXiC44Q3IP3XPF5Npr63DQLsp4RY4bt09zKMBrx0WIb9A58sgBU/BnD4cbXjs\n\tEBjbw7ZPD7sq9zk0ZDgno6rG2qyYr0k0VkMtJDJz4XihHbG2ZAC32Mr11P8sdoesGMfJtmJOx9i\n\tgkdoQ5/cC6BaMlnVsWa7z0IHnu3t2xUldZIj2OUF1YwhRadfn8pkr7qSOKeRzZqsLqjIoNPBo7A\n\tCGP3OoIo1JQpZJyr7B6sIMKLNA0nLX+MxDnyAfS5jCmimKEoXQ5lx19npvbbSTNwHbfMeDJrENH\n\tLWPXKi2felj28Z9D1AZbyHE5gvwVBwhtA==", "X-Received": "by 2002:a17:90b:2691:b0:359:fe72:3559 with SMTP id\n 98e67ed59e1d1-365ac46dc62mr8522471a91.21.1778161512574;\n Thu, 07 May 2026 06:45:12 -0700 (PDT)", "From": "rajasimandalos@gmail.com", "To": "linux-cifs@vger.kernel.org", "Cc": "smfrench@gmail.com,\n\tpc@manguebit.org,\n\tsprasad@microsoft.com,\n\tbharathsm@microsoft.com,\n\tenzo@kernel.org", "Subject": "[PATCH v2 6/8] smb: client: allow nolease option to be reconfigured\n on remount", "Date": "Thu, 7 May 2026 13:44:46 +0000", "Message-ID": "<20260507134448.168602-7-rajasimandalos@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260507134448.168602-1-rajasimandalos@gmail.com>", "References": "<20260507134448.168602-1-rajasimandalos@gmail.com>", "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\nChanging nolease via remount is silently accepted but has no effect:\nthe value is not propagated to the live tcon, and stale lease-bearing\nstate from before the switch keeps using the old behavior.\n\nMake nolease take effect on remount:\n\n - Propagate ctx->no_lease to tcon->no_lease in smb3_sync_tcon_opts()\n so future opens honor the new setting.\n\n - On switch to nolease, drop deferred file handles via\n cifs_close_all_deferred_files_sb() (each holds an active lease).\n\n - On switch to nolease, evict cached directory fids via the new\n invalidate_all_cached_dirs_sb() helper (each holds a directory\n lease).\n\ninvalidate_all_cached_dirs_sb() mirrors cifs_close_all_deferred_files_sb():\ntake tc_count refs on every tcon under tlink_tree_lock, drop the lock,\nthen call invalidate_all_cached_dirs() per tcon (it can sleep). Two\nnew tcon_ref trace tags are added for the audit trail.\n\nExisting open handles keep their leases until the server breaks them\nor userspace closes the file -- nolease only governs new opens.\n\nSigned-off-by: Rajasi Mandal <rajasimandal@microsoft.com>\n---\n fs/smb/client/cached_dir.c | 44 ++++++++++++++++++++++++++++++++++++++\n fs/smb/client/cached_dir.h | 1 +\n fs/smb/client/fs_context.c | 22 +++++++++++++++++++\n fs/smb/client/trace.h | 2 ++\n 4 files changed, 69 insertions(+)", "diff": "diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c\nindex 88d5e9a32f28..58d68a8f4d41 100644\n--- a/fs/smb/client/cached_dir.c\n+++ b/fs/smb/client/cached_dir.c\n@@ -637,6 +637,50 @@ void invalidate_all_cached_dirs(struct cifs_tcon *tcon, bool sync)\n \t\tflush_delayed_work(&cfids->laundromat_work);\n }\n \n+/*\n+ * Invalidate cached directory entries across all tcons under a\n+ * superblock. Collect references on each tcon under tlink_tree_lock,\n+ * then call invalidate_all_cached_dirs() outside the spinlock since it\n+ * can sleep. Holding a tc_count reference prevents the tcon from being\n+ * freed by tlink_expire_delayed() between dropping the spinlock and\n+ * the call.\n+ */\n+void invalidate_all_cached_dirs_sb(struct cifs_sb_info *cifs_sb)\n+{\n+\tstruct rb_root *root = &cifs_sb->tlink_tree;\n+\tstruct rb_node *node;\n+\tstruct cifs_tcon *tcon;\n+\tstruct tcon_link *tlink;\n+\tstruct tcon_list *tmp_list, *q;\n+\tLIST_HEAD(tcon_head);\n+\n+\tspin_lock(&cifs_sb->tlink_tree_lock);\n+\tfor (node = rb_first(root); node; node = rb_next(node)) {\n+\t\ttlink = rb_entry(node, struct tcon_link, tl_rbnode);\n+\t\ttcon = tlink_tcon(tlink);\n+\t\tif (IS_ERR(tcon))\n+\t\t\tcontinue;\n+\t\ttmp_list = kmalloc_obj(struct tcon_list, GFP_ATOMIC);\n+\t\tif (!tmp_list)\n+\t\t\tbreak;\n+\t\ttmp_list->tcon = tcon;\n+\t\tspin_lock(&tcon->tc_lock);\n+\t\t++tcon->tc_count;\n+\t\ttrace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count,\n+\t\t\t\t netfs_trace_tcon_ref_get_cached_inval_sb);\n+\t\tspin_unlock(&tcon->tc_lock);\n+\t\tlist_add_tail(&tmp_list->entry, &tcon_head);\n+\t}\n+\tspin_unlock(&cifs_sb->tlink_tree_lock);\n+\n+\tlist_for_each_entry_safe(tmp_list, q, &tcon_head, entry) {\n+\t\tinvalidate_all_cached_dirs(tmp_list->tcon, true);\n+\t\tlist_del(&tmp_list->entry);\n+\t\tcifs_put_tcon(tmp_list->tcon, netfs_trace_tcon_ref_put_cached_inval_sb);\n+\t\tkfree(tmp_list);\n+\t}\n+}\n+\n static void\n cached_dir_offload_close(struct work_struct *work)\n {\ndiff --git a/fs/smb/client/cached_dir.h b/fs/smb/client/cached_dir.h\nindex fc756836da95..606ba2a0b64f 100644\n--- a/fs/smb/client/cached_dir.h\n+++ b/fs/smb/client/cached_dir.h\n@@ -90,6 +90,7 @@ void close_cached_dir(struct cached_fid *cfid);\n void drop_cached_dir_by_name(const unsigned int xid, struct cifs_tcon *tcon,\n \t\t\t const char *name, struct cifs_sb_info *cifs_sb);\n void close_all_cached_dirs(struct cifs_sb_info *cifs_sb);\n+void invalidate_all_cached_dirs_sb(struct cifs_sb_info *cifs_sb);\n void invalidate_all_cached_dirs(struct cifs_tcon *tcon, bool sync);\n bool cached_dir_lease_break(struct cifs_tcon *tcon, __u8 lease_key[16]);\n \ndiff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c\nindex 972d3969f7e7..01c57adb0ef1 100644\n--- a/fs/smb/client/fs_context.c\n+++ b/fs/smb/client/fs_context.c\n@@ -35,6 +35,7 @@\n #include \"nterr.h\"\n #include \"rfc1002pdu.h\"\n #include \"fs_context.h\"\n+#include \"cached_dir.h\"\n \n DEFINE_MUTEX(cifs_mount_mutex);\n \n@@ -1286,6 +1287,7 @@ static void smb3_sync_tcon_opts(struct cifs_sb_info *cifs_sb,\n \n \t\tspin_lock(&tcon->tc_lock);\n \t\ttcon->retry = ctx->retry;\n+\t\ttcon->no_lease = ctx->no_lease;\n \t\t/*\n \t\t * Note: this updates the limit for new cached dir opens\n \t\t * but does not resize or evict existing cached dirents.\n@@ -1294,6 +1296,26 @@ static void smb3_sync_tcon_opts(struct cifs_sb_info *cifs_sb,\n \t\tspin_unlock(&tcon->tc_lock);\n \t}\n \tspin_unlock(&cifs_sb->tlink_tree_lock);\n+\n+\t/*\n+\t * When switching to nolease, close deferred file handles and\n+\t * invalidate cached directory entries. Both hold leases from\n+\t * before the switch; without cleaning them up, those handles\n+\t * continue using lease-based caching despite nolease being set.\n+\t *\n+\t * Note: files already open with leases (e.g. RWH) by applications\n+\t * are not affected -- nolease only governs new opens. Existing\n+\t * handles retain their leases until the server sends a lease break\n+\t * or the application closes the handle.\n+\t *\n+\t * Both _sb() helpers iterate all tcons internally and handle\n+\t * their own locking. They can sleep, so they must be called\n+\t * outside tlink_tree_lock.\n+\t */\n+\tif (ctx->no_lease) {\n+\t\tcifs_close_all_deferred_files_sb(cifs_sb);\n+\t\tinvalidate_all_cached_dirs_sb(cifs_sb);\n+\t}\n }\n \n /*\ndiff --git a/fs/smb/client/trace.h b/fs/smb/client/trace.h\nindex b99ec5a417fa..cec34e69e191 100644\n--- a/fs/smb/client/trace.h\n+++ b/fs/smb/client/trace.h\n@@ -173,6 +173,7 @@\n \tEM(netfs_trace_tcon_ref_free_ipc,\t\t\"FRE Ipc \") \\\n \tEM(netfs_trace_tcon_ref_free_ipc_fail,\t\t\"FRE Ipc-F \") \\\n \tEM(netfs_trace_tcon_ref_free_reconnect_server,\t\"FRE Reconn\") \\\n+\tEM(netfs_trace_tcon_ref_get_cached_inval_sb,\t\"GET Ch-IvS\") \\\n \tEM(netfs_trace_tcon_ref_get_cached_laundromat,\t\"GET Ch-Lau\") \\\n \tEM(netfs_trace_tcon_ref_get_cached_lease_break,\t\"GET Ch-Lea\") \\\n \tEM(netfs_trace_tcon_ref_get_cancelled_close,\t\"GET Cn-Cls\") \\\n@@ -185,6 +186,7 @@\n \tEM(netfs_trace_tcon_ref_new_ipc,\t\t\"NEW Ipc \") \\\n \tEM(netfs_trace_tcon_ref_new_reconnect_server,\t\"NEW Reconn\") \\\n \tEM(netfs_trace_tcon_ref_put_cached_close,\t\"PUT Ch-Cls\") \\\n+\tEM(netfs_trace_tcon_ref_put_cached_inval_sb,\t\"PUT Ch-IvS\") \\\n \tEM(netfs_trace_tcon_ref_put_cancelled_close,\t\"PUT Cn-Cls\") \\\n \tEM(netfs_trace_tcon_ref_put_cancelled_close_fid, \"PUT Cn-Fid\") \\\n \tEM(netfs_trace_tcon_ref_put_cancelled_mid,\t\"PUT Cn-Mid\") \\\n", "prefixes": [ "v2", "6/8" ] }