get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1707769,
    "url": "http://patchwork.ozlabs.org/api/patches/1707769/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-um/patch/20221122100759.208290-9-benjamin@sipsolutions.net/",
    "project": {
        "id": 60,
        "url": "http://patchwork.ozlabs.org/api/projects/60/?format=api",
        "name": "User-mode Linux Development",
        "link_name": "linux-um",
        "list_id": "linux-um.lists.infradead.org",
        "list_email": "linux-um@lists.infradead.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20221122100759.208290-9-benjamin@sipsolutions.net>",
    "list_archive_url": null,
    "date": "2022-11-22T10:07:39",
    "name": "[v2,08/28] um: Reap winch thread if it fails",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "6f9ae4ef59b72f7a3a994333bdd1e47e66572756",
    "submitter": {
        "id": 67525,
        "url": "http://patchwork.ozlabs.org/api/people/67525/?format=api",
        "name": "Benjamin Berg",
        "email": "benjamin@sipsolutions.net"
    },
    "delegate": {
        "id": 54851,
        "url": "http://patchwork.ozlabs.org/api/users/54851/?format=api",
        "username": "rw",
        "first_name": "Richard",
        "last_name": "Weinberger",
        "email": "richard@nod.at"
    },
    "mbox": "http://patchwork.ozlabs.org/project/linux-um/patch/20221122100759.208290-9-benjamin@sipsolutions.net/mbox/",
    "series": [
        {
            "id": 329466,
            "url": "http://patchwork.ozlabs.org/api/series/329466/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-um/list/?series=329466",
            "date": "2022-11-22T10:07:37",
            "name": "Implement SECCOMP based userland",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/329466/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1707769/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1707769/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=<UNKNOWN>)",
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=qqwyI0pV;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256\n header.s=desiato.20200630 header.b=lqrcOMk3;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=sipsolutions.net header.i=@sipsolutions.net\n header.a=rsa-sha256 header.s=mail header.b=r4u2oecF;\n\tdkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4NGgRZ3Gztz23nm\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 22 Nov 2022 21:27:06 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux))\n\tid 1oxQUU-007nwX-Ft; Tue, 22 Nov 2022 10:26:58 +0000",
            "from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05])\n\tby bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux))\n\tid 1oxQTL-007nM8-Oc\n\tfor linux-um@bombadil.infradead.org; Tue, 22 Nov 2022 10:25:47 +0000",
            "from s3.sipsolutions.net ([2a01:4f8:191:4433::2]\n helo=sipsolutions.net)\n\tby desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux))\n\tid 1oxQF1-003P1t-8D\n\tfor linux-um@lists.infradead.org; Tue, 22 Nov 2022 10:11:06 +0000",
            "by sipsolutions.net with esmtpsa\n (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim 4.96)\n\t(envelope-from <benjamin@sipsolutions.net>)\n\tid 1oxQEn-006IGn-32;\n\tTue, 22 Nov 2022 11:10:46 +0100"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=r1iLqhhTkKRzqdddibSKMWzqNEU9q3SR+9QcTeHSOW8=; b=qqwyI0pVtZEQoi\n\tCPK2lv/XEPCw/lHfyU94bxXvTFE4EWURGBw8MQfBEt4iDCjOmt3FkBUPhL+6JVMOB8glVaxnpZSAb\n\tacUUbUCHqdLscPBhWysTFL7zJh/+piTs+p2rN5sVXen8TKHRqgb4YIhLUwLYvubooOzMJMNN+dlXD\n\t2CaxPl3oH3hITiYwkvnbWABHRojaYSBkMlulsux9OFSgLPkWtHmJsFx31zQhOa6Ul6pweSrvd1d6v\n\tk0uc6yJ/WrQNjjJOC0AjQM/uXX050C0lHY9zop5U+R5S3cwcNchdfNMc2hAzYy1Ca30f/3833DING\n\thokOPgSsUevoNIxF/oNQ==;",
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version\n\t:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:\n\tContent-Type:Content-ID:Content-Description;\n\tbh=5P81qnzTcChuIaNhaa4ZlDz9aT2og1d1jl4cX4zqzdc=; b=lqrcOMk3PBIc08lNxFiTRWcRQH\n\t9y8mSDbQ4aVlHmkEBEcf7NK5gEaZ1cJ2DavaXrvGy1p8RxazDnIyPpqQgr/bEKDeV076pj9RfWX54\n\tld6byrcSb6bzgg1v4UgTtC4l23CqpT05DlCP8eZQH1uravDwTmzRuzdikT/M99TLB3Yk13hMQ9iCD\n\tsIoHKrRQAV7tuK7E8iIG1uXpgcuU9MjCjoL8XCkjMbocnXQVEyZB6/QJRrPLgI5qn/r3+W1Zdw5dE\n\t4PEeiFHBC0/sYSlZQ+rsKT1qPZ3GTDUai7L/NKPUDcS6aHHWqjd0c4yDmX8q+7vX2zfgRSkKwu9cX\n\thOaa9J/g==;",
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version:\n\tReferences:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender\n\t:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To:\n\tResent-Cc:Resent-Message-ID; bh=5P81qnzTcChuIaNhaa4ZlDz9aT2og1d1jl4cX4zqzdc=;\n\tt=1669111858; x=1670321458; b=r4u2oecFtJ7uBqnvZfGiStlLCH72c+SlX3QjbDmVN3OCjBc\n\tRE5BAiDFj83EX1RTbSfouYEUBKlm3oLXH9ni2NURJpOwL49Eewc2rs4Styn0KAepae16FlpUhg7WZ\n\txRv5MAT7OJ6xA7QgoaQy955Cl0SB/qDZ2cBCLFMtVlmhLO1KqlnltPWwWBLkKCQJhCoC5gB1XJsN0\n\trlrQBp4bFIRtpAulmRd7KVpvBZqvW4N/3Xjtawd1RtqYvhhQM/MeZiSEXt7C5UyHZZrpkWZJSAgh1\n\tCSjU5m+9qArhzzM2pSawZ6eOz/VYBer90jogtrXkVri+YW2/FhgZBOz5B+iPuagQ==;"
        ],
        "From": "benjamin@sipsolutions.net",
        "To": "linux-um@lists.infradead.org",
        "Cc": "Benjamin Berg <benjamin@sipsolutions.net>",
        "Subject": "[PATCH v2 08/28] um: Reap winch thread if it fails",
        "Date": "Tue, 22 Nov 2022 11:07:39 +0100",
        "Message-Id": "<20221122100759.208290-9-benjamin@sipsolutions.net>",
        "X-Mailer": "git-send-email 2.38.1",
        "In-Reply-To": "<20221122100759.208290-1-benjamin@sipsolutions.net>",
        "References": "<20221122100759.208290-1-benjamin@sipsolutions.net>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20221122_101101_152800_4262880D ",
        "X-CRM114-Status": "GOOD (  13.95  )",
        "X-Spam-Score": "-0.2 (/)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"desiato.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  From: Benjamin Berg <benjamin@sipsolutions.net> When the\n winch\n    thread runs into an error condition, it would exit(1) and never be reaped\n    until shutdown time. Change this to write a command byte which causes the\n    driver to kill it, therefore reaping [...]\n Content analysis details:   (-0.2 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.0 SPF_PASS               SPF: sender matches SPF record\n -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n                             author's domain\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily\n                             valid\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature",
        "X-BeenThere": "linux-um@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<linux-um.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-um/>",
        "List-Post": "<mailto:linux-um@lists.infradead.org>",
        "List-Help": "<mailto:linux-um-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-um\" <linux-um-bounces@lists.infradead.org>",
        "Errors-To": "linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "From: Benjamin Berg <benjamin@sipsolutions.net>\n\nWhen the winch thread runs into an error condition, it would exit(1) and\nnever be reaped until shutdown time. Change this to write a command byte\nwhich causes the driver to kill it, therefore reaping the child.\n\nSigned-off-by: Benjamin Berg <benjamin@sipsolutions.net>\n---\n arch/um/drivers/chan_user.c | 16 +++++++++++-----\n arch/um/drivers/line.c      | 13 ++++++++-----\n 2 files changed, 19 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c\nindex c2b83cb99aae..ed7cc830b3e7 100644\n--- a/arch/um/drivers/chan_user.c\n+++ b/arch/um/drivers/chan_user.c\n@@ -141,7 +141,7 @@ struct winch_data {\n \tint pipe_fd;\n };\n \n-static int winch_thread(void *arg)\n+static __noreturn int winch_thread(void *arg)\n {\n \tstruct winch_data *data = arg;\n \tsigset_t sigs;\n@@ -168,7 +168,7 @@ static int winch_thread(void *arg)\n \tif (sigprocmask(SIG_SETMASK, &sigs, NULL) < 0) {\n \t\tos_info(\"winch_thread : sigprocmask failed, errno = %d\\n\",\n \t\t\terrno);\n-\t\texit(1);\n+\t\tgoto wait_kill;\n \t}\n \t/* In sigsuspend(), block anything else than SIGWINCH. */\n \tsigdelset(&sigs, SIGWINCH);\n@@ -176,19 +176,19 @@ static int winch_thread(void *arg)\n \tif (setsid() < 0) {\n \t\tos_info(\"winch_thread : setsid failed, errno = %d\\n\",\n \t\t       errno);\n-\t\texit(1);\n+\t\tgoto wait_kill;\n \t}\n \n \tif (ioctl(pty_fd, TIOCSCTTY, 0) < 0) {\n \t\tos_info(\"winch_thread : TIOCSCTTY failed on \"\n \t\t\t\"fd %d err = %d\\n\", pty_fd, errno);\n-\t\texit(1);\n+\t\tgoto wait_kill;\n \t}\n \n \tif (tcsetpgrp(pty_fd, os_getpid()) < 0) {\n \t\tos_info(\"winch_thread : tcsetpgrp failed on fd %d err = %d\\n\",\n \t\t\tpty_fd, errno);\n-\t\texit(1);\n+\t\tgoto wait_kill;\n \t}\n \n \t/*\n@@ -214,6 +214,12 @@ static int winch_thread(void *arg)\n \t\t\tos_info(\"winch_thread : write failed, err = %d\\n\",\n \t\t\t\terrno);\n \t}\n+\n+wait_kill:\n+\tc = 2;\n+\tcount = write(pipe_fd, &c, sizeof(c));\n+\twhile (1)\n+\t\tpause();\n }\n \n static int winch_tramp(int fd, struct tty_port *port, int *fd_out,\ndiff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c\nindex 02b0befd6763..2e61899e5996 100644\n--- a/arch/um/drivers/line.c\n+++ b/arch/um/drivers/line.c\n@@ -629,15 +629,18 @@ static irqreturn_t winch_interrupt(int irq, void *data)\n \n \tif (fd != -1) {\n \t\terr = generic_read(fd, &c, NULL);\n-\t\tif (err < 0) {\n+\t\t/* A read of 2 means the winch thread failed and has warned */\n+\t\tif (err < 0 || (err == 1 && c == 2)) {\n \t\t\tif (err != -EAGAIN) {\n \t\t\t\twinch->fd = -1;\n \t\t\t\tlist_del(&winch->list);\n \t\t\t\tos_close_file(fd);\n-\t\t\t\tprintk(KERN_ERR \"winch_interrupt : \"\n-\t\t\t\t       \"read failed, errno = %d\\n\", -err);\n-\t\t\t\tprintk(KERN_ERR \"fd %d is losing SIGWINCH \"\n-\t\t\t\t       \"support\\n\", winch->tty_fd);\n+\t\t\t\tif (err < 0) {\n+\t\t\t\t\tprintk(KERN_ERR \"winch_interrupt : read failed, errno = %d\\n\",\n+\t\t\t\t\t       -err);\n+\t\t\t\t\tprintk(KERN_ERR \"fd %d is losing SIGWINCH support\\n\",\n+\t\t\t\t\t       winch->tty_fd);\n+\t\t\t\t}\n \t\t\t\tINIT_WORK(&winch->work, __free_winch);\n \t\t\t\tschedule_work(&winch->work);\n \t\t\t\treturn IRQ_HANDLED;\n",
    "prefixes": [
        "v2",
        "08/28"
    ]
}