get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2234980,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2234980/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260508121539.4174601-14-libaokun@linux.alibaba.com/",
    "project": {
        "id": 8,
        "url": "http://patchwork.ozlabs.org/api/1.2/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260508121539.4174601-14-libaokun@linux.alibaba.com>",
    "list_archive_url": null,
    "date": "2026-05-08T12:15:35",
    "name": "[RFC,13/17] ext4: use fast incremental CRC update in ext4_mark_inode_used()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "593dcbe99ccac167f87b5eebe33e427ccb8362c4",
    "submitter": {
        "id": 92757,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/92757/?format=api",
        "name": "Baokun Li",
        "email": "libaokun@linux.alibaba.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260508121539.4174601-14-libaokun@linux.alibaba.com/mbox/",
    "series": [
        {
            "id": 503377,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/503377/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=503377",
            "date": "2026-05-08T12:15:22",
            "name": "ext4/lib-crc: LBS performance part 1 - incremental CRC32c for bitmap checksums",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/503377/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2234980/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2234980/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=4Hsi=DF=vger.kernel.org=linux-ext4+bounces-16375-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 (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=sp3I6mtT;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=4hsi=df=vger.kernel.org=linux-ext4+bounces-16375-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c15:e001:75::12fc:5321\"\n arc.chain=subspace.kernel.org",
            "gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com",
            "gandalf.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=sp3I6mtT;\n\tdkim-atps=neutral",
            "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16375-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.alibaba.com\n header.i=@linux.alibaba.com header.b=\"sp3I6mtT\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=115.124.30.124",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.alibaba.com"
        ],
        "Received": [
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\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 4gBp5932lRz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 22:16:45 +1000 (AEST)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4gBp592Wb2z4wJg\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 22:16:45 +1000 (AEST)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4gBp592Nqfz4wCG; Fri, 08 May 2026 22:16:45 +1000 (AEST)",
            "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::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 4gBp556Pr2z4wJg\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 08 May 2026 22:16:41 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 5C8BD3016D88\n\tfor <patchwork-incoming@ozlabs.org>; Fri,  8 May 2026 12:16:24 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id DECC63DD532;\n\tFri,  8 May 2026 12:16:19 +0000 (UTC)",
            "from out30-124.freemail.mail.aliyun.com\n (out30-124.freemail.mail.aliyun.com [115.124.30.124])\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 AD8273DCD9B;\n\tFri,  8 May 2026 12:16:17 +0000 (UTC)",
            "from\n x31h02109.sqa.na131.tbsite.net(mailfrom:libaokun@linux.alibaba.com\n fp:SMTPD_---0X2XQgr2_1778242569 cluster:ay36)\n          by smtp.aliyun-inc.com;\n          Fri, 08 May 2026 20:16:09 +0800"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1778242605; cv=pass;\n\tb=hLeGVjaWZmJMJzIi56ev0KWeUq42W9WBHutn/0R6qzZtBLcWKOKLMYzJ91CcDsE0CYvMwCEVGjwo9d9D22seKaXlSi49HvWzSswc0zGyEJJbqZnKHfXmPYsFRPRbQp38X0xutc4ACG0k7rFJcVcfgwrHiTf3GHm2gm1W4zF+hiHMB2ktxwLenXXZiigOAZGtHibm7cE3HyFaFF2j9RmdPTtwUGGYw+Zpf+JezYQIzz+rGYN63eRO9hr+9i+vXtuWw+rz3133gia5qZJZtgj4boerprSEr06rYA0UHxjGJcqgJktbtU4252dP3ifjH/WCM1eKjdHfB3o2Pd2NL7nPiw==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778242579; cv=none;\n b=mLcn1jd+2SDXxoV3sVccmWWwKeJ4XtjgK/SQ1JgJlTBSACAm8U2uIXCnAY7CVjLqfPBRnpEvCWJO26dW/RMBbAPnuUP4XwJe9aIQ9ZK0yzKSesu2x3MKTc9o2HwH4Q5a89fmC1dbav37ECp4rIZ5oGB/TQ55tpnVcXUaf7dGuGw="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1778242605; c=relaxed/relaxed;\n\tbh=omI7SRikdqIgyxB0uPduOEBvp2jJZrJt0MRys7JIsEw=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=qNV10r9VVMXG1Vvfjf+PLxZnZDWHrJhbJ9EjmAiR3RoDux+B6yRM9v5oqQzLNP6IJiT82M+syZtuw3bBzWBsjmBiDr3UvaYNQTl8e0H3JsFjYlCQJINrNlkD1yX956W6yX1MPbj1N0CdcYIhgToMI6VrV7XY2h9rqfKjIUjjDV3UZ9huzn9mSmeLzbS35Eo4DgXd8JWry2nJIzTiZrSrh2RRQ79CTSIlCG8QPL8P6Z0BiMC/GDZTAQLD0Ioa4Lpyo9lqu4+yd7I/2B+8I2AokoARMbY4Vo83BS30ST0hFa4EgC/TFnM7wh2IzHzD2OUh7xhxmhjTqm8V9o6ATOq8QA==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778242579; c=relaxed/simple;\n\tbh=DllS5YjXJieuqKLmfXZHKyOfeuzV6+C9HnBqMx1/zdM=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=db181QG0yX2j1WqsCXelbGHt8dsrQ/DXRXIJPrVij82XbOh9fXe52h2FAIOtR2nSDVX8IZ8Z47SXca6JnLkzUt72TJHTiClcRPq3mGpf4/W0OQQoJYIWKj7vdaXpCr3AJVBYN7OquwcEbGbjonsEtscPLvwfUWfVg+sdRGyxbJc="
        ],
        "ARC-Authentication-Results": [
            "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com;\n dkim=pass (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=sp3I6mtT; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16375-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org",
            "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com;\n spf=pass smtp.mailfrom=linux.alibaba.com;\n dkim=pass (1024-bit key) header.d=linux.alibaba.com\n header.i=@linux.alibaba.com header.b=sp3I6mtT;\n arc=none smtp.client-ip=115.124.30.124"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linux.alibaba.com; s=default;\n\tt=1778242570; h=From:To:Subject:Date:Message-ID:MIME-Version;\n\tbh=omI7SRikdqIgyxB0uPduOEBvp2jJZrJt0MRys7JIsEw=;\n\tb=sp3I6mtTrhZdXKTCvWN30d+yFixCGQ+Tq9wI2lWItqIL1PTJ5BsAne3i0Pxfk6/D8C0ICIRDxZzl5+/24/oHeK6bfbeRQRCq0jfOoYtMRIUiJUPYqqZLpadDfjvDMjZUBW7AlHZrK7kX5Ll6k1ewjBdaHmK9HFp4f4a3GDbomKE=",
        "X-Alimail-AntiSpam": "\n AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032089153;MF=libaokun@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0X2XQgr2_1778242569;",
        "From": "Baokun Li <libaokun@linux.alibaba.com>",
        "To": "linux-ext4@vger.kernel.org",
        "Cc": "linux-crypto@vger.kernel.org,\n\tebiggers@kernel.org,\n\tardb@kernel.org,\n\ttytso@mit.edu,\n\tadilger.kernel@dilger.ca,\n\tjack@suse.cz,\n\tyi.zhang@huawei.com,\n\tojaswin@linux.ibm.com,\n\tritesh.list@gmail.com,\n\tBaokun Li <libaokun@linux.alibaba.com>",
        "Subject": "[PATCH RFC 13/17] ext4: use fast incremental CRC update in\n ext4_mark_inode_used()",
        "Date": "Fri,  8 May 2026 20:15:35 +0800",
        "Message-ID": "<20260508121539.4174601-14-libaokun@linux.alibaba.com>",
        "X-Mailer": "git-send-email 2.43.7",
        "In-Reply-To": "<20260508121539.4174601-1-libaokun@linux.alibaba.com>",
        "References": "<20260508121539.4174601-1-libaokun@linux.alibaba.com>",
        "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-Transfer-Encoding": "8bit",
        "X-Spam-Status": "No, score=-8.7 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tHEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,\n\tSPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_DKIM_WL autolearn=disabled\n\tversion=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"
    },
    "content": "Move the bitmap modification, GDP update, and checksum update into a\nsingle group lock acquisition in ext4_mark_inode_used(), eliminating the\nrace window where another thread could interleave a full recomputation\nbetween bitmap modification and checksum update.\n\nAdd a fast_crc flag to select between incremental and full CRC update.\nWhen EXT4_BG_INODE_UNINIT is set, the stored checksum in the group\ndescriptor is not a valid CRC of the bitmap -- mkfs leaves it as zero\nfor UNINIT groups, and ext4_read_inode_bitmap() memsets the buffer to\nzero without updating the gdp checksum. So fast_crc is forced to false\nto fall back to ext4_inode_bitmap_csum_set() for a full recalculation\nthat establishes a correct baseline.\n\nFor non-UNINIT groups, ext4_inode_bitmap_csum_set_fast() computes the\nCRC delta for the single flipped bit in O(log N) time.\n\nSigned-off-by: Baokun Li <libaokun@linux.alibaba.com>\n---\n fs/ext4/ialloc.c | 69 ++++++++++++++++++++++++------------------------\n 1 file changed, 35 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c\nindex 90896b7f8c73..e209e27f827f 100644\n--- a/fs/ext4/ialloc.c\n+++ b/fs/ext4/ialloc.c\n@@ -838,35 +838,37 @@ int ext4_mark_inode_used(struct super_block *sb, int ino, umode_t mode)\n \t\tgoto out;\n \t}\n \n-\text4_set_bit(bit, inode_bitmap_bh->b_data);\n-\n-\tBUFFER_TRACE(inode_bitmap_bh, \"call ext4_handle_dirty_metadata\");\n-\terr = ext4_handle_dirty_metadata(NULL, NULL, inode_bitmap_bh);\n-\tif (err) {\n-\t\text4_std_error(sb, err);\n-\t\tgoto out;\n-\t}\n-\terr = sync_dirty_buffer(inode_bitmap_bh);\n-\tif (err) {\n-\t\text4_std_error(sb, err);\n-\t\tgoto out;\n-\t}\n-\n \t/* We may have to initialize the block bitmap if it isn't already */\n \terr = ext4_might_init_block_bitmap(NULL, sb, group, gdp);\n \tif (err)\n \t\tgoto out;\n \n+\text4_lock_group(sb, group);\n+\t/* Fast commit replay is single-threaded, no need for test_and_set */\n+\text4_set_bit(bit, inode_bitmap_bh->b_data);\n+\n \t/* Update the relevant bg descriptor fields */\n+\text4_free_inodes_set(sb, gdp, ext4_free_inodes_count(sb, gdp) - 1);\n+\tif (S_ISDIR(mode)) {\n+\t\text4_used_dirs_set(sb, gdp, ext4_used_dirs_count(sb, gdp) + 1);\n+\t\tif (sbi->s_log_groups_per_flex) {\n+\t\t\text4_group_t f = ext4_flex_group(sbi, group);\n+\n+\t\t\tatomic_inc(&sbi_array_rcu_deref(sbi, s_flex_groups,\n+\t\t\t\t\t\t\tf)->used_dirs);\n+\t\t}\n+\t}\n+\n \tif (ext4_has_group_desc_csum(sb)) {\n-\t\tint free;\n+\t\tbool fast_crc = true;\n+\t\tint free = EXT4_INODES_PER_GROUP(sb) -\n+\t\t\t\text4_itable_unused_count(sb, gdp);\n \n-\t\text4_lock_group(sb, group); /* while we modify the bg desc */\n-\t\tfree = EXT4_INODES_PER_GROUP(sb) -\n-\t\t\text4_itable_unused_count(sb, gdp);\n \t\tif (gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)) {\n \t\t\tgdp->bg_flags &= cpu_to_le16(~EXT4_BG_INODE_UNINIT);\n \t\t\tfree = 0;\n+\t\t\t/* Incremental CRC needs a valid checksum baseline */\n+\t\t\tfast_crc = false;\n \t\t}\n \n \t\t/*\n@@ -877,27 +879,26 @@ int ext4_mark_inode_used(struct super_block *sb, int ino, umode_t mode)\n \t\tif (bit >= free)\n \t\t\text4_itable_unused_set(sb, gdp,\n \t\t\t\t\t(EXT4_INODES_PER_GROUP(sb) - bit - 1));\n-\t} else {\n-\t\text4_lock_group(sb, group);\n+\t\tif (fast_crc)\n+\t\t\text4_inode_bitmap_csum_set_fast(sb, gdp, bit);\n+\t\telse\n+\t\t\text4_inode_bitmap_csum_set(sb, gdp, inode_bitmap_bh);\n+\t\text4_group_desc_csum_set(sb, group, gdp);\n \t}\n \n-\text4_free_inodes_set(sb, gdp, ext4_free_inodes_count(sb, gdp) - 1);\n-\tif (S_ISDIR(mode)) {\n-\t\text4_used_dirs_set(sb, gdp, ext4_used_dirs_count(sb, gdp) + 1);\n-\t\tif (sbi->s_log_groups_per_flex) {\n-\t\t\text4_group_t f = ext4_flex_group(sbi, group);\n+\text4_unlock_group(sb, group);\n \n-\t\t\tatomic_inc(&sbi_array_rcu_deref(sbi, s_flex_groups,\n-\t\t\t\t\t\t\tf)->used_dirs);\n-\t\t}\n+\tBUFFER_TRACE(inode_bitmap_bh, \"call ext4_handle_dirty_metadata\");\n+\terr = ext4_handle_dirty_metadata(NULL, NULL, inode_bitmap_bh);\n+\tif (err) {\n+\t\text4_std_error(sb, err);\n+\t\tgoto out;\n \t}\n-\n-\tif (ext4_has_group_desc_csum(sb)) {\n-\t\text4_inode_bitmap_csum_set(sb, gdp, inode_bitmap_bh);\n-\t\text4_group_desc_csum_set(sb, group, gdp);\n+\terr = sync_dirty_buffer(inode_bitmap_bh);\n+\tif (err) {\n+\t\text4_std_error(sb, err);\n+\t\tgoto out;\n \t}\n-\n-\text4_unlock_group(sb, group);\n \terr = ext4_handle_dirty_metadata(NULL, NULL, group_desc_bh);\n \tsync_dirty_buffer(group_desc_bh);\n out:\n",
    "prefixes": [
        "RFC",
        "13/17"
    ]
}