get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2231758,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2231758/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260501112023.338005-19-sprasad@microsoft.com/",
    "project": {
        "id": 12,
        "url": "http://patchwork.ozlabs.org/api/1.1/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": ""
    },
    "msgid": "<20260501112023.338005-19-sprasad@microsoft.com>",
    "date": "2026-05-01T11:20:22",
    "name": "[v4,19/19] cifs: invalidate cached_dirents if population aborted",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "558aed8c1aba3817b237da0cd0632a7712a019b5",
    "submitter": {
        "id": 79368,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/79368/?format=api",
        "name": "Shyam Prasad N",
        "email": "nspmangalore@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260501112023.338005-19-sprasad@microsoft.com/mbox/",
    "series": [
        {
            "id": 502444,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502444/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=502444",
            "date": "2026-05-01T11:20:06",
            "name": "[v4,01/19] cifs: change_conf needs to be called for session setup",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/502444/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2231758/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231758/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-11344-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=l6ZV99db;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-cifs+bounces-11344-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=\"l6ZV99db\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.210.182",
            "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 sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::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 4g6TLc6cYSz1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 21:28:24 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 8DCAA3058E16\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  1 May 2026 11:23:05 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C66A339EF07;\n\tFri,  1 May 2026 11:20:55 +0000 (UTC)",
            "from mail-pf1-f182.google.com (mail-pf1-f182.google.com\n [209.85.210.182])\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 573043A1684\n\tfor <linux-cifs@vger.kernel.org>; Fri,  1 May 2026 11:20:54 +0000 (UTC)",
            "by mail-pf1-f182.google.com with SMTP id\n d2e1a72fcca58-835066ef130so898343b3a.1\n        for <linux-cifs@vger.kernel.org>;\n Fri, 01 May 2026 04:20:54 -0700 (PDT)",
            "from sprasad-dev1.corp.microsoft.com ([167.220.110.216])\n        by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-8351587db67sm2331922b3a.13.2026.05.01.04.20.52\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Fri, 01 May 2026 04:20:52 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777634455; cv=none;\n b=PhU/MVviuoLsE7VbmCqVqTOH0wI+wJ65QeWx0bJMNcHRK2zuRZTkwdL4TEH+3od0G0yEnWDpVJR2r3iiy6XeFlJly4DujyXHLnna04i/ydj8NnAlyZJqVCCbxZ940rd0YhpR0wBaPLKg5QRk9GuPVBtOUhqFNYyQvfSE3t775wU=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777634455; c=relaxed/simple;\n\tbh=7A6DXbfDYsk+dYivDPkWaiojfYnlGKNJsQIOvSDlQls=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=YevAS6m4RMfHwwlwUc7OFPTVo41h9niAcOM/DWzn5YlsNfb2eIAVD3Bg1F+Nm8NotyAo+1j9J1A6s2jKPqRRJH7Jp0llUpqsOwjx0IREjPssQcwvdql02GOo3bkr6q/JY+oRgjXJISzIuvr0kpo+xWL51mioo8ROD7i4ZF3xV04=",
        "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=l6ZV99db; arc=none smtp.client-ip=209.85.210.182",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1777634453; x=1778239253;\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=8BY/5y7bF/G0XpGQs/QcZVj1G4/LwsLHtt7BxAwjhkg=;\n        b=l6ZV99dbCJYUWU5TTHpu1dMixIOdQNdD6WIZWjSipP1KzV6o6dY1OYdnfon2zTeX01\n         dX/+3WRH/nP55rLD1iflV/zC+qmBDn60hqNcPjPmvB+pxlZks4f5W9gHGLAHJmLjsfIq\n         KFD1EtPAzHWIe0rpTI8jp+PPat56nm74jdLwYNWnN4uj916Qb4K8nUk7lgcVGzQZXZHU\n         OhCn8/HDelgKIkYSE6MNr5rwNLt/3jS7us2t3kyMeg7jwSLK384rIJpLiJMTdwCk0w/B\n         hpi4YFxTpsh5YsrA6+NK+m+73+EbWdwE7l74dC6CwXqj1ZcNq0Z5SzGwUP/igT/XLLux\n         sCGA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777634453; x=1778239253;\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=8BY/5y7bF/G0XpGQs/QcZVj1G4/LwsLHtt7BxAwjhkg=;\n        b=L1y+YfToOlcuCoiQkb/t2JHjEx4/6KBDKYhnwbbm8kQQeDUq4/adEQBmVBAHENakcG\n         iiXL5his6P1hPSUqH3cTXLn9Prr11dkaZHJG+cBaax6fgKuZpZxW0Q8xhJBBaFLZl6gt\n         rQOj2y+/OlVOP0KbRNJ3rIx/MiIUF0frfVAc6faQr7xa1/atHOWPKGeaYpqP1dDrM2Qv\n         fEBtXykUWgFjRamebDlCFiywUKrDayE7lAHnmapCxiP+2bCjJoWXxEYzRHGb0YSCkhl3\n         ZoxkEay3Z13eYaXUmabhPOYxH2TSe7JaZWSYHRujSFZfjNolBhkCuGnufosmRUHAROQ4\n         UHAg==",
        "X-Gm-Message-State": "AOJu0YzzoBaHzruoG97h6UTp14J5a7y9naYHkE4HJC90dRK7Iir+mHnl\n\tG2Sr+LFI7SI9dk7Et8kgT5vNuosR2wxujIZJhCd6nwTcDuC/eA6XSGe/+EMUPscHYFc=",
        "X-Gm-Gg": "AeBDiesQgC4UNlK5YZCRrYN5m1jfQQMg4ePFw7ci6WpC8mesqCDOR9Ij0ruYALKw1zt\n\tUSFhGWxFXIctC+QN2QOrFzjtDTr2Kz8Xa1e02nCiDWKwdzeGYiOlJw74/5m7ij8xi9QFalLpi/Y\n\t61zDSHB3LuRdnNBfz0TrfmfpVC/Tp97r6O4z7HhiLEwqz0zFrOE0aDFfVJQHqS9dRQBwA3QDJBR\n\tnaSMjsc9lf9PjFRl/uhVKkDao0pvr7IEoDxFiL88THjwAfnOlQSi6rWrBrTOuuRwzapTW2cNMZw\n\tCsuk8jEI1cDV4ie91oAcZZYbC1M7bjge2QiqAgy1mv2Vt93Bs2wknEEsK5D1UNK+rlCALPv9fib\n\tP2R5gZgPkYK4Dfobi9kGrCyAYsTnw2G3aWJhIJM9YZp1iucsuA6KHgteVgr3aQW3v6i9EJicUE1\n\tAOr+56ZuMNGrQItn0Po8+YnoanobrnmFurZ3zbWxQnHEGAMWdILvsUvehCbPFo+wVg",
        "X-Received": "by 2002:a05:6a00:3d48:b0:829:9a7b:db84 with SMTP id\n d2e1a72fcca58-8351a610551mr2745278b3a.49.1777634453183;\n        Fri, 01 May 2026 04:20:53 -0700 (PDT)",
        "From": "nspmangalore@gmail.com",
        "X-Google-Original-From": "sprasad@microsoft.com",
        "To": "linux-cifs@vger.kernel.org,\n\tsmfrench@gmail.com,\n\tpc@manguebit.org,\n\tbharathsm@microsoft.com,\n\tdhowells@redhat.com,\n\thenrique.carvalho@suse.com,\n\tematsumiya@suse.de",
        "Cc": "Shyam Prasad N <sprasad@microsoft.com>",
        "Subject": "[PATCH v4 19/19] cifs: invalidate cached_dirents if population\n aborted",
        "Date": "Fri,  1 May 2026 16:50:22 +0530",
        "Message-ID": "<20260501112023.338005-19-sprasad@microsoft.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260501112023.338005-1-sprasad@microsoft.com>",
        "References": "<20260501112023.338005-1-sprasad@microsoft.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: Shyam Prasad N <sprasad@microsoft.com>\n\nIn order to make sure that parallel readdirs do not populate\nthe cfid->cached_dirents, only the first readdir is given\n\"ownership\" of populating cached_dirents. However, if the\nnext readdir on the same FD never arrives, we will always\nmiss the dirent cache.\n\nThis change introduces a 10-second timeout which will be used\nby laundromat thread to check if the cached_dirents can be\ninvalidated. Ten seconds is a long enough interval between\nsuccessive readdir calls.\n\nSigned-off-by: Shyam Prasad N <sprasad@microsoft.com>\n---\n fs/smb/client/cached_dir.c | 65 ++++++++++++++++++++++++++++++++++----\n fs/smb/client/cached_dir.h |  1 +\n 2 files changed, 60 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c\nindex 14c87ac1a4ad4..b626045745ca2 100644\n--- a/fs/smb/client/cached_dir.c\n+++ b/fs/smb/client/cached_dir.c\n@@ -23,12 +23,18 @@ static void cfids_laundromat_worker(struct work_struct *work);\n \n #define CACHED_DIRENT_HASH_BITS\t7\n #define CACHED_DIR_DENTRY_HT_BITS\t8\n+#define CACHED_DIR_POPULATE_TIMEOUT\t10\n \n struct cached_dir_dentry {\n \tstruct list_head entry;\n \tstruct dentry *dentry;\n };\n \n+struct cached_dir_invalidate_entry {\n+\tstruct list_head entry;\n+\tstruct cached_fid *cfid;\n+};\n+\n /* Generic helpers */\n bool cached_dir_is_valid(struct cached_fid *cfid)\n {\n@@ -496,6 +502,7 @@ static void fail_cached_dir_locked(struct cached_dirents *cde)\n \t * can claim this slot and repopulate the cache.\n \t */\n \tcde->file = NULL;\n+\tcde->last_populate_time = 0;\n }\n \n /* insert cached_dirent into lookup hashtable */\n@@ -799,6 +806,7 @@ bool emit_cached_dir_if_valid(struct cached_fid *cfid,\n \t\tcfid->dirents.file = file;\n \t\tcfid->dirents.dir_inode = file_inode(file);\n \t\tcfid->dirents.pos = 2;\n+\t\tcfid->dirents.last_populate_time = jiffies;\n \t\tcached_dir_reset_insert_cursor_locked(&cfid->dirents);\n \t\t/*\n \t\t * A previous population attempt may have failed and left\n@@ -851,6 +859,28 @@ static void finished_cached_dirents_count(struct cached_dirents *cde,\n \t\tcached_mapping->folio_is_eof = 1;\n \n \tcde->is_valid = 1;\n+\tcde->last_populate_time = 0;\n+}\n+\n+static void maybe_invalidate_stale_cached_dirents(struct cached_fid *cfid)\n+{\n+\tstruct cached_dirents *cde = &cfid->dirents;\n+\n+\tmutex_lock(&cde->de_mutex);\n+\tif (cde->last_populate_time && !cde->is_valid && !cde->is_failed &&\n+\t    cde->file &&\n+\t    time_after(jiffies,\n+\t\t       cde->last_populate_time + HZ * CACHED_DIR_POPULATE_TIMEOUT))\n+\t\tfail_cached_dir_locked(cde);\n+\tmutex_unlock(&cde->de_mutex);\n+}\n+\n+static unsigned long cached_dir_laundromat_interval_seconds(void)\n+{\n+\tif (!dir_cache_timeout)\n+\t\treturn CACHED_DIR_POPULATE_TIMEOUT;\n+\n+\treturn min_t(unsigned int, dir_cache_timeout, CACHED_DIR_POPULATE_TIMEOUT);\n }\n \n /* update the cached_dirent for a given name in list */\n@@ -992,6 +1022,8 @@ bool add_to_cached_dir(struct cached_fid *cfid,\n \told_bytes = cfid->dirents.bytes_used;\n \tadded = add_cached_dirent(&cfid->dirents, ctx, name, namelen,\n \t\t\t\t  fattr, file);\n+\tif (added)\n+\t\tcfid->dirents.last_populate_time = jiffies;\n \tnew_entries = cfid->dirents.entries_count;\n \tnew_bytes = cfid->dirents.bytes_used;\n \tmutex_unlock(&cfid->dirents.de_mutex);\n@@ -2111,7 +2143,9 @@ static void cfids_laundromat_worker(struct work_struct *work)\n {\n \tstruct cached_fids *cfids;\n \tstruct cached_fid *cfid, *q;\n+\tstruct cached_dir_invalidate_entry *inv, *inv_q;\n \tLIST_HEAD(entry);\n+\tLIST_HEAD(invalidate_list);\n \n \tcfids = container_of(work, struct cached_fids, laundromat_work.work);\n \n@@ -2121,6 +2155,9 @@ static void cfids_laundromat_worker(struct work_struct *work)\n \n \tfor (struct rb_node *rb_node = rb_first(&cfids->entries), *next_node;\n \t     rb_node; rb_node = next_node) {\n+\t\tstruct cached_dir_invalidate_entry *inv_ent;\n+\t\tunsigned long last_populate_time;\n+\n \t\tnext_node = rb_next(rb_node);\n \t\tcfid = rb_entry(rb_node, struct cached_fid, node);\n \t\tspin_lock(&cfid->cfid_lock);\n@@ -2144,11 +2181,29 @@ static void cfids_laundromat_worker(struct work_struct *work)\n \t\t\t\tkref_get(&cfid->refcount);\n \t\t\t}\n \t\t} else {\n+\t\t\tlast_populate_time = READ_ONCE(cfid->dirents.last_populate_time);\n+\t\t\tif (last_populate_time &&\n+\t\t\t    time_after(jiffies,\n+\t\t\t\t       last_populate_time + HZ * CACHED_DIR_POPULATE_TIMEOUT)) {\n+\t\t\t\tinv_ent = kmalloc_obj(*inv_ent, GFP_ATOMIC);\n+\t\t\t\tif (inv_ent) {\n+\t\t\t\t\tkref_get(&cfid->refcount);\n+\t\t\t\t\tinv_ent->cfid = cfid;\n+\t\t\t\t\tlist_add_tail(&inv_ent->entry, &invalidate_list);\n+\t\t\t\t}\n+\t\t\t}\n \t\t\tspin_unlock(&cfid->cfid_lock);\n \t\t}\n \t}\n \tspin_unlock(&cfids->cfid_list_lock);\n \n+\tlist_for_each_entry_safe(inv, inv_q, &invalidate_list, entry) {\n+\t\tlist_del(&inv->entry);\n+\t\tmaybe_invalidate_stale_cached_dirents(inv->cfid);\n+\t\tclose_cached_dir(inv->cfid);\n+\t\tkfree(inv);\n+\t}\n+\n \tlist_for_each_entry_safe(cfid, q, &entry, dying_entry) {\n \t\tlist_del(&cfid->dying_entry);\n \n@@ -2169,9 +2224,8 @@ static void cfids_laundromat_worker(struct work_struct *work)\n \t\t\t */\n \t\t\tclose_cached_dir(cfid);\n \t}\n-\tif (dir_cache_timeout)\n-\t\tqueue_delayed_work(cfid_put_wq, &cfids->laundromat_work,\n-\t\t\t\t   dir_cache_timeout * HZ);\n+\tqueue_delayed_work(cfid_put_wq, &cfids->laundromat_work,\n+\t\t\t   cached_dir_laundromat_interval_seconds() * HZ);\n }\n \n struct cached_fids *init_cached_dirs(void)\n@@ -2192,9 +2246,8 @@ struct cached_fids *init_cached_dirs(void)\n \tINIT_LIST_HEAD(&cfids->dying);\n \n \tINIT_DELAYED_WORK(&cfids->laundromat_work, cfids_laundromat_worker);\n-\tif (dir_cache_timeout)\n-\t\tqueue_delayed_work(cfid_put_wq, &cfids->laundromat_work,\n-\t\t\t\t   dir_cache_timeout * HZ);\n+\tqueue_delayed_work(cfid_put_wq, &cfids->laundromat_work,\n+\t\t\t   cached_dir_laundromat_interval_seconds() * HZ);\n \n \tatomic_long_set(&cfids->total_dirents_entries, 0);\n \tatomic64_set(&cfids->total_dirents_bytes, 0);\ndiff --git a/fs/smb/client/cached_dir.h b/fs/smb/client/cached_dir.h\nindex 58dde9452ec9b..eca0a0ca3674c 100644\n--- a/fs/smb/client/cached_dir.h\n+++ b/fs/smb/client/cached_dir.h\n@@ -120,6 +120,7 @@ struct cached_dirents {\n \tstruct inode *dir_inode;\n \tstruct mutex de_mutex;\n \tloff_t pos;\t\t /* Expected ctx->pos */\n+\tunsigned long last_populate_time; /* jiffies of last successful populate progress */\n \tstruct folio_queue *folioq;\n \tstruct list_head entry_list;\n \tunsigned int entry_list_count;\n",
    "prefixes": [
        "v4",
        "19/19"
    ]
}