get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2225699/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2225699,
    "url": "http://patchwork.ozlabs.org/api/patches/2225699/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260421170524.266984-1-ematsumiya@suse.de/",
    "project": {
        "id": 12,
        "url": "http://patchwork.ozlabs.org/api/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": "<20260421170524.266984-1-ematsumiya@suse.de>",
    "list_archive_url": null,
    "date": "2026-04-21T17:05:24",
    "name": "smb: client: fix (remove) drop_dir_cache module parameter",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "36cb0254ee4fbec0630e59deee732577dd25a9f5",
    "submitter": {
        "id": 78375,
        "url": "http://patchwork.ozlabs.org/api/people/78375/?format=api",
        "name": "Enzo Matsumiya",
        "email": "ematsumiya@suse.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260421170524.266984-1-ematsumiya@suse.de/mbox/",
    "series": [
        {
            "id": 500795,
            "url": "http://patchwork.ozlabs.org/api/series/500795/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=500795",
            "date": "2026-04-21T17:05:24",
            "name": "smb: client: fix (remove) drop_dir_cache module parameter",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500795/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2225699/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2225699/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-10983-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 (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=PQQv364u;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=v53PWA4W;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=PQQv364u;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=v53PWA4W;\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-10983-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"PQQv364u\";\n\tdkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"v53PWA4W\";\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"PQQv364u\";\n\tdkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"v53PWA4W\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=195.135.223.131",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=suse.de",
            "smtp-out2.suse.de;\n\tdkim=pass header.d=suse.de header.s=susede2_rsa header.b=PQQv364u;\n\tdkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=v53PWA4W"
        ],
        "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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0MY20Spkz1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 22:46:14 +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 12DE9303879A\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 12:39:34 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 608DB3D3311;\n\tTue, 21 Apr 2026 12:39:30 +0000 (UTC)",
            "from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])\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 058553D331E\n\tfor <linux-cifs@vger.kernel.org>; Tue, 21 Apr 2026 12:39:23 +0000 (UTC)",
            "from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby smtp-out2.suse.de (Postfix) with ESMTPS id A48245BE05;\n\tTue, 21 Apr 2026 12:39:20 +0000 (UTC)",
            "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8FDC6593AF;\n\tTue, 21 Apr 2026 12:39:20 +0000 (UTC)",
            "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n\tby imap1.dmz-prg2.suse.org with ESMTPSA\n\tid 3a+/Ifhv52k9XQAAD6G6ig\n\t(envelope-from <ematsumiya@suse.de>); Tue, 21 Apr 2026 12:39:20 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776775169; cv=none;\n b=LKMpLsYCViZq1LSFZ9WL2waqUnTdztGUbDv0T82lcC5Sk4E2Ma1xi0NJxVags+d/vv1s9/GCsAZfIAAxLIOIV2cSH9sMPMvzevFjh65OHx/x30jum8bFVGU/Tl41adOQl8cWdvNGoA+DESYAt6pl055Jt+tNjYzWmAs6VpeWYpY=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776775169; c=relaxed/simple;\n\tbh=FvJNOGU7MsDYoheWkBb97ajGZ9xre/oYxy1tshjVmbY=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=O+RaRqU31KMFcneywvMPw5gIsLHbTA5W0myOuxF/EXToPJnvzBu5GLEXAegn6FOjvE3lapTSkyMqkzHtB7LO9v/mvT5As8/ZMz1GRaLHM/225+H+pOseSzIqSXXbf3FSsg5NFEBXQIR4RRejPL71M/3tGITF5QIEEgWp8EXAmMc=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de;\n spf=pass smtp.mailfrom=suse.de;\n dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=PQQv364u;\n dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=v53PWA4W;\n dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=PQQv364u;\n dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=v53PWA4W; arc=none smtp.client-ip=195.135.223.131",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n\tt=1776775160;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n  content-transfer-encoding:content-transfer-encoding;\n\tbh=1qkTUVyVBLSrMYm3CtYmpvyhe/WleMKOiSQdzfUBphc=;\n\tb=PQQv364u5l41rqaTE0dlo/4wOr+BbsQQp+p6h2XzMm2LAhNXq2yiTEGJrvB5H7jZ/NSY8w\n\tjq+FgtladKsvKF+xUWGz/3fpNrcdYFClGj4cYoIFQ5eBZ1gsN2To8HmaJof034GRkWhAtk\n\tUTfH2m6GZx1H0sXkpo+EFVouqG2skK0=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n\ts=susede2_ed25519; t=1776775160;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n  content-transfer-encoding:content-transfer-encoding;\n\tbh=1qkTUVyVBLSrMYm3CtYmpvyhe/WleMKOiSQdzfUBphc=;\n\tb=v53PWA4WuBaxREQbWMsLIrefHoQSuXhJLQ5GPgy1Ov7YbiYR9kSKOx0Y8Tp1AtkvmYWcJF\n\tmWd8Kw5jmeX5A5BA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n\tt=1776775160;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n  content-transfer-encoding:content-transfer-encoding;\n\tbh=1qkTUVyVBLSrMYm3CtYmpvyhe/WleMKOiSQdzfUBphc=;\n\tb=PQQv364u5l41rqaTE0dlo/4wOr+BbsQQp+p6h2XzMm2LAhNXq2yiTEGJrvB5H7jZ/NSY8w\n\tjq+FgtladKsvKF+xUWGz/3fpNrcdYFClGj4cYoIFQ5eBZ1gsN2To8HmaJof034GRkWhAtk\n\tUTfH2m6GZx1H0sXkpo+EFVouqG2skK0=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n\ts=susede2_ed25519; t=1776775160;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n  content-transfer-encoding:content-transfer-encoding;\n\tbh=1qkTUVyVBLSrMYm3CtYmpvyhe/WleMKOiSQdzfUBphc=;\n\tb=v53PWA4WuBaxREQbWMsLIrefHoQSuXhJLQ5GPgy1Ov7YbiYR9kSKOx0Y8Tp1AtkvmYWcJF\n\tmWd8Kw5jmeX5A5BA=="
        ],
        "From": "Enzo Matsumiya <ematsumiya@suse.de>",
        "To": "linux-cifs@vger.kernel.org",
        "Cc": "smfrench@gmail.com,\n\tpc@manguebit.com,\n\tronniesahlberg@gmail.com,\n\tsprasad@microsoft.com,\n\ttom@talpey.com,\n\tbharathsm@microsoft.com,\n\thenrique.carvalho@suse.com",
        "Subject": "[PATCH] smb: client: fix (remove) drop_dir_cache module parameter",
        "Date": "Tue, 21 Apr 2026 14:05:24 -0300",
        "Message-ID": "<20260421170524.266984-1-ematsumiya@suse.de>",
        "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",
        "X-Spamd-Bar": "/",
        "X-Rspamd-Queue-Id": "A48245BE05",
        "X-Rspamd-Action": "no action",
        "X-Spam-Flag": "NO",
        "X-Spam-Score": "0.99",
        "X-Spam-Level": "",
        "X-Rspamd-Server": "rspamd1.dmz-prg2.suse.org",
        "X-Spamd-Result": "default: False [0.99 / 50.00];\n\tDATE_IN_FUTURE(4.00)[4];\n\tBAYES_HAM(-3.00)[100.00%];\n\tMID_CONTAINS_FROM(1.00)[];\n\tNEURAL_HAM_LONG(-1.00)[-1.000];\n\tR_MISSING_CHARSET(0.50)[];\n\tR_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n\tNEURAL_HAM_SHORT(-0.20)[-0.999];\n\tMIME_GOOD(-0.10)[text/plain];\n\tMX_GOOD(-0.01)[];\n\tMIME_TRACE(0.00)[0:+];\n\tTO_MATCH_ENVRCPT_ALL(0.00)[];\n\tARC_NA(0.00)[];\n\tFUZZY_RATELIMITED(0.00)[rspamd.com];\n\tDKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n\tRCVD_TLS_ALL(0.00)[];\n\tSPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n\tRCVD_COUNT_TWO(0.00)[2];\n\tFROM_EQ_ENVFROM(0.00)[];\n\tFROM_HAS_DN(0.00)[];\n\tFREEMAIL_CC(0.00)[gmail.com,manguebit.com,microsoft.com,talpey.com,suse.com];\n\tTO_DN_NONE(0.00)[];\n\tRCPT_COUNT_SEVEN(0.00)[8];\n\tDBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:dkim,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];\n\tDKIM_TRACE(0.00)[suse.de:+];\n\tRCVD_VIA_SMTP_AUTH(0.00)[];\n\tFREEMAIL_ENVRCPT(0.00)[gmail.com]"
    },
    "content": "Being a module parameter, it's possible to do:\n\n  # modprobe cifs drop_dir_cache=1\n\nWhich will lead to a crash, because cifs_tcp_ses_list hasn't been\ninitialized yet:\n\n  [  168.242624] BUG: kernel NULL pointer dereference, address: 0000000000000010\n  [  168.242952] #PF: supervisor read access in kernel mode\n  [  168.243175] #PF: error_code(0x0000) - not-present page\n  [  168.243394] PGD 0 P4D 0\n  [  168.243524] Oops: Oops: 0000 [#1] SMP NOPTI\n  [  168.243703] CPU: 2 UID: 0 PID: 1105 Comm: modprobe Not tainted 7.0.0-lku #5 PREEMPT(lazy)\n  [  168.244054] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.17.0-2-g4f253b9b-prebuilt.qemu.org 04/01/2014\n  [  168.244557] RIP: 0010:cifs_param_set_drop_dir_cache+0x7c/0x100 [cifs]\n  ...\n  [  168.248785] Call Trace:\n  [  168.248915]  <TASK>\n  [  168.249023]  parse_args+0x285/0x3a0\n  [  168.249204]  ? __pfx_unknown_module_param_cb+0x10/0x10\n  [  168.249448]  load_module+0x192b/0x1bb0\n  [  168.249637]  ? __pfx_unknown_module_param_cb+0x10/0x10\n  [  168.249882]  ? kernel_read_file+0x27d/0x2b0\n  [  168.250088]  init_module_from_file+0xce/0xf0\n  [  168.250291]  idempotent_init_module+0xfb/0x2f0\n  [  168.250496]  __x64_sys_finit_module+0x5a/0xa0\n  [  168.250694]  do_syscall_64+0xe0/0x5a0\n  [  168.250863]  ? exc_page_fault+0x65/0x160\n  [  168.251050]  entry_SYSCALL_64_after_hwframe+0x77/0x7f\n  [  168.251284] RIP: 0033:0x7fcaa12b774d\n\nInstead of fixing this with some kind of \"is module initialized\"\napproach, this patch instead moves that functionality to procfs,\nsetting a write op for the existing open_dirs entry, where\nwriting a 0 to it will drop the cached directory entries.\n\nAlso make it available only when CONFIG_CIFS_DEBUG2=y.\n\nA small change needed now is to not call flush_delayed_work()\non invalidate_all_cached_dirs() when called from procfs (can't sleep in\nthat context).\nSo add a @sync arg to invalidate_all_cached_dirs() to control when to\nflush the delayed works.\n\nFixes: dde6667fa3c8 (\"smb: client: add drop_dir_cache module parameter to invalidate cached dirents\")\nSigned-off-by: Enzo Matsumiya <ematsumiya@suse.de>\n---\n fs/smb/client/cached_dir.c |  5 ++--\n fs/smb/client/cached_dir.h |  2 +-\n fs/smb/client/cifs_debug.c | 59 ++++++++++++++++++++++++++++++++++++--\n fs/smb/client/cifsfs.c     | 37 ------------------------\n fs/smb/client/file.c       |  2 +-\n fs/smb/client/smb2pdu.c    |  2 +-\n 6 files changed, 62 insertions(+), 45 deletions(-)",
    "diff": "diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c\nindex 04bb95091f49..02791ec3c5a1 100644\n--- a/fs/smb/client/cached_dir.c\n+++ b/fs/smb/client/cached_dir.c\n@@ -593,7 +593,7 @@ void close_all_cached_dirs(struct cifs_sb_info *cifs_sb)\n  * Invalidate all cached dirs when a TCON has been reset\n  * due to a session loss.\n  */\n-void invalidate_all_cached_dirs(struct cifs_tcon *tcon)\n+void invalidate_all_cached_dirs(struct cifs_tcon *tcon, bool sync)\n {\n \tstruct cached_fids *cfids = tcon->cfids;\n \tstruct cached_fid *cfid, *q;\n@@ -625,7 +625,8 @@ void invalidate_all_cached_dirs(struct cifs_tcon *tcon)\n \n \t/* run laundromat unconditionally now as there might have been previously queued work */\n \tmod_delayed_work(cfid_put_wq, &cfids->laundromat_work, 0);\n-\tflush_delayed_work(&cfids->laundromat_work);\n+\tif (sync)\n+\t\tflush_delayed_work(&cfids->laundromat_work);\n }\n \n static void\ndiff --git a/fs/smb/client/cached_dir.h b/fs/smb/client/cached_dir.h\nindex 19d5592512e4..fc756836da95 100644\n--- a/fs/smb/client/cached_dir.h\n+++ b/fs/smb/client/cached_dir.h\n@@ -90,7 +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(struct cifs_tcon *tcon);\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 \n #endif\t\t\t/* _CACHED_DIR_H */\ndiff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c\nindex 0691d2a3e04b..0c90eba9278d 100644\n--- a/fs/smb/client/cifs_debug.c\n+++ b/fs/smb/client/cifs_debug.c\n@@ -306,6 +306,9 @@ static int cifs_debug_dirs_proc_show(struct seq_file *m, void *v)\n \tLIST_HEAD(entry);\n \n \tseq_puts(m, \"# Version:1\\n\");\n+#ifdef CONFIG_CIFS_DEBUG2\n+\tseq_puts(m, \"# Write 0 to this file to drop all cached directory entries\\n\");\n+#endif /* CONFIG_CIFS_DEBUG2 */\n \tseq_puts(m, \"# Format:\\n\");\n \tseq_puts(m, \"# <tree id> <sess id> <persistent fid> <lease-key> <path>\\n\");\n \n@@ -353,6 +356,54 @@ static int cifs_debug_dirs_proc_show(struct seq_file *m, void *v)\n \treturn 0;\n }\n \n+#ifdef CONFIG_CIFS_DEBUG2\n+static int cifs_debug_dirs_proc_open(struct inode *inode, struct file *file)\n+{\n+\treturn single_open(file, cifs_debug_dirs_proc_show, NULL);\n+}\n+\n+/* Drop all cached directory entries across all CIFS mounts. */\n+static ssize_t cifs_debug_dirs_proc_write(struct file *file, const char __user *buffer,\n+\t\t\t\t\t  size_t count, loff_t *ppos)\n+{\n+\tint rc, v;\n+\n+\tif (!IS_ENABLED(CONFIG_CIFS_DEBUG2))\n+\t\treturn -EOPNOTSUPP;\n+\n+\trc = kstrtoint_from_user(buffer, count, 10, &v);\n+\tif (rc)\n+\t\treturn rc;\n+\n+\tif (v == 0) {\n+\t\tstruct TCP_Server_Info *server;\n+\t\tstruct cifs_ses *ses;\n+\t\tstruct cifs_tcon *tcon;\n+\n+\t\tspin_lock(&cifs_tcp_ses_lock);\n+\t\tlist_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {\n+\t\t\tlist_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {\n+\t\t\t\tif (cifs_ses_exiting(ses))\n+\t\t\t\t\tcontinue;\n+\t\t\t\tlist_for_each_entry(tcon, &ses->tcon_list, tcon_list)\n+\t\t\t\t\tinvalidate_all_cached_dirs(tcon, false);\n+\t\t\t}\n+\t\t}\n+\t\tspin_unlock(&cifs_tcp_ses_lock);\n+\t}\n+\n+\treturn count;\n+}\n+\n+static const struct proc_ops cifs_debug_dirs_proc_ops = {\n+\t.proc_open\t= cifs_debug_dirs_proc_open,\n+\t.proc_read\t= seq_read,\n+\t.proc_lseek\t= seq_lseek,\n+\t.proc_release\t= single_release,\n+\t.proc_write\t= cifs_debug_dirs_proc_write,\n+};\n+#endif /* CONFIG_CIFS_DEBUG2 */\n+\n static __always_inline const char *compression_alg_str(__le16 alg)\n {\n \tswitch (alg) {\n@@ -885,9 +936,11 @@ cifs_proc_init(void)\n \tproc_create_single(\"open_files\", 0400, proc_fs_cifs,\n \t\t\tcifs_debug_files_proc_show);\n \n-\tproc_create_single(\"open_dirs\", 0400, proc_fs_cifs,\n-\t\t\tcifs_debug_dirs_proc_show);\n-\n+#ifdef CONFIG_CIFS_DEBUG2\n+\tproc_create(\"open_dirs\", 0644, proc_fs_cifs, &cifs_debug_dirs_proc_ops);\n+#else /* CONFIG_CIFS_DEBUG2 */\n+\tproc_create_single(\"open_dirs\", 0400, proc_fs_cifs, cifs_debug_dirs_proc_show);\n+#endif /* !CONFIG_CIFS_DEBUG2 */\n \tproc_create(\"Stats\", 0644, proc_fs_cifs, &cifs_stats_proc_ops);\n \tproc_create(\"cifsFYI\", 0644, proc_fs_cifs, &cifsFYI_proc_ops);\n \tproc_create(\"traceSMB\", 0644, proc_fs_cifs, &traceSMB_proc_ops);\ndiff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c\nindex 081fc1f9447d..9f76b0347fa9 100644\n--- a/fs/smb/client/cifsfs.c\n+++ b/fs/smb/client/cifsfs.c\n@@ -127,43 +127,6 @@ atomic64_t cifs_dircache_bytes_used = ATOMIC64_INIT(0);\n atomic_t cifs_sillycounter;\n atomic_t cifs_tmpcounter;\n \n-/*\n- * Write-only module parameter to drop all cached directory entries across\n- * all CIFS mounts. Echo a non-zero value to trigger.\n- */\n-static void cifs_drop_all_dir_caches(void)\n-{\n-\tstruct TCP_Server_Info *server;\n-\tstruct cifs_ses *ses;\n-\tstruct cifs_tcon *tcon;\n-\n-\tspin_lock(&cifs_tcp_ses_lock);\n-\tlist_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {\n-\t\tlist_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {\n-\t\t\tif (cifs_ses_exiting(ses))\n-\t\t\t\tcontinue;\n-\t\t\tlist_for_each_entry(tcon, &ses->tcon_list, tcon_list)\n-\t\t\t\tinvalidate_all_cached_dirs(tcon);\n-\t\t}\n-\t}\n-\tspin_unlock(&cifs_tcp_ses_lock);\n-}\n-\n-static int cifs_param_set_drop_dir_cache(const char *val, const struct kernel_param *kp)\n-{\n-\tbool bv;\n-\tint rc = kstrtobool(val, &bv);\n-\n-\tif (rc)\n-\t\treturn rc;\n-\tif (bv)\n-\t\tcifs_drop_all_dir_caches();\n-\treturn 0;\n-}\n-\n-module_param_call(drop_dir_cache, cifs_param_set_drop_dir_cache, NULL, NULL, 0200);\n-MODULE_PARM_DESC(drop_dir_cache, \"Write 1 to drop all cached directory entries across all CIFS mounts\");\n-\n #ifdef CONFIG_CIFS_STATS2\n unsigned int slow_rsp_threshold = 1;\n module_param(slow_rsp_threshold, uint, 0644);\ndiff --git a/fs/smb/client/file.c b/fs/smb/client/file.c\nindex f743f058667f..664a2c223089 100644\n--- a/fs/smb/client/file.c\n+++ b/fs/smb/client/file.c\n@@ -393,7 +393,7 @@ cifs_mark_open_files_invalid(struct cifs_tcon *tcon)\n \t}\n \tspin_unlock(&tcon->open_file_lock);\n \n-\tinvalidate_all_cached_dirs(tcon);\n+\tinvalidate_all_cached_dirs(tcon, true);\n \tspin_lock(&tcon->tc_lock);\n \tif (tcon->status == TID_IN_FILES_INVALIDATE)\n \t\ttcon->status = TID_NEED_TCON;\ndiff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c\nindex cd8b49722149..cb61051f9af3 100644\n--- a/fs/smb/client/smb2pdu.c\n+++ b/fs/smb/client/smb2pdu.c\n@@ -2257,7 +2257,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)\n \t}\n \tspin_unlock(&ses->chan_lock);\n \n-\tinvalidate_all_cached_dirs(tcon);\n+\tinvalidate_all_cached_dirs(tcon, true);\n \n \trc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, server,\n \t\t\t\t (void **) &req,\n",
    "prefixes": []
}