get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2230296,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2230296/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/177747214256.4107228.6015018056447082705.stgit@frogsfrogsfrogs/",
    "project": {
        "id": 8,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/8/?format=api",
        "name": "Linux ext4 filesystem development",
        "link_name": "linux-ext4",
        "list_id": "linux-ext4.vger.kernel.org",
        "list_email": "linux-ext4@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<177747214256.4107228.6015018056447082705.stgit@frogsfrogsfrogs>",
    "date": "2026-04-29T14:51:35",
    "name": "[1/5] libext2fs: invalidate cached blocks when freeing them",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "fad353aca1914a965c6af62b516102ebaf4cdb3b",
    "submitter": {
        "id": 77032,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/77032/?format=api",
        "name": "Darrick J. Wong",
        "email": "djwong@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/177747214256.4107228.6015018056447082705.stgit@frogsfrogsfrogs/mbox/",
    "series": [
        {
            "id": 502086,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502086/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=502086",
            "date": "2026-04-29T14:51:35",
            "name": "[1/5] libext2fs: invalidate cached blocks when freeing them",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502086/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2230296/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2230296/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <SRS0=WJa3=C4=vger.kernel.org=linux-ext4+bounces-16185-patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-ext4@vger.kernel.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "patchwork-incoming@ozlabs.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=mq77mi+H;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=150.107.74.76; helo=mail.ozlabs.org;\n envelope-from=srs0=wja3=c4=vger.kernel.org=linux-ext4+bounces-16185-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c09:e001:a7::12fc:5321\"\n arc.chain=subspace.kernel.org",
            "gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org",
            "gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=mq77mi+H;\n\tdkim-atps=neutral",
            "gandalf.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-ext4+bounces-16185-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"mq77mi+H\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76])\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 4g5KyC0LS6z1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 00:51:46 +1000 (AEST)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g5Ky96Y2Bz4wSY\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 00:51:45 +1000 (AEST)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4g5Ky969vPz4wSR; Thu, 30 Apr 2026 00:51:45 +1000 (AEST)",
            "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 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4g5Ky627p3z4wSY\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 30 Apr 2026 00:51:42 +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 9CC3D3006153\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 29 Apr 2026 14:51:39 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 887CB2FD1B3;\n\tWed, 29 Apr 2026 14:51:36 +0000 (UTC)",
            "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A46B27E1DC;\n\tWed, 29 Apr 2026 14:51:36 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id DE407C19425;\n\tWed, 29 Apr 2026 14:51:35 +0000 (UTC)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1777474305; cv=pass;\n\tb=fHAPSt00vcc9SBREYcw9brVI+fid9vJ+pr+qM8JB89HMtEaBTC+LIxcdKSBVDptbBednJ4K1CiWwnKpHw18Ufay04mnvUAlsAnyk8SqF3L9mX6MiGSkqZrzVZoI2y0ZcAo09FA/lIkcarpvQwx6FNuyJbmeLmA6J23W/RizihOCu7gcijVIN8oIbflrrqw4SoF675e6kA89NtRXcNFyRU1e1Rq/iO//HDZw88DCzwUpHsydBVJ3AAHB+890lfBqUN99X6oraBYKBNv47bK+8CkrLSySmVb+owNIaAw5rgJXho0gjLZd4apQqc5hHKCBJg/zIPXl5w2D+utp632lXcg==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777474296; cv=none;\n b=scSv059k9yb6L/nNnD1Dwtkw5YdgfvxJ0TgF6SeET0wyDnHT22IZZoxNEg31qTBEUUCCHGetpCKd1X1RoFQw+S3YnENz3eutQ4EDlBEJ1TRmesU2YSgyos/+1qidGFD3aYY1xqcXqW62jqXAMv+eLXQvR7eExQJGhWAGffQ7bvc="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1777474305; c=relaxed/relaxed;\n\tbh=fMngieHuU5Ll63tVG42Cr5VjkvJBDfxyA9Q8IDZMNxw=;\n\th=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=X96HuTWH3ol+Su/nmLO5yR7biJgQNv+fNuKTLmYEri5kZOcrBdzZgioYgd2nwJfatSiXwxBySfmU1RGXfrdWvHgQbbqsrHyAlUQ54CfNc/xHBqogwl0IJ7BV69fLJPa0l0hPcQv2KTnbrVj7NtVP8oaHnxCl4cwu0+O9foYE56UVmCEr2w69ebqzmFLPclZEpk2CG/RfD04gRazwFpzYJergm58Iye7uwuk2y1ddOaLGVpM3Q3rAk/JOixDIoWeK5wHaFvmm0ijb9maUb3SxIjdo97/LPty5ld8EvNlZxxbyyNr0Gr46AkW6pVngBMBL1pgGwh8Qdhb0oC+ETwxZ9g==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777474296; c=relaxed/simple;\n\tbh=yACd6LsSm+yczj8Cb0haT/V3Q+3be26U7DXQ8HLbJZE=;\n\th=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=fy9uVouXyCdjDzXjK7O9+Xrr/OoE2VcHCE3HSpJ/ykxlzhA1h/OdYmrOtWJ4+IpqknlsRumvZFEPycAf7bpJWacezVaShwPOVn68awJvqpQ0jA1JxhFLnPI5oUzQUcXL4c9zXTero/RVmxl4Csl3EPtQkfUlxugMbDkuJQ5SyOk="
        ],
        "ARC-Authentication-Results": [
            "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=mq77mi+H; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16185-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org",
            "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=mq77mi+H; arc=none smtp.client-ip=10.30.226.201"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777474295;\n\tbh=yACd6LsSm+yczj8Cb0haT/V3Q+3be26U7DXQ8HLbJZE=;\n\th=Date:Subject:From:To:Cc:In-Reply-To:References:From;\n\tb=mq77mi+He4p0EJ54rRic5SbwmkZezHhq2x4iF+BuqlC7KcVahoV32Vl4p1ChF+ez5\n\t d0bhC1BmLWots4R5ThIgmFexdejp3gliZ46BmoNYgKUT2cCsBJiYpFMcf9TCOiwsap\n\t avhbiy6iFchZTwDkCv5zaF5DsrfVcrbyxFxIySVcSOV4sTV2FA8PlK0UGS4DHic5Co\n\t K5Czdt9+7rDtKujmRMGz4mtp/GaYSBWDVphZ+iavHPsJjLvdxfiCzGilnEiSS/4WgF\n\t 8nirHBGdPvquJxUtEAnY4UCyG3e/mciwJlA2W9vmR/wjsBYRrR4LPvW27bVy2UI570\n\t QyDTt7rt5ycaQ==",
        "Date": "Wed, 29 Apr 2026 07:51:35 -0700",
        "Subject": "[PATCH 1/5] libext2fs: invalidate cached blocks when freeing them",
        "From": "\"Darrick J. Wong\" <djwong@kernel.org>",
        "To": "tytso@mit.edu",
        "Cc": "bernd@bsbernd.com, miklos@szeredi.hu, linux-ext4@vger.kernel.org,\n neal@gompa.dev, linux-fsdevel@vger.kernel.org, fuse-devel@lists.linux.dev,\n joannelkoong@gmail.com",
        "Message-ID": "<177747214256.4107228.6015018056447082705.stgit@frogsfrogsfrogs>",
        "In-Reply-To": "<177747214224.4107228.16300103064218258692.stgit@frogsfrogsfrogs>",
        "References": "<177747214224.4107228.16300103064218258692.stgit@frogsfrogsfrogs>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-ext4@vger.kernel.org",
        "List-Id": "<linux-ext4.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-ext4+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-ext4+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"
    },
    "content": "From: Darrick J. Wong <djwong@kernel.org>\n\nWhen we're freeing blocks, we should tell the IO manager to drop them\nfrom any cache it might be maintaining to improve performance.\n\nSigned-off-by: \"Darrick J. Wong\" <djwong@kernel.org>\n---\n lib/ext2fs/ext2_io.h         |    8 +++++++-\n debian/libext2fs2t64.symbols |    1 +\n lib/ext2fs/alloc_stats.c     |    6 ++++++\n lib/ext2fs/io_manager.c      |    9 +++++++++\n lib/ext2fs/unix_io.c         |   35 +++++++++++++++++++++++++++++++++++\n 5 files changed, 58 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/ext2fs/ext2_io.h b/lib/ext2fs/ext2_io.h\nindex c880ea2524f248..0148492caf63b6 100644\n--- a/lib/ext2fs/ext2_io.h\n+++ b/lib/ext2fs/ext2_io.h\n@@ -104,7 +104,10 @@ struct struct_io_manager {\n \t\t\t     unsigned long long count);\n \terrcode_t (*flock)(io_channel channel, unsigned int flock_flags);\n \terrcode_t (*get_fd)(io_channel channel, int *fd);\n-\tlong\treserved[12];\n+\terrcode_t (*invalidate_blocks)(io_channel channel,\n+\t\t\t\t       unsigned long long block,\n+\t\t\t\t       unsigned long long count);\n+\tlong\treserved[11];\n };\n \n #define IO_FLAG_RW\t\t0x0001\n@@ -157,6 +160,9 @@ extern errcode_t io_channel_cache_readahead(io_channel io,\n extern errcode_t io_channel_flock(io_channel io, unsigned int flock_flags);\n extern errcode_t io_channel_funlock(io_channel io);\n extern errcode_t io_channel_get_fd(io_channel io, int *fd);\n+extern errcode_t io_channel_invalidate_blocks(io_channel io,\n+\t\t\t\t\t      unsigned long long block,\n+\t\t\t\t\t      unsigned long long count);\n \n #ifdef _WIN32\n /* windows_io.c */\ndiff --git a/debian/libext2fs2t64.symbols b/debian/libext2fs2t64.symbols\nindex 555fbbb0c98878..b19a362967f00e 100644\n--- a/debian/libext2fs2t64.symbols\n+++ b/debian/libext2fs2t64.symbols\n@@ -702,6 +702,7 @@ libext2fs.so.2 libext2fs2t64 #MINVER#\n  io_channel_flock@Base 1.47.99\n  io_channel_funlock@Base 1.47.99\n  io_channel_get_fd@Base 1.47.99\n+ io_channel_invalidate_blocks@Base 1.47.99\n  io_channel_read_blk64@Base 1.41.1\n  io_channel_set_options@Base 1.37\n  io_channel_write_blk64@Base 1.41.1\ndiff --git a/lib/ext2fs/alloc_stats.c b/lib/ext2fs/alloc_stats.c\nindex 95a6438f252e0f..68bbe6807a8ed3 100644\n--- a/lib/ext2fs/alloc_stats.c\n+++ b/lib/ext2fs/alloc_stats.c\n@@ -82,6 +82,9 @@ void ext2fs_block_alloc_stats2(ext2_filsys fs, blk64_t blk, int inuse)\n \t\t\t     -inuse * (blk64_t) EXT2FS_CLUSTER_RATIO(fs));\n \text2fs_mark_super_dirty(fs);\n \text2fs_mark_bb_dirty(fs);\n+\tif (inuse < 0)\n+\t\tio_channel_invalidate_blocks(fs->io, blk,\n+\t\t\t\t\t     EXT2FS_CLUSTER_RATIO(fs));\n \tif (fs->block_alloc_stats)\n \t\t(fs->block_alloc_stats)(fs, (blk64_t) blk, inuse);\n }\n@@ -144,11 +147,14 @@ void ext2fs_block_alloc_stats_range(ext2_filsys fs, blk64_t blk,\n \t\text2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);\n \t\text2fs_group_desc_csum_set(fs, group);\n \t\text2fs_free_blocks_count_add(fs->super, -inuse * (blk64_t) n);\n+\n \t\tblk += n;\n \t\tnum -= n;\n \t}\n \text2fs_mark_super_dirty(fs);\n \text2fs_mark_bb_dirty(fs);\n+\tif (inuse < 0)\n+\t\tio_channel_invalidate_blocks(fs->io, orig_blk, orig_num);\n \tif (fs->block_alloc_stats_range)\n \t\t(fs->block_alloc_stats_range)(fs, orig_blk, orig_num, inuse);\n }\ndiff --git a/lib/ext2fs/io_manager.c b/lib/ext2fs/io_manager.c\nindex dff3d73552827f..a92dba7b9dc880 100644\n--- a/lib/ext2fs/io_manager.c\n+++ b/lib/ext2fs/io_manager.c\n@@ -174,3 +174,12 @@ errcode_t io_channel_get_fd(io_channel io, int *fd)\n \n \treturn io->manager->get_fd(io, fd);\n }\n+\n+errcode_t io_channel_invalidate_blocks(io_channel io, unsigned long long block,\n+\t\t\t\t       unsigned long long count)\n+{\n+\tif (!io->manager->invalidate_blocks)\n+\t\treturn EXT2_ET_OP_NOT_SUPPORTED;\n+\n+\treturn io->manager->invalidate_blocks(io, block, count);\n+}\ndiff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c\nindex 567bbd9493f7f1..54bd4b5597ea9e 100644\n--- a/lib/ext2fs/unix_io.c\n+++ b/lib/ext2fs/unix_io.c\n@@ -672,6 +672,25 @@ static errcode_t reuse_cache(io_channel channel,\n #define FLUSH_INVALIDATE\t0x01\n #define FLUSH_NOLOCK\t\t0x02\n \n+/* Remove blocks from the cache.  Dirty contents are discarded. */\n+static void invalidate_cached_blocks(io_channel channel,\n+\t\t\t\t     struct unix_private_data *data,\n+\t\t\t\t     unsigned long long block,\n+\t\t\t\t     unsigned long long count)\n+{\n+\tstruct unix_cache\t*cache;\n+\tint\t\t\ti;\n+\n+\tmutex_lock(data, CACHE_MTX);\n+\tfor (i = 0, cache = data->cache; i < data->cache_size; i++, cache++) {\n+\t\tif (!cache->in_use || cache->block < block ||\n+\t\t    cache->block >= block + count)\n+\t\t\tcontinue;\n+\t\tcache->in_use = 0;\n+\t}\n+\tmutex_unlock(data, CACHE_MTX);\n+}\n+\n /*\n  * Flush all of the blocks in the cache\n  */\n@@ -1832,6 +1851,20 @@ static errcode_t unix_get_fd(io_channel channel, int *fd)\n \treturn 0;\n }\n \n+static errcode_t unix_invalidate_blocks(io_channel channel,\n+\t\t\t\t\tunsigned long long block,\n+\t\t\t\t\tunsigned long long count)\n+{\n+\tstruct unix_private_data *data;\n+\n+\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n+\tdata = (struct unix_private_data *) channel->private_data;\n+\tEXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_UNIX_IO_CHANNEL);\n+\n+\tinvalidate_cached_blocks(channel, data, block, count);\n+\treturn 0;\n+}\n+\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic pop\n #endif\n@@ -1855,6 +1888,7 @@ static struct struct_io_manager struct_unix_manager = {\n \t.zeroout\t= unix_zeroout,\n \t.flock\t\t= unix_flock,\n \t.get_fd\t\t= unix_get_fd,\n+\t.invalidate_blocks = unix_invalidate_blocks,\n };\n \n io_manager unix_io_manager = &struct_unix_manager;\n@@ -1878,6 +1912,7 @@ static struct struct_io_manager struct_unixfd_manager = {\n \t.zeroout\t= unix_zeroout,\n \t.flock\t\t= unix_flock,\n \t.get_fd\t\t= unix_get_fd,\n+\t.invalidate_blocks = unix_invalidate_blocks,\n };\n \n io_manager unixfd_io_manager = &struct_unixfd_manager;\n",
    "prefixes": [
        "1/5"
    ]
}