get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1072848,
    "url": "http://patchwork.ozlabs.org/api/patches/1072848/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20190401140903.19186-4-eblake@redhat.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20190401140903.19186-4-eblake@redhat.com>",
    "list_archive_url": null,
    "date": "2019-04-01T14:08:52",
    "name": "[PULL,03/14] nbd: Don't lose server's error to NBD_CMD_BLOCK_STATUS",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4a0f52fc87e5b1d828cd84a3b5115537a058f1f2",
    "submitter": {
        "id": 6591,
        "url": "http://patchwork.ozlabs.org/api/people/6591/?format=api",
        "name": "Eric Blake",
        "email": "eblake@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20190401140903.19186-4-eblake@redhat.com/mbox/",
    "series": [
        {
            "id": 100345,
            "url": "http://patchwork.ozlabs.org/api/series/100345/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=100345",
            "date": "2019-04-01T14:08:49",
            "name": "[PULL,01/14] qemu-img: Report bdrv_block_status failures",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/100345/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1072848/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1072848/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=209.51.188.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=redhat.com"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 44XvYl0D0mz9sPj\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  2 Apr 2019 01:17:31 +1100 (AEDT)",
            "from localhost ([127.0.0.1]:35264 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1hAxke-0002X1-Sp\n\tfor incoming@patchwork.ozlabs.org; Mon, 01 Apr 2019 10:17:28 -0400",
            "from eggs.gnu.org ([209.51.188.92]:45770)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1hAxce-0001tj-QD\n\tfor qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:09:13 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1hAxcd-0004iz-N7\n\tfor qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:09:12 -0400",
            "from mx1.redhat.com ([209.132.183.28]:40232)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1hAxcb-0004gr-0D; Mon, 01 Apr 2019 10:09:09 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 4E59D309707A;\n\tMon,  1 Apr 2019 14:09:08 +0000 (UTC)",
            "from blue.redhat.com (ovpn-116-75.phx2.redhat.com [10.3.116.75])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id B18E227CB3;\n\tMon,  1 Apr 2019 14:09:07 +0000 (UTC)"
        ],
        "From": "Eric Blake <eblake@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Mon,  1 Apr 2019 09:08:52 -0500",
        "Message-Id": "<20190401140903.19186-4-eblake@redhat.com>",
        "In-Reply-To": "<20190401140903.19186-1-eblake@redhat.com>",
        "References": "<20190401140903.19186-1-eblake@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.84 on 10.5.11.23",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.43]);\n\tMon, 01 Apr 2019 14:09:08 +0000 (UTC)",
        "Content-Transfer-Encoding": "quoted-printable",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]",
        "X-Received-From": "209.132.183.28",
        "Subject": "[Qemu-devel] [PULL 03/14] nbd: Don't lose server's error to\n\tNBD_CMD_BLOCK_STATUS",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Cc": "Kevin Wolf <kwolf@redhat.com>,\n\tVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,\n\t\"open list:Network Block Dev...\" <qemu-block@nongnu.org>,\n\tMax Reitz <mreitz@redhat.com>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"
    },
    "content": "When the server replies with a (structured [*]) error to\nNBD_CMD_BLOCK_STATUS, without any extent information sent first, the\nclient code was blindly throwing away the server's error code and\ninstead telling the caller that EIO occurred.  This has been broken\nsince its introduction in 78a33ab5 (v2.12, where we should have called:\n   error_setg(&local_err, \"Server did not reply with any status extents\");\n   nbd_iter_error(&iter, false, -EIO, &local_err);\nto declare the situation as a non-fatal error if no earlier error had\nalready been flagged, rather than just blindly slamming iter.err and\niter.ret), although it is more noticeable since commit 7f86068d, which\nactually tries hard to preserve the server's code thanks to a separate\niter.request_ret.\n\n[*] The spec is clear that the server is also permitted to reply with\na simple error, but that's a separate fix.\n\nI was able to provoke this scenario with a hack to the server, then\nseeing whether ENOMEM makes it back to the caller:\n\n| diff --git a/nbd/server.c b/nbd/server.c\n| index fd013a2817a..29c7995de02 100644\n| --- a/nbd/server.c\n| +++ b/nbd/server.c\n| @@ -2269,6 +2269,8 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,\n|                                        \"discard failed\", errp);\n|\n|      case NBD_CMD_BLOCK_STATUS:\n| +        return nbd_send_generic_reply(client, request->handle, -ENOMEM,\n| +                                      \"no status for you today\", errp);\n|          if (!request->len) {\n|              return nbd_send_generic_reply(client, request->handle, -EINVAL,\n|                                            \"need non-zero length\", errp);\n| --\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <20190325190104.30213-2-eblake@redhat.com>\nReviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>\n---\n block/nbd-client.c | 9 +++------\n 1 file changed, 3 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/block/nbd-client.c b/block/nbd-client.c\nindex 8fe660b6093..b37a5963013 100644\n--- a/block/nbd-client.c\n+++ b/block/nbd-client.c\n@@ -769,12 +769,9 @@ static int nbd_co_receive_blockstatus_reply(NBDClientSession *s,\n         payload = NULL;\n     }\n\n-    if (!extent->length && !iter.err) {\n-        error_setg(&iter.err,\n-                   \"Server did not reply with any status extents\");\n-        if (!iter.ret) {\n-            iter.ret = -EIO;\n-        }\n+    if (!extent->length && !iter.request_ret) {\n+        error_setg(&local_err, \"Server did not reply with any status extents\");\n+        nbd_iter_channel_error(&iter, -EIO, &local_err);\n     }\n\n     error_propagate(errp, iter.err);\n",
    "prefixes": [
        "PULL",
        "03/14"
    ]
}