get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2198115,
    "url": "http://patchwork.ozlabs.org/api/1.0/patches/2198115/?format=api",
    "project": {
        "id": 8,
        "url": "http://patchwork.ozlabs.org/api/1.0/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": "<20260219114645.778338-2-me@linux.beauty>",
    "date": "2026-02-19T11:46:42",
    "name": "[v2,1/3] jbd2: store jinode dirty range in PAGE_SIZE units",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0d4c2ccc18cbafa74a0ab7acdb4e5f0fd073f398",
    "submitter": {
        "id": 84264,
        "url": "http://patchwork.ozlabs.org/api/1.0/people/84264/?format=api",
        "name": "Li Chen",
        "email": "me@linux.beauty"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260219114645.778338-2-me@linux.beauty/mbox/",
    "series": [
        {
            "id": 492665,
            "url": "http://patchwork.ozlabs.org/api/1.0/series/492665/?format=api",
            "date": "2026-02-19T11:46:41",
            "name": "jbd2/ext4/ocfs2: lockless jinode dirty range",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/492665/mbox/"
        }
    ],
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2198115/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <SRS0=Pymd=AX=vger.kernel.org=linux-ext4+bounces-13744-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=IBDBCQBw;\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=pymd=ax=vger.kernel.org=linux-ext4+bounces-13744-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=pass (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=IBDBCQBw;\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-13744-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=\"IBDBCQBw\"",
            "smtp.subspace.kernel.org;\n arc=pass smtp.client-ip=136.143.188.15",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.beauty",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.beauty"
        ],
        "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 4fGs8P4Dqnz1xvg\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 22:48:21 +1100 (AEDT)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fGs8P3mXmz4w1v\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 22:48:21 +1100 (AEDT)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4fGs8P3hvSz4w8w; Thu, 19 Feb 2026 22:48:21 +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 4fGs8L0X6sz4w1v\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 19 Feb 2026 22:48:18 +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 4159A3028342\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 19 Feb 2026 11:47:59 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7D9E3304BDA;\n\tThu, 19 Feb 2026 11:47:58 +0000 (UTC)",
            "from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com\n [136.143.188.15])\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 F358B2EFD86;\n\tThu, 19 Feb 2026 11:47:56 +0000 (UTC)",
            "by mx.zohomail.com with SMTPS id 177150162461772.82110652436563;\n\tThu, 19 Feb 2026 03:47:04 -0800 (PST)"
        ],
        "ARC-Seal": [
            "i=3; a=rsa-sha256; d=ozlabs.org; s=201707; t=1771501701; cv=pass;\n\tb=E09J0lKLiWohjM2FSx37LGnSp4iDPehgleW6DDp2HVymWJkX3/QtT5wypQHEm1uqb+j7lugx8xGc1QWTBWPC/rSFIe2+xdmVZFBzaZml8Rpy+MP8Jc3UlEVkuzvBrq5hxLolHAo718m0Ctz0qQzg3bsDsypZG2L3ZjcLb/h/hxDfbLlkHnAadcrlkPuzpKH92onTxOwR/1VVadoaFlY/UbVqy23G1X3YsWdIWwEs1CPymvGGF4R+L2REntSouKRaMgZJPHzxD9mf3i5gk+SYdyU0dBEaZp9F5c6Q17GeqdPBDtCjH2KdVAGStzIM0pe7Kr1YLafnt2FujjGEexchrA==",
            "i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1771501678; cv=pass;\n b=F1OgRRgvZOZymtfEJclQdpTFb7aDD6RrHwtdF66oHrzfhmEhM1+9STh/R1F5/geiIst9jEnnwr5+chmZ9XFJBieMrAvdL7M+4OJtj+S6LSYLsgb+bnRDhbAGAgJ5rqa4hGaVJLe+5ZX2OHxb218Uzl1TeBtUSR4/hCRtK4so/HQ=",
            "i=1; a=rsa-sha256; t=1771501627; cv=none;\n\td=zohomail.com; s=zohoarc;\n\tb=Ppk4FyR/kI8wi6zJENcR7SsHq0y/GLJdaXieCYxbEiJUzpCE8EDlrbrqI0S7PYU/pj3ULKLM9y0SZVD2gvyDhTU1/SfLSCcAsV6HJR5R6CkjXgS7A9XfnFW+oshvSV/pRAyBKoWhAFmkWXtFueHixBT/0jyo4LpVl8HUEfZ+xc8="
        ],
        "ARC-Message-Signature": [
            "i=3; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1771501701; c=relaxed/relaxed;\n\tbh=Cx3WrzkDClvn7JkmLhU42Xsl09KwMYuZ02nSaGGQmyI=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=pA4Wn2Ogu6a9NNY17HCG0Vnj+LMXiqcDKTTGwytNdhaLRTENPhLVGhvoUvbEVe5khOHMhJcam4UIWXiiAGOG8KklziFmFUaxtTDKexpTqXIycpemSrTLoGboPMZuRXoJu++ZNjM3hvYPn9KOC0KM/RoseYX7SQkTRcjKwBTIBn3hxSd06033x3GDGolAHusqhLLlknMRiDprRnAVkQxvnfmAx/Wkn25x85p4oMvKZOPgYPAEEDa42++6OzMTq7OBvgWfPlHDZ/rjFl9kSuSr8VDVhLXOhlwytswqUXlaugCzN5KU31xYgi28Z1usLZNkw4gRmDGNzM5UpWIizh6kDA==",
            "i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1771501678; c=relaxed/simple;\n\tbh=2jnKPNyXtWVMoxlYjpTp6vfnHR4MlArkFxehPYw08fc=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=CUvVEhsMjRUiGK3lqZOCutorK44lhEKoQ2W9I17nk8+n6794K02FpPY9fxbxZysa5nYzLfWhzeTxAEqkCJQrUpD4FHnq1U6yzF02bvVXaqVzmafuYyPVDMINWRDTbyOG2ylD2jgVeoB3kLI9gdpTCkC8a5i6IzNCYVKxNs06Hbs=",
            "i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;\n s=zohoarc;\n\tt=1771501627;\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=Cx3WrzkDClvn7JkmLhU42Xsl09KwMYuZ02nSaGGQmyI=;\n\tb=FZ11lon7dETY+yUTNJWheCzQPYjHytJKzAd9lLuMvHUvMjSw3ksFOCKs3CvCyVLaczzxlrczsN0tXEhkkhIoDUrfM422TR9ar7L7qdMJnaf/lYRe83Y59Z4yiNQndnYZgE9AGphpzWLplL3MYmgh52/5TfXQM1ZvHDphc0coswg="
        ],
        "ARC-Authentication-Results": [
            "i=3; gandalf.ozlabs.org;\n dmarc=pass (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=IBDBCQBw; 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-13744-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org",
            "i=2; smtp.subspace.kernel.org;\n dmarc=pass (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=IBDBCQBw; arc=pass smtp.client-ip=136.143.188.15",
            "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=1771501627;\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=Cx3WrzkDClvn7JkmLhU42Xsl09KwMYuZ02nSaGGQmyI=;\n\tb=IBDBCQBwnFbmdUqv7HX5oDbn1qwsd289OXboa3tkevjjm0/Fgtq32ch35OeY33C2\n\t9OwCtDOIjC8cYeYoVPdyXjUibtRheQQhm6jaPWOtD5YSdtmkjQWOh81J319bcsyFUs3\n\t8YxwGL6XbtbyPxc1Gm4sjgDgwME1SpsZ6gqghmHk=",
        "From": "Li Chen <me@linux.beauty>",
        "To": "Theodore Ts'o <tytso@mit.edu>,\n\tJan Kara <jack@suse.cz>,\n\tMark Fasheh <mark@fasheh.com>,\n\tlinux-ext4@vger.kernel.org,\n\tocfs2-devel@lists.linux.dev,\n\tMatthew Wilcox <willy@infradead.org>,\n\tJan Kara <jack@suse.com>,\n\tlinux-kernel@vger.kernel.org",
        "Cc": "Li Chen <me@linux.beauty>",
        "Subject": "[PATCH v2 1/3] jbd2: store jinode dirty range in PAGE_SIZE units",
        "Date": "Thu, 19 Feb 2026 19:46:42 +0800",
        "Message-ID": "<20260219114645.778338-2-me@linux.beauty>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20260219114645.778338-1-me@linux.beauty>",
        "References": "<20260219114645.778338-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_PASS,\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 paths\nread them without holding the lock (e.g. fast commit helpers and ordered\ntruncate helpers).\n\nREAD_ONCE() alone is not sufficient for i_dirty_start/end as they are\nloff_t and 32-bit platforms can observe torn loads. Store the dirty range\nin PAGE_SIZE units as pgoff_t so lockless readers can take non-torn\nsnapshots.\n\nUse READ_ONCE() on the read side and WRITE_ONCE() on the write side for\nthe dirty range and i_flags to match the existing lockless access pattern.\n\nSuggested-by: Jan Kara <jack@suse.cz>\nReviewed-by: Jan Kara <jack@suse.cz>\nSigned-off-by: Li Chen <me@linux.beauty>\n---\nChanges since v1:\n- Store i_dirty_start/end in PAGE_SIZE units (pgoff_t) to avoid torn loads on\n  32-bit (pointed out by Matthew, suggested by Jan).\n- Use WRITE_ONCE() for i_dirty_* / i_flags updates (per Jan).\n- Drop pointless READ_ONCE() on i_vfs_inode in jbd2_wait_inode_data (per Jan).\n\n fs/jbd2/commit.c      | 65 ++++++++++++++++++++++++++++++++++---------\n fs/jbd2/journal.c     |  3 +-\n fs/jbd2/transaction.c | 20 ++++++++-----\n include/linux/jbd2.h  | 17 +++++++----\n 4 files changed, 78 insertions(+), 27 deletions(-)",
    "diff": "diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c\nindex 7203d2d2624d..d98f4dbde695 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,35 @@ 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+\tpgoff_t start, end;\n+\tloff_t start_byte, end_byte;\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 = 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+\tif (end == JBD2_INODE_DIRTY_RANGE_NONE)\n+\t\treturn 0;\n+\tstart_byte = (loff_t)start << PAGE_SHIFT;\n+\tend_byte = ((loff_t)end << PAGE_SHIFT) + PAGE_SIZE - 1;\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_byte, end_byte);\n }\n EXPORT_SYMBOL(jbd2_wait_inode_data);\n \n@@ -218,7 +247,8 @@ static int journal_submit_data_buffers(journal_t *journal,\n \tlist_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) {\n \t\tif (!(jinode->i_flags & JI_WRITE_DATA))\n \t\t\tcontinue;\n-\t\tjinode->i_flags |= JI_COMMIT_RUNNING;\n+\t\tWRITE_ONCE(jinode->i_flags,\n+\t\t\t   jinode->i_flags | JI_COMMIT_RUNNING);\n \t\tspin_unlock(&journal->j_list_lock);\n \t\t/* submit the inode data buffers. */\n \t\ttrace_jbd2_submit_inode_data(jinode->i_vfs_inode);\n@@ -229,7 +259,8 @@ static int journal_submit_data_buffers(journal_t *journal,\n \t\t}\n \t\tspin_lock(&journal->j_list_lock);\n \t\tJ_ASSERT(jinode->i_transaction == commit_transaction);\n-\t\tjinode->i_flags &= ~JI_COMMIT_RUNNING;\n+\t\tWRITE_ONCE(jinode->i_flags,\n+\t\t\t   jinode->i_flags & ~JI_COMMIT_RUNNING);\n \t\tsmp_mb();\n \t\twake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING);\n \t}\n@@ -240,10 +271,17 @@ 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+\tpgoff_t start = READ_ONCE(jinode->i_dirty_start);\n+\tpgoff_t end = READ_ONCE(jinode->i_dirty_end);\n+\tloff_t start_byte, end_byte;\n+\n+\tif (end == JBD2_INODE_DIRTY_RANGE_NONE)\n+\t\treturn 0;\n+\tstart_byte = (loff_t)start << PAGE_SHIFT;\n+\tend_byte = ((loff_t)end << PAGE_SHIFT) + PAGE_SIZE - 1;\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_byte, end_byte);\n }\n \n /*\n@@ -262,7 +300,7 @@ static int journal_finish_inode_data_buffers(journal_t *journal,\n \tlist_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) {\n \t\tif (!(jinode->i_flags & JI_WAIT_DATA))\n \t\t\tcontinue;\n-\t\tjinode->i_flags |= JI_COMMIT_RUNNING;\n+\t\tWRITE_ONCE(jinode->i_flags, jinode->i_flags | JI_COMMIT_RUNNING);\n \t\tspin_unlock(&journal->j_list_lock);\n \t\t/* wait for the inode data buffers writeout. */\n \t\tif (journal->j_finish_inode_data_buffers) {\n@@ -272,7 +310,7 @@ static int journal_finish_inode_data_buffers(journal_t *journal,\n \t\t}\n \t\tcond_resched();\n \t\tspin_lock(&journal->j_list_lock);\n-\t\tjinode->i_flags &= ~JI_COMMIT_RUNNING;\n+\t\tWRITE_ONCE(jinode->i_flags, jinode->i_flags & ~JI_COMMIT_RUNNING);\n \t\tsmp_mb();\n \t\twake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING);\n \t}\n@@ -288,8 +326,9 @@ static int journal_finish_inode_data_buffers(journal_t *journal,\n \t\t\t\t&jinode->i_transaction->t_inode_list);\n \t\t} else {\n \t\t\tjinode->i_transaction = NULL;\n-\t\t\tjinode->i_dirty_start = 0;\n-\t\t\tjinode->i_dirty_end = 0;\n+\t\t\tWRITE_ONCE(jinode->i_dirty_start, 0);\n+\t\t\tWRITE_ONCE(jinode->i_dirty_end,\n+\t\t\t\t   JBD2_INODE_DIRTY_RANGE_NONE);\n \t\t}\n \t}\n \tspin_unlock(&journal->j_list_lock);\ndiff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c\nindex c973162d5b31..9a7477c54dcb 100644\n--- a/fs/jbd2/journal.c\n+++ b/fs/jbd2/journal.c\n@@ -3021,7 +3021,7 @@ void jbd2_journal_init_jbd_inode(struct jbd2_inode *jinode, struct inode *inode)\n \tjinode->i_vfs_inode = inode;\n \tjinode->i_flags = 0;\n \tjinode->i_dirty_start = 0;\n-\tjinode->i_dirty_end = 0;\n+\tjinode->i_dirty_end = JBD2_INODE_DIRTY_RANGE_NONE;\n \tINIT_LIST_HEAD(&jinode->i_list);\n }\n \n@@ -3178,4 +3178,3 @@ MODULE_DESCRIPTION(\"Generic filesystem journal-writing module\");\n MODULE_LICENSE(\"GPL\");\n module_init(journal_init);\n module_exit(journal_exit);\n-\ndiff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c\nindex dca4b5d8aaaa..bbe47be6c73c 100644\n--- a/fs/jbd2/transaction.c\n+++ b/fs/jbd2/transaction.c\n@@ -2646,6 +2646,7 @@ static int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode,\n {\n \ttransaction_t *transaction = handle->h_transaction;\n \tjournal_t *journal;\n+\tpgoff_t start, end;\n \n \tif (is_handle_aborted(handle))\n \t\treturn -EROFS;\n@@ -2654,15 +2655,20 @@ static int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode,\n \tjbd2_debug(4, \"Adding inode %lu, tid:%d\\n\", jinode->i_vfs_inode->i_ino,\n \t\t\ttransaction->t_tid);\n \n+\tstart = (pgoff_t)(start_byte >> PAGE_SHIFT);\n+\tend = (pgoff_t)(end_byte >> PAGE_SHIFT);\n+\n \tspin_lock(&journal->j_list_lock);\n-\tjinode->i_flags |= flags;\n+\tWRITE_ONCE(jinode->i_flags, jinode->i_flags | flags);\n \n-\tif (jinode->i_dirty_end) {\n-\t\tjinode->i_dirty_start = min(jinode->i_dirty_start, start_byte);\n-\t\tjinode->i_dirty_end = max(jinode->i_dirty_end, end_byte);\n+\tif (jinode->i_dirty_end != JBD2_INODE_DIRTY_RANGE_NONE) {\n+\t\tWRITE_ONCE(jinode->i_dirty_start,\n+\t\t\t   min(jinode->i_dirty_start, start));\n+\t\tWRITE_ONCE(jinode->i_dirty_end,\n+\t\t\t   max(jinode->i_dirty_end, end));\n \t} else {\n-\t\tjinode->i_dirty_start = start_byte;\n-\t\tjinode->i_dirty_end = end_byte;\n+\t\tWRITE_ONCE(jinode->i_dirty_start, start);\n+\t\tWRITE_ONCE(jinode->i_dirty_end, end);\n \t}\n \n \t/* Is inode already attached where we need it? */\n@@ -2739,7 +2745,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\ndiff --git a/include/linux/jbd2.h b/include/linux/jbd2.h\nindex a53a00d36228..81eb58ddc126 100644\n--- a/include/linux/jbd2.h\n+++ b/include/linux/jbd2.h\n@@ -390,6 +390,8 @@ static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)\n /* Wait for outstanding data writes for this inode before commit */\n #define JI_WAIT_DATA (1 << __JI_WAIT_DATA)\n \n+#define JBD2_INODE_DIRTY_RANGE_NONE\t((pgoff_t)-1)\n+\n /**\n  * struct jbd2_inode - The jbd_inode type is the structure linking inodes in\n  * ordered mode present in a transaction so that we can sync them during commit.\n@@ -431,18 +433,23 @@ struct jbd2_inode {\n \t/**\n \t * @i_dirty_start:\n \t *\n-\t * Offset in bytes where the dirty range for this inode starts.\n+\t * Dirty range start in PAGE_SIZE units.\n+\t *\n+\t * The dirty range is empty if @i_dirty_end is set to\n+\t * %JBD2_INODE_DIRTY_RANGE_NONE.\n+\t *\n \t * [j_list_lock]\n \t */\n-\tloff_t i_dirty_start;\n+\tpgoff_t i_dirty_start;\n \n \t/**\n \t * @i_dirty_end:\n \t *\n-\t * Inclusive offset in bytes where the dirty range for this inode\n-\t * ends. [j_list_lock]\n+\t * Dirty range end in PAGE_SIZE units (inclusive).\n+\t *\n+\t * [j_list_lock]\n \t */\n-\tloff_t i_dirty_end;\n+\tpgoff_t i_dirty_end;\n };\n \n struct jbd2_revoke_table_s;\n",
    "prefixes": [
        "v2",
        "1/3"
    ]
}