Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2190726/?format=api
{ "id": 2190726, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2190726/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260130031232.60780-2-me@linux.beauty/", "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": "<20260130031232.60780-2-me@linux.beauty>", "list_archive_url": null, "date": "2026-01-30T03:12:30", "name": "[1/3] jbd2: use READ_ONCE for lockless jinode reads", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ce3ea2ad910b7291ce9f256a2e72d389ec2e247b", "submitter": { "id": 84264, "url": "http://patchwork.ozlabs.org/api/1.2/people/84264/?format=api", "name": "Li Chen", "email": "me@linux.beauty" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260130031232.60780-2-me@linux.beauty/mbox/", "series": [ { "id": 490324, "url": "http://patchwork.ozlabs.org/api/1.2/series/490324/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=490324", "date": "2026-01-30T03:12:31", "name": "jbd2/ext4/ocfs2: READ_ONCE for lockless jinode reads", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/490324/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2190726/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2190726/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <SRS0=y6Ke=AD=vger.kernel.org=linux-ext4+bounces-13434-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.beauty header.i=me@linux.beauty\n header.a=rsa-sha256 header.s=zmail header.b=BqtTZLPG;\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=y6ke=ad=vger.kernel.org=linux-ext4+bounces-13434-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)", "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c0a:e001:db::12fc:5321\"\n arc.chain=\"subspace.kernel.org:zohomail.com\"", "gandalf.ozlabs.org;\n dmarc=none (p=none dis=none) header.from=linux.beauty", "gandalf.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.beauty header.i=me@linux.beauty\n header.a=rsa-sha256 header.s=zmail header.b=BqtTZLPG;\n\tdkim-atps=neutral", "gandalf.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-ext4+bounces-13434-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty\n header.b=\"BqtTZLPG\"", "smtp.subspace.kernel.org;\n arc=pass smtp.client-ip=136.143.188.112", "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=linux.beauty", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.beauty" ], "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 4f2Lhr5rpdz1xtd\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 30 Jan 2026 14:14:36 +1100 (AEDT)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4f2Lhr5Mytz4w9T\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 30 Jan 2026 14:14:36 +1100 (AEDT)", "by gandalf.ozlabs.org (Postfix)\n\tid 4f2Lhr5D8pz4wB8; Fri, 30 Jan 2026 14:14:36 +1100 (AEDT)", "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 gandalf.ozlabs.org (Postfix) with ESMTPS id 4f2Lhm6LD8z4w9T\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 30 Jan 2026 14:14:32 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 922DF30131D4\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 30 Jan 2026 03:13:22 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C2BEF346FC6;\n\tFri, 30 Jan 2026 03:13:20 +0000 (UTC)", "from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com\n [136.143.188.112])\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 4EDF4335564;\n\tFri, 30 Jan 2026 03:13:19 +0000 (UTC)", "by mx.zohomail.com with SMTPS id 1769742772159561.7457286538283;\n\tThu, 29 Jan 2026 19:12:52 -0800 (PST)" ], "ARC-Seal": [ "i=3; a=rsa-sha256; d=ozlabs.org; s=201707; t=1769742876; cv=pass;\n\tb=yjZHt1FgI9QLMr/80H9LBB3XmZ2tldpvnUR7pbmrTRxWl2rnMGC86m1TK3W/Kcj7cTrfe8EhMFRVetI8p2aHkFRWxE6jKAKccvhXQJT8DvqY174ZlxXPxCigE59B+SfroVf93zMElxmY3DZ7HGN+TvuzAbtyd5kzC8qqCVz8QKOMKgGBRZ5yP6NvyzHyGGWI/oDWTYzmnF/neuNLbqcrdmO9GMcUy2wg9CiYanRR1urh9+gdXXkAxe7bEcHrCstRY4xfLbMy5gFw+wgwFsv0pr5qcOOubT1xfsEhkYpT8BtzdOrwio3sUb+KVFEUD3m1mtO4WBUDOfnlXFfzw9TFnQ==", "i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1769742800; cv=pass;\n b=Vh8TgrgeVKU7IRMmVRlwg+HH0gAhbXXfksqblShC08RFeLqUqf58c1gzVoeI9EyEMlhMI5zkKREwIRqqb30kSWrfEEALVhXbhKaKWGrfEfN/hX44keOBkPxsMIrJeOfHQ9Y4+K70ApovIz6o8GkI34c1KerO8YN4VjAUml7xHlY=", "i=1; a=rsa-sha256; t=1769742778; cv=none;\n\td=zohomail.com; s=zohoarc;\n\tb=nv9ZtKaTMdQmEPld7A9ErB8HHEuiTYR5t7viN9zbFwNuXEXXpqp5ZOEaeSpau37WiN1oK70/2d34mT7pB8U4sS3Dtut+UiAi+Q7ld111HP+QacEgmt/3n+SKNRVU+RmWpJrpOGrzIFUQrJIvF63N4KsNgMKtUxiCFuP6Vr57X9g=" ], "ARC-Message-Signature": [ "i=3; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1769742876; c=relaxed/relaxed;\n\tbh=flqovzkqjGriKlWs8tgUbIAnm7IIBuluTOQuNQzOASc=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=JYj2V9pJRDxVFzc4kKm6gbGEra/eP/9LFOWMlyMYI8VbYg+xljRff41RV2lgL0v8VczRYT5ACHzh2otVTJEyvt8P+k8tDQvFdzLE8mPLVL5XVe/dv/3mGgPD0DJTXD83l2NJQWlLLGkawhPTpJj0UB7mrvBmCIPJd005J0O7mSm8XvpHQ/ueOu6mPeTbKnBAQYYrgQ66Gjtx5kKisJhNjWuriGBFXDn7cjP5up1dfCjgjWELvkQ3Qx2cn4OfrwrJ93hyws/va0+0DrinS3yINeyBPMdYqfRSNtksbP/X3L7lJZE5PH0LU3RtwLa3jivu9Zqpn0hPW+wf3u6QF0RRbA==", "i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1769742800; c=relaxed/simple;\n\tbh=Ih/Yu+mlwJPfIPjUeTHwNZR8KkUMEJ4helas/CIo8IA=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=MY+g5R+1CHP2GXqHfxxVmEP5GQO22GYPclarn0w2c0aSB5LKhHeyG/9/AWEh024MTHMT1BlX8kJ+sVdLNGaBb/geOyflsd0LRwg1tVZUPdsMdgBsjnDptjTlq5nVFzNg1REr5aFOMT4W8nMEQuAPwyMM6DjGwBP6RSfwX6UyGPg=", "i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;\n s=zohoarc;\n\tt=1769742778;\n h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To;\n\tbh=flqovzkqjGriKlWs8tgUbIAnm7IIBuluTOQuNQzOASc=;\n\tb=HPCoxWPB+TsgyIVmKsbFzUfjcUiH+Kn43z8YGG7OHLswiztiC97GN3L+zSI+EggvalBiRLsyKszWaleNStEfwETEI/3tVv9YRrqWQUxVw0/Br1zX0m10iI1PUsb5UkAPqfhslxkL6rsGSIg+2lr6O3Pui7IEfaCLXwmKRX17as8=" ], "ARC-Authentication-Results": [ "i=3; gandalf.ozlabs.org;\n dmarc=none (p=none dis=none) header.from=linux.beauty;\n dkim=pass (1024-bit key;\n unprotected) header.d=linux.beauty header.i=me@linux.beauty\n header.a=rsa-sha256 header.s=zmail header.b=BqtTZLPG; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-13434-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org", "i=2; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=linux.beauty;\n spf=pass smtp.mailfrom=linux.beauty;\n dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty\n header.b=BqtTZLPG; arc=pass smtp.client-ip=136.143.188.112", "i=1; mx.zohomail.com;\n\tdkim=pass header.i=linux.beauty;\n\tspf=pass smtp.mailfrom=me@linux.beauty;\n\tdmarc=pass header.from=<me@linux.beauty>" ], "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1769742778;\n\ts=zmail; d=linux.beauty; i=me@linux.beauty;\n\th=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To;\n\tbh=flqovzkqjGriKlWs8tgUbIAnm7IIBuluTOQuNQzOASc=;\n\tb=BqtTZLPGaO5claLf1CBC1TambgYd8F3h8P56GlMmGLJcq6b5imWkesdGx0jGaDJb\n\tB44F0NSTlmS3mUgA7+nufY5xhfo1i9uKeG1pjCCksNr53TY6Et/ol2o+6uOuFr4T4zt\n\txcw/CHiJO5o5mFlRgcIFy5RbUrmuEasOTjwinXQw=", "From": "Li Chen <me@linux.beauty>", "To": "\"Theodore Ts'o\" <tytso@mit.edu>,\n\tJan Kara <jack@suse.com>,\n\tlinux-ext4@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org", "Cc": "Li Chen <me@linux.beauty>", "Subject": "[PATCH 1/3] jbd2: use READ_ONCE for lockless jinode reads", "Date": "Fri, 30 Jan 2026 11:12:30 +0800", "Message-ID": "<20260130031232.60780-2-me@linux.beauty>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260130031232.60780-1-me@linux.beauty>", "References": "<20260130031232.60780-1-me@linux.beauty>", "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-ZohoMailClient": "External", "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_MISSING,\n\tHEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,\n\tSPF_PASS autolearn=disabled version=4.0.1", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org" }, "content": "jbd2_inode fields are updated under journal->j_list_lock, but some\npaths read them without holding the lock (e.g. fast commit\nhelpers and the ordered truncate fast path).\n\nUse READ_ONCE() for these lockless reads to correct the\nconcurrency assumptions.\n\nSuggested-by: Jan Kara <jack@suse.com>\nSigned-off-by: Li Chen <me@linux.beauty>\n---\n fs/jbd2/commit.c | 39 ++++++++++++++++++++++++++++++++-------\n fs/jbd2/transaction.c | 2 +-\n 2 files changed, 33 insertions(+), 8 deletions(-)", "diff": "diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c\nindex 7203d2d2624d..3347d75da2f8 100644\n--- a/fs/jbd2/commit.c\n+++ b/fs/jbd2/commit.c\n@@ -180,7 +180,13 @@ static int journal_wait_on_commit_record(journal_t *journal,\n /* Send all the data buffers related to an inode */\n int jbd2_submit_inode_data(journal_t *journal, struct jbd2_inode *jinode)\n {\n-\tif (!jinode || !(jinode->i_flags & JI_WRITE_DATA))\n+\tunsigned long flags;\n+\n+\tif (!jinode)\n+\t\treturn 0;\n+\n+\tflags = READ_ONCE(jinode->i_flags);\n+\tif (!(flags & JI_WRITE_DATA))\n \t\treturn 0;\n \n \ttrace_jbd2_submit_inode_data(jinode->i_vfs_inode);\n@@ -191,12 +197,30 @@ EXPORT_SYMBOL(jbd2_submit_inode_data);\n \n int jbd2_wait_inode_data(journal_t *journal, struct jbd2_inode *jinode)\n {\n-\tif (!jinode || !(jinode->i_flags & JI_WAIT_DATA) ||\n-\t\t!jinode->i_vfs_inode || !jinode->i_vfs_inode->i_mapping)\n+\tstruct address_space *mapping;\n+\tstruct inode *inode;\n+\tunsigned long flags;\n+\tloff_t start, end;\n+\n+\tif (!jinode)\n+\t\treturn 0;\n+\n+\tflags = READ_ONCE(jinode->i_flags);\n+\tif (!(flags & JI_WAIT_DATA))\n+\t\treturn 0;\n+\n+\tinode = READ_ONCE(jinode->i_vfs_inode);\n+\tif (!inode)\n+\t\treturn 0;\n+\n+\tmapping = inode->i_mapping;\n+\tstart = READ_ONCE(jinode->i_dirty_start);\n+\tend = READ_ONCE(jinode->i_dirty_end);\n+\n+\tif (!mapping)\n \t\treturn 0;\n \treturn filemap_fdatawait_range_keep_errors(\n-\t\tjinode->i_vfs_inode->i_mapping, jinode->i_dirty_start,\n-\t\tjinode->i_dirty_end);\n+\t\tmapping, start, end);\n }\n EXPORT_SYMBOL(jbd2_wait_inode_data);\n \n@@ -240,10 +264,11 @@ static int journal_submit_data_buffers(journal_t *journal,\n int jbd2_journal_finish_inode_data_buffers(struct jbd2_inode *jinode)\n {\n \tstruct address_space *mapping = jinode->i_vfs_inode->i_mapping;\n+\tloff_t start = READ_ONCE(jinode->i_dirty_start);\n+\tloff_t end = READ_ONCE(jinode->i_dirty_end);\n \n \treturn filemap_fdatawait_range_keep_errors(mapping,\n-\t\t\t\t\t\t jinode->i_dirty_start,\n-\t\t\t\t\t\t jinode->i_dirty_end);\n+\t\t\t\t\t\t start, end);\n }\n \n /*\ndiff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c\nindex dca4b5d8aaaa..302b2090eea7 100644\n--- a/fs/jbd2/transaction.c\n+++ b/fs/jbd2/transaction.c\n@@ -2739,7 +2739,7 @@ int jbd2_journal_begin_ordered_truncate(journal_t *journal,\n \tint ret = 0;\n \n \t/* This is a quick check to avoid locking if not necessary */\n-\tif (!jinode->i_transaction)\n+\tif (!READ_ONCE(jinode->i_transaction))\n \t\tgoto out;\n \t/* Locks are here just to force reading of recent values, it is\n \t * enough that the transaction was not committing before we started\n", "prefixes": [ "1/3" ] }