get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 805049,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/805049/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20170823152627.19865-3-fw@strlen.de/",
    "project": {
        "id": 26,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/26/?format=api",
        "name": "Netfilter Development",
        "link_name": "netfilter-devel",
        "list_id": "netfilter-devel.vger.kernel.org",
        "list_email": "netfilter-devel@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170823152627.19865-3-fw@strlen.de>",
    "list_archive_url": null,
    "date": "2017-08-23T15:26:26",
    "name": "[nf-next,2/3] netfilter: debug: check for sorted array",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "1cfa1e8fa6593ed8589b9b1e4557c5dadf83667d",
    "submitter": {
        "id": 1025,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/1025/?format=api",
        "name": "Florian Westphal",
        "email": "fw@strlen.de"
    },
    "delegate": {
        "id": 6139,
        "url": "http://patchwork.ozlabs.org/api/1.2/users/6139/?format=api",
        "username": "pablo",
        "first_name": "Pablo",
        "last_name": "Neira",
        "email": "pablo@netfilter.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20170823152627.19865-3-fw@strlen.de/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/805049/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/805049/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netfilter-devel-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netfilter-devel-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xcrqZ6Mfzz9s7m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 24 Aug 2017 01:26:18 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932331AbdHWP0R (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 23 Aug 2017 11:26:17 -0400",
            "from Chamillionaire.breakpoint.cc ([146.0.238.67]:58166 \"EHLO\n\tChamillionaire.breakpoint.cc\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S932324AbdHWP0P (ORCPT\n\t<rfc822;netfilter-devel@vger.kernel.org>);\n\tWed, 23 Aug 2017 11:26:15 -0400",
            "from fw by Chamillionaire.breakpoint.cc with local (Exim 4.84_2)\n\t(envelope-from <fw@breakpoint.cc>)\n\tid 1dkXVO-0002SC-Ex; Wed, 23 Aug 2017 17:23:42 +0200"
        ],
        "From": "Florian Westphal <fw@strlen.de>",
        "To": "<netfilter-devel@vger.kernel.org>",
        "Cc": "aconole@bytheb.org, Florian Westphal <fw@strlen.de>",
        "Subject": "[PATCH nf-next 2/3] netfilter: debug: check for sorted array",
        "Date": "Wed, 23 Aug 2017 17:26:26 +0200",
        "Message-Id": "<20170823152627.19865-3-fw@strlen.de>",
        "X-Mailer": "git-send-email 2.13.0",
        "In-Reply-To": "<20170823152627.19865-1-fw@strlen.de>",
        "References": "<20170823152627.19865-1-fw@strlen.de>",
        "Sender": "netfilter-devel-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netfilter-devel.vger.kernel.org>",
        "X-Mailing-List": "netfilter-devel@vger.kernel.org"
    },
    "content": "Make sure our grow/shrink routine places them in the correct order.\n\nSigned-off-by: Florian Westphal <fw@strlen.de>\n---\n net/netfilter/core.c | 23 +++++++++++++++++++++++\n 1 file changed, 23 insertions(+)",
    "diff": "diff --git a/net/netfilter/core.c b/net/netfilter/core.c\nindex 6212958c9c58..8ca26729430b 100644\n--- a/net/netfilter/core.c\n+++ b/net/netfilter/core.c\n@@ -159,6 +159,27 @@ nf_hook_entries_grow(const struct nf_hook_entries *old,\n \treturn new;\n }\n \n+static void hooks_validate(const struct nf_hook_entries *hooks)\n+{\n+#ifdef CONFIG_DEBUG_KERNEL\n+\tstruct nf_hook_ops **orig_ops;\n+\tint prio = INT_MIN;\n+\tsize_t i = 0;\n+\n+\torig_ops = nf_hook_entries_get_hook_ops(hooks);\n+\n+\tfor (i = 0; i < hooks->num_hook_entries; i++) {\n+\t\tif (orig_ops[i] == &dummy_ops)\n+\t\t\tcontinue;\n+\n+\t\tWARN_ON(orig_ops[i]->priority < prio);\n+\n+\t\tif (orig_ops[i]->priority > prio)\n+\t\t\tprio = orig_ops[i]->priority;\n+\t}\n+#endif\n+}\n+\n /*\n  * __nf_hook_entries_try_shrink - try to shrink hook array\n  *\n@@ -212,6 +233,7 @@ static void *__nf_hook_entries_try_shrink(struct nf_hook_entries __rcu **pp)\n \t\tnew_ops[j] = (void *)orig_ops[i];\n \t\tj++;\n \t}\n+\thooks_validate(new);\n out_assign:\n \trcu_assign_pointer(*pp, new);\n \treturn old;\n@@ -263,6 +285,7 @@ int nf_register_net_hook(struct net *net, const struct nf_hook_ops *reg)\n \tif (IS_ERR(new_hooks))\n \t\treturn PTR_ERR(new_hooks);\n \n+\thooks_validate(new_hooks);\n #ifdef CONFIG_NETFILTER_INGRESS\n \tif (reg->pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS)\n \t\tnet_inc_ingress_queue();\n",
    "prefixes": [
        "nf-next",
        "2/3"
    ]
}