get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216347,
    "url": "http://patchwork.ozlabs.org/api/patches/2216347/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260326104544.509518-7-dhowells@redhat.com/",
    "project": {
        "id": 12,
        "url": "http://patchwork.ozlabs.org/api/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": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260326104544.509518-7-dhowells@redhat.com>",
    "list_archive_url": null,
    "date": "2026-03-26T10:45:21",
    "name": "[06/26] netfs: Fix the handling of stream->front by removing it",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "1ddcb9f8de188564daced8704de94ceb72af95c3",
    "submitter": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/people/59/?format=api",
        "name": "David Howells",
        "email": "dhowells@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260326104544.509518-7-dhowells@redhat.com/mbox/",
    "series": [
        {
            "id": 497565,
            "url": "http://patchwork.ozlabs.org/api/series/497565/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=497565",
            "date": "2026-03-26T10:45:15",
            "name": "netfs: Keep track of folios in a segmented bio_vec[] chain",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497565/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216347/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216347/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-10529-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=NZLv6Syv;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10529-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=\"NZLv6Syv\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=170.10.133.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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::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 legolas.ozlabs.org (Postfix) with ESMTPS id 4fhLP76dGtz1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 21:58:51 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id CF7AE311D810\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 10:48:49 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id DD401370D7E;\n\tThu, 26 Mar 2026 10:47:11 +0000 (UTC)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.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 D0A943E6387\n\tfor <linux-cifs@vger.kernel.org>; Thu, 26 Mar 2026 10:47:07 +0000 (UTC)",
            "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-244-6Q1OkKBWMNewwDpzF46dXQ-1; Thu,\n 26 Mar 2026 06:47:02 -0400",
            "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id F1A2819560B4;\n\tThu, 26 Mar 2026 10:46:59 +0000 (UTC)",
            "from warthog.procyon.org.com (unknown [10.44.33.121])\n\tby mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 42F741800673;\n\tThu, 26 Mar 2026 10:46:53 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774522031; cv=none;\n b=orUJaQ5/E+wENuRHdDCQhWSUVz6ish21cM77THlGAmWxlq8Lccse1K7rSHLxHZ1pmzGiozxnp1TNFS7JQcItfSjpHSB8tAH3CAc28PEokwKaDarN8cPstznN7DQO0lIDNIuwjWTpFW/xdxJWgmVVS6bOzUdjUFZr/Ga47ManvJw=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774522031; c=relaxed/simple;\n\tbh=JSDeL6SwtVG7tcOuyPSqzZl0BvtjT+R1aGX/1tT+wNA=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=NtDQcNO978ZxCo+iNvB1BiT3lmoHNKqunugcx2iEGGIddyeyjSwhFN5pk7AIYGiqMw05L2zPbT4sM0W5PK4l8QOXSzGBSdMK5d8Gtr2zt8l+VpeYfcnpkunjEIP433WO+BoaTXKLi02HL4Ym24ihX9Zn/5f6ggA88ww5nwjFfQo=",
        "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=NZLv6Syv; arc=none smtp.client-ip=170.10.133.124",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1774522026;\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=/tdvGHLBae6cwxkiV/xURdgZGIZUXmsfYZzZeOFw5ZU=;\n\tb=NZLv6Syv+6d/mRsMu24ch1CtmlR0b895r6hqzTbaR2a2Ei6OsvKntxoK/HtubDnEKLyp51\n\tG1zGrTreHhSKmkJ3OpBMMOotb4h1fqwrLOgOevzPngn8T0i+IZXs34bwiXbTQGTzawofOQ\n\tko//rEVHzguQUMaAz3RJEmgG15rGpMI=",
        "X-MC-Unique": "6Q1OkKBWMNewwDpzF46dXQ-1",
        "X-Mimecast-MFC-AGG-ID": "6Q1OkKBWMNewwDpzF46dXQ_1774522020",
        "From": "David Howells <dhowells@redhat.com>",
        "To": "Christian Brauner <christian@brauner.io>,\n\tMatthew Wilcox <willy@infradead.org>,\n\tChristoph Hellwig <hch@infradead.org>",
        "Cc": "David Howells <dhowells@redhat.com>,\n\tPaulo Alcantara <pc@manguebit.com>,\n\tJens Axboe <axboe@kernel.dk>,\n\tLeon Romanovsky <leon@kernel.org>,\n\tSteve French <sfrench@samba.org>,\n\tChenXiaoSong <chenxiaosong@chenxiaosong.com>,\n\tMarc Dionne <marc.dionne@auristor.com>,\n\tEric Van Hensbergen <ericvh@kernel.org>,\n\tDominique Martinet <asmadeus@codewreck.org>,\n\tIlya Dryomov <idryomov@gmail.com>,\n\tTrond Myklebust <trondmy@kernel.org>,\n\tnetfs@lists.linux.dev,\n\tlinux-afs@lists.infradead.org,\n\tlinux-cifs@vger.kernel.org,\n\tlinux-nfs@vger.kernel.org,\n\tceph-devel@vger.kernel.org,\n\tv9fs@lists.linux.dev,\n\tlinux-erofs@lists.ozlabs.org,\n\tlinux-fsdevel@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tPaulo Alcantara <pc@manguebit.org>",
        "Subject": "[PATCH 06/26] netfs: Fix the handling of stream->front by removing it",
        "Date": "Thu, 26 Mar 2026 10:45:21 +0000",
        "Message-ID": "<20260326104544.509518-7-dhowells@redhat.com>",
        "In-Reply-To": "<20260326104544.509518-1-dhowells@redhat.com>",
        "References": "<20260326104544.509518-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.93"
    },
    "content": "The netfs_io_stream::front member is meant to point to the subrequest\ncurrently being collected on a stream, but it isn't actually used this way\nby direct write (which mostly ignores it).  However, there's a tracepoint\nwhich looks at it.  Further, stream->front is actually redundant with\nstream->subrequests.next.\n\nFix the potential problem in the direct code by just removing the member\nand using stream->subrequests.next instead, thereby also simplifying the\ncode.\n\nFixes: a0b4c7a49137 (\"netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict sequence\")\nReported-by: Paulo Alcantara <pc@manguebit.org>\nSigned-off-by: David Howells <dhowells@redhat.com>\ncc: netfs@lists.linux.dev\ncc: linux-fsdevel@vger.kernel.org\n---\n fs/netfs/buffered_read.c     | 3 +--\n fs/netfs/direct_read.c       | 3 +--\n fs/netfs/direct_write.c      | 1 -\n fs/netfs/read_collect.c      | 4 ++--\n fs/netfs/read_single.c       | 1 -\n fs/netfs/write_collect.c     | 4 ++--\n fs/netfs/write_issue.c       | 3 +--\n include/linux/netfs.h        | 1 -\n include/trace/events/netfs.h | 8 ++++----\n 9 files changed, 11 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c\nindex 88a0d801525f..a8c0d86118c5 100644\n--- a/fs/netfs/buffered_read.c\n+++ b/fs/netfs/buffered_read.c\n@@ -171,9 +171,8 @@ static void netfs_queue_read(struct netfs_io_request *rreq,\n \tspin_lock(&rreq->lock);\n \tlist_add_tail(&subreq->rreq_link, &stream->subrequests);\n \tif (list_is_first(&subreq->rreq_link, &stream->subrequests)) {\n-\t\tstream->front = subreq;\n \t\tif (!stream->active) {\n-\t\t\tstream->collected_to = stream->front->start;\n+\t\t\tstream->collected_to = subreq->start;\n \t\t\t/* Store list pointers before active flag */\n \t\t\tsmp_store_release(&stream->active, true);\n \t\t}\ndiff --git a/fs/netfs/direct_read.c b/fs/netfs/direct_read.c\nindex a498ee8d6674..f72e6da88cca 100644\n--- a/fs/netfs/direct_read.c\n+++ b/fs/netfs/direct_read.c\n@@ -71,9 +71,8 @@ static int netfs_dispatch_unbuffered_reads(struct netfs_io_request *rreq)\n \t\tspin_lock(&rreq->lock);\n \t\tlist_add_tail(&subreq->rreq_link, &stream->subrequests);\n \t\tif (list_is_first(&subreq->rreq_link, &stream->subrequests)) {\n-\t\t\tstream->front = subreq;\n \t\t\tif (!stream->active) {\n-\t\t\t\tstream->collected_to = stream->front->start;\n+\t\t\t\tstream->collected_to = subreq->start;\n \t\t\t\t/* Store list pointers before active flag */\n \t\t\t\tsmp_store_release(&stream->active, true);\n \t\t\t}\ndiff --git a/fs/netfs/direct_write.c b/fs/netfs/direct_write.c\nindex 4d9760e36c11..f9ab69de3e29 100644\n--- a/fs/netfs/direct_write.c\n+++ b/fs/netfs/direct_write.c\n@@ -111,7 +111,6 @@ static int netfs_unbuffered_write(struct netfs_io_request *wreq)\n \t\t\tnetfs_prepare_write(wreq, stream, wreq->start + wreq->transferred);\n \t\t\tsubreq = stream->construct;\n \t\t\tstream->construct = NULL;\n-\t\t\tstream->front = NULL;\n \t\t}\n \n \t\t/* Check if (re-)preparation failed. */\ndiff --git a/fs/netfs/read_collect.c b/fs/netfs/read_collect.c\nindex 137f0e28a44c..e5f6665b3341 100644\n--- a/fs/netfs/read_collect.c\n+++ b/fs/netfs/read_collect.c\n@@ -205,7 +205,8 @@ static void netfs_collect_read_results(struct netfs_io_request *rreq)\n \t * in progress.  The issuer thread may be adding stuff to the tail\n \t * whilst we're doing this.\n \t */\n-\tfront = READ_ONCE(stream->front);\n+\tfront = list_first_entry_or_null(&stream->subrequests,\n+\t\t\t\t\t struct netfs_io_subrequest, rreq_link);\n \twhile (front) {\n \t\tsize_t transferred;\n \n@@ -301,7 +302,6 @@ static void netfs_collect_read_results(struct netfs_io_request *rreq)\n \t\tlist_del_init(&front->rreq_link);\n \t\tfront = list_first_entry_or_null(&stream->subrequests,\n \t\t\t\t\t\t struct netfs_io_subrequest, rreq_link);\n-\t\tstream->front = front;\n \t\tspin_unlock(&rreq->lock);\n \t\tnetfs_put_subrequest(remove,\n \t\t\t\t     notes & ABANDON_SREQ ?\ndiff --git a/fs/netfs/read_single.c b/fs/netfs/read_single.c\nindex 8e6264f62a8f..d0e23bc42445 100644\n--- a/fs/netfs/read_single.c\n+++ b/fs/netfs/read_single.c\n@@ -107,7 +107,6 @@ static int netfs_single_dispatch_read(struct netfs_io_request *rreq)\n \tspin_lock(&rreq->lock);\n \tlist_add_tail(&subreq->rreq_link, &stream->subrequests);\n \ttrace_netfs_sreq(subreq, netfs_sreq_trace_added);\n-\tstream->front = subreq;\n \t/* Store list pointers before active flag */\n \tsmp_store_release(&stream->active, true);\n \tspin_unlock(&rreq->lock);\ndiff --git a/fs/netfs/write_collect.c b/fs/netfs/write_collect.c\nindex 83eb3dc1adf8..b194447f4b11 100644\n--- a/fs/netfs/write_collect.c\n+++ b/fs/netfs/write_collect.c\n@@ -228,7 +228,8 @@ static void netfs_collect_write_results(struct netfs_io_request *wreq)\n \t\tif (!smp_load_acquire(&stream->active))\n \t\t\tcontinue;\n \n-\t\tfront = stream->front;\n+\t\tfront = list_first_entry_or_null(&stream->subrequests,\n+\t\t\t\t\t\t struct netfs_io_subrequest, rreq_link);\n \t\twhile (front) {\n \t\t\ttrace_netfs_collect_sreq(wreq, front);\n \t\t\t//_debug(\"sreq [%x] %llx %zx/%zx\",\n@@ -279,7 +280,6 @@ static void netfs_collect_write_results(struct netfs_io_request *wreq)\n \t\t\tlist_del_init(&front->rreq_link);\n \t\t\tfront = list_first_entry_or_null(&stream->subrequests,\n \t\t\t\t\t\t\t struct netfs_io_subrequest, rreq_link);\n-\t\t\tstream->front = front;\n \t\t\tspin_unlock(&wreq->lock);\n \t\t\tnetfs_put_subrequest(remove,\n \t\t\t\t\t     notes & SAW_FAILURE ?\ndiff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c\nindex 437268f65640..2db688f94125 100644\n--- a/fs/netfs/write_issue.c\n+++ b/fs/netfs/write_issue.c\n@@ -206,9 +206,8 @@ void netfs_prepare_write(struct netfs_io_request *wreq,\n \tspin_lock(&wreq->lock);\n \tlist_add_tail(&subreq->rreq_link, &stream->subrequests);\n \tif (list_is_first(&subreq->rreq_link, &stream->subrequests)) {\n-\t\tstream->front = subreq;\n \t\tif (!stream->active) {\n-\t\t\tstream->collected_to = stream->front->start;\n+\t\t\tstream->collected_to = subreq->start;\n \t\t\t/* Write list pointers before active flag */\n \t\t\tsmp_store_release(&stream->active, true);\n \t\t}\ndiff --git a/include/linux/netfs.h b/include/linux/netfs.h\nindex 72ee7d210a74..ba17ac5bf356 100644\n--- a/include/linux/netfs.h\n+++ b/include/linux/netfs.h\n@@ -140,7 +140,6 @@ struct netfs_io_stream {\n \tvoid (*issue_write)(struct netfs_io_subrequest *subreq);\n \t/* Collection tracking */\n \tstruct list_head\tsubrequests;\t/* Contributory I/O operations */\n-\tstruct netfs_io_subrequest *front;\t/* Op being collected */\n \tunsigned long long\tcollected_to;\t/* Position we've collected results to */\n \tsize_t\t\t\ttransferred;\t/* The amount transferred from this stream */\n \tunsigned short\t\terror;\t\t/* Aggregate error for the stream */\ndiff --git a/include/trace/events/netfs.h b/include/trace/events/netfs.h\nindex 2d366be46a1c..cbe28211106c 100644\n--- a/include/trace/events/netfs.h\n+++ b/include/trace/events/netfs.h\n@@ -740,19 +740,19 @@ TRACE_EVENT(netfs_collect_stream,\n \t\t    __field(unsigned int,\twreq)\n \t\t    __field(unsigned char,\tstream)\n \t\t    __field(unsigned long long,\tcollected_to)\n-\t\t    __field(unsigned long long,\tfront)\n+\t\t    __field(unsigned long long,\tissued_to)\n \t\t\t     ),\n \n \t    TP_fast_assign(\n \t\t    __entry->wreq\t= wreq->debug_id;\n \t\t    __entry->stream\t= stream->stream_nr;\n \t\t    __entry->collected_to = stream->collected_to;\n-\t\t    __entry->front\t= stream->front ? stream->front->start : UINT_MAX;\n+\t\t    __entry->issued_to\t= atomic64_read(&wreq->issued_to);\n \t\t\t   ),\n \n-\t    TP_printk(\"R=%08x[%x:] cto=%llx frn=%llx\",\n+\t    TP_printk(\"R=%08x[%x:] cto=%llx ito=%llx\",\n \t\t      __entry->wreq, __entry->stream,\n-\t\t      __entry->collected_to, __entry->front)\n+\t\t      __entry->collected_to, __entry->issued_to)\n \t    );\n \n TRACE_EVENT(netfs_folioq,\n",
    "prefixes": [
        "06/26"
    ]
}