get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2228980,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228980/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260427152953.180038-10-dhowells@redhat.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": "<20260427152953.180038-10-dhowells@redhat.com>",
    "date": "2026-04-27T15:29:36",
    "name": "[v4,09/22] netfs: Fix netfs_invalidate_folio() to clear dirty bit if all changes gone",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "8d9905fa0b9347188fa0bf3b48962021e3c0cb57",
    "submitter": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/59/?format=api",
        "name": "David Howells",
        "email": "dhowells@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260427152953.180038-10-dhowells@redhat.com/mbox/",
    "series": [
        {
            "id": 501677,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501677/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=501677",
            "date": "2026-04-27T15:29:27",
            "name": "netfs: Miscellaneous fixes",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/501677/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228980/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228980/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-11152-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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=eMrTuxzG;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-cifs+bounces-11152-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=\"eMrTuxzG\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=170.10.129.124",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=redhat.com"
        ],
        "Received": [
            "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\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 4g47BH2Ktrz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 01:43:03 +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 E20DE33E718B\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 15:36:14 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 02F9634F49F;\n\tMon, 27 Apr 2026 15:30:57 +0000 (UTC)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.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 702E534F255\n\tfor <linux-cifs@vger.kernel.org>; Mon, 27 Apr 2026 15:30:55 +0000 (UTC)",
            "from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-457-I7iT7UYXMKaqiWSCxLJ2dQ-1; Mon,\n 27 Apr 2026 11:30:49 -0400",
            "from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 47F5C18001D6;\n\tMon, 27 Apr 2026 15:30:45 +0000 (UTC)",
            "from warthog.procyon.org.com (unknown [10.44.32.126])\n\tby mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id A5EA5180047F;\n\tMon, 27 Apr 2026 15:30:41 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777303856; cv=none;\n b=ULRGKwDNSIaXpxyOZUtPzrfL41BjCYmhwhpt757YEEklaS6M0MkM73wqvA5c8mCtLB2F7QyMlaASVijNi6gicmnSpjxphGVcEwO+Fq+3EBxtZJJfNPeD8ck0M8CDYfzS5LMQtp4ghqIx60cBgvGMNOedoe2AyOSPExwrG7XNJWo=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777303856; c=relaxed/simple;\n\tbh=VrBMZhmWiHPaD8tO+9hsAivp0KvomApYCwcuJnCGxUs=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=qoF0b6VmeS0ZuW+G6eWswKNmxOIQ/vKhbKU2kzojSPRy1/hzJDLeCon14QJRkHdiREKAIHEaBhRu8Zk2IkgIGK0egV40f/lo/gR5LGi1I3+6ZWouycsMaknUJfCgF5gjM6CbkL5TLuXhc6pyXEz2vMSu+zC+Of3YGCTEIgubJXA=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com;\n spf=pass smtp.mailfrom=redhat.com;\n dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=eMrTuxzG; arc=none smtp.client-ip=170.10.129.124",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1777303854;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=xJlXFm6gho8MPz3RsbSXNfFwZ2mKHUMmXSQpBOBJ+wU=;\n\tb=eMrTuxzGkPnuwT8Nhoex9pIVyoXDi7ufG+Gbd0Vrlfh0AR7CqeO5X/1YxcxHOx4kudEeyi\n\t7eJXssvDFXQlXoJBHX+oqXPlyaYx+c7F99hcdeXZU5Xq1CS46izEatnSn/rDvd3Qt6gEJg\n\tXxuLsRXVxdJ961cjmRT7iYELn7YsSGs=",
        "X-MC-Unique": "I7iT7UYXMKaqiWSCxLJ2dQ-1",
        "X-Mimecast-MFC-AGG-ID": "I7iT7UYXMKaqiWSCxLJ2dQ_1777303845",
        "From": "David Howells <dhowells@redhat.com>",
        "To": "Christian Brauner <christian@brauner.io>",
        "Cc": "David Howells <dhowells@redhat.com>,\n\tPaulo Alcantara <pc@manguebit.org>,\n\tnetfs@lists.linux.dev,\n\tlinux-afs@lists.infradead.org,\n\tlinux-cifs@vger.kernel.org,\n\tceph-devel@vger.kernel.org,\n\tlinux-fsdevel@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tMarc Dionne <marc.dionne@auristor.com>,\n\tMatthew Wilcox <willy@infradead.org>",
        "Subject": "[PATCH v4 09/22] netfs: Fix netfs_invalidate_folio() to clear dirty\n bit if all changes gone",
        "Date": "Mon, 27 Apr 2026 16:29:36 +0100",
        "Message-ID": "<20260427152953.180038-10-dhowells@redhat.com>",
        "In-Reply-To": "<20260427152953.180038-1-dhowells@redhat.com>",
        "References": "<20260427152953.180038-1-dhowells@redhat.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",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.111"
    },
    "content": "If a streaming write is made, this will leave the relevant modified folio\nin a not-uptodate, but dirty state with a netfs_folio struct hung off of\nfolio->private indicating the dirty range.  Subsequently truncating the\nfile such that the dirty data in the folio is removed, but the first part\nof the folio theoretically remains will cause the netfs_folio struct to be\ndiscarded... but will leave the dirty flag set.\n\nIf the folio is then read via mmap(), netfs_read_folio() will see that the\npage is dirty and jump to netfs_read_gaps() to fill in the missing bits.\nnetfs_read_gaps(), however, expects there to be a netfs_folio struct\npresent and can oops because truncate removed it.\n\nFix this by calling folio_cancel_dirty() in netfs_invalidate_folio() in the\nevent that all the dirty data in the folio is erased (as nfs does).\n\nAlso add some tracepoints to log modifications to a dirty page.\n\nThis can be reproduced with something like:\n\n    dd if=/dev/zero of=/xfstest.test/foo bs=1M count=1\n    umount /xfstest.test\n    mount /xfstest.test\n    xfs_io -c \"w 0xbbbf 0xf96c\" \\\n           -c \"truncate 0xbbbf\" \\\n           -c \"mmap -r 0xb000 0x11000\" \\\n           -c \"mr 0xb000 0x11000\" \\\n           /xfstest.test/foo\n\nwith fscaching disabled (otherwise streaming writes are suppressed) and a\nchange to netfs_perform_write() to disallow streaming writes if the fd is\nopen O_RDWR:\n\n\tif (//(file->f_mode & FMODE_READ) || <--- comment this out\n\t    netfs_is_cache_enabled(ctx)) {\n\nIt should be reproducible even without this change, but if prevents the\nabove trivial xfs_io command from reproducing it.\n\nNote that the initial dd is important: the file must start out sufficiently\nlarge that the zero-point logic doesn't just clear the gaps because it\nknows there's nothing in the file to read yet.  Unmounting and mounting is\nneeded to clear the pagecache (there are other ways to do that that may\nalso work).\n\nThis was initially reproduced with the generic/522 xfstest on some patches\nthat remove the FMODE_READ restriction.\n\nFixes: 9ebff83e6481 (\"netfs: Prep to use folio->private for write grouping and streaming write\")\nReported-by: Marc Dionne <marc.dionne@auristor.com>\nSigned-off-by: David Howells <dhowells@redhat.com>\ncc: Paulo Alcantara <pc@manguebit.org>\ncc: Matthew Wilcox <willy@infradead.org>\ncc: netfs@lists.linux.dev\ncc: linux-fsdevel@vger.kernel.org\n---\n fs/netfs/misc.c              | 6 +++++-\n include/trace/events/netfs.h | 4 ++++\n 2 files changed, 9 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/fs/netfs/misc.c b/fs/netfs/misc.c\nindex 37d9651078e6..4e91a8d75bce 100644\n--- a/fs/netfs/misc.c\n+++ b/fs/netfs/misc.c\n@@ -256,6 +256,7 @@ void netfs_invalidate_folio(struct folio *folio, size_t offset, size_t length)\n \t\t\t/* Move the start of the data. */\n \t\t\tfinfo->dirty_len = fend - iend;\n \t\t\tfinfo->dirty_offset = offset;\n+\t\t\ttrace_netfs_folio(folio, netfs_folio_trace_invalidate_front);\n \t\t\treturn;\n \t\t}\n \n@@ -264,12 +265,14 @@ void netfs_invalidate_folio(struct folio *folio, size_t offset, size_t length)\n \t\t */\n \t\tif (iend >= fend) {\n \t\t\tfinfo->dirty_len = offset - fstart;\n+\t\t\ttrace_netfs_folio(folio, netfs_folio_trace_invalidate_tail);\n \t\t\treturn;\n \t\t}\n \n \t\t/* A partial write was split.  The caller has already zeroed\n \t\t * it, so just absorb the hole.\n \t\t */\n+\t\ttrace_netfs_folio(folio, netfs_folio_trace_invalidate_middle);\n \t}\n \treturn;\n \n@@ -277,8 +280,9 @@ void netfs_invalidate_folio(struct folio *folio, size_t offset, size_t length)\n \tnetfs_put_group(netfs_folio_group(folio));\n \tfolio_detach_private(folio);\n \tfolio_clear_uptodate(folio);\n+\tfolio_cancel_dirty(folio);\n \tkfree(finfo);\n-\treturn;\n+\ttrace_netfs_folio(folio, netfs_folio_trace_invalidate_all);\n }\n EXPORT_SYMBOL(netfs_invalidate_folio);\n \ndiff --git a/include/trace/events/netfs.h b/include/trace/events/netfs.h\nindex 8c936fc575d5..0b702f74aefe 100644\n--- a/include/trace/events/netfs.h\n+++ b/include/trace/events/netfs.h\n@@ -194,6 +194,10 @@\n \tEM(netfs_folio_trace_copy_to_cache,\t\"mark-copy\")\t\\\n \tEM(netfs_folio_trace_end_copy,\t\t\"end-copy\")\t\\\n \tEM(netfs_folio_trace_filled_gaps,\t\"filled-gaps\")\t\\\n+\tEM(netfs_folio_trace_invalidate_all,\t\"inval-all\")\t\\\n+\tEM(netfs_folio_trace_invalidate_front,\t\"inval-front\")\t\\\n+\tEM(netfs_folio_trace_invalidate_middle,\t\"inval-mid\")\t\\\n+\tEM(netfs_folio_trace_invalidate_tail,\t\"inval-tail\")\t\\\n \tEM(netfs_folio_trace_kill,\t\t\"kill\")\t\t\\\n \tEM(netfs_folio_trace_kill_cc,\t\t\"kill-cc\")\t\\\n \tEM(netfs_folio_trace_kill_g,\t\t\"kill-g\")\t\\\n",
    "prefixes": [
        "v4",
        "09/22"
    ]
}