get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 895,
    "url": "http://patchwork.ozlabs.org/api/patches/895/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20080922161144.14343.44612.stgit@warthog.procyon.org.uk/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<20080922161144.14343.44612.stgit@warthog.procyon.org.uk>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20080922161144.14343.44612.stgit@warthog.procyon.org.uk/",
    "date": "2008-09-22T16:11:44",
    "name": "PPC: Fix rtas_log_read()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a0c1a866c10be3f169b03c1d24627acf224ae2e6",
    "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/linuxppc-dev/patch/20080922161144.14343.44612.stgit@warthog.procyon.org.uk/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/895/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/895/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@ozlabs.org"
        ],
        "Received": [
            "from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id EC764DE65A\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 23 Sep 2008 02:12:04 +1000 (EST)",
            "from mx1.redhat.com (mx1.redhat.com [66.187.233.31])\n\tby ozlabs.org (Postfix) with ESMTP id ACAAADE125\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 23 Sep 2008 02:11:49 +1000 (EST)",
            "from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com\n\t[172.16.52.254])\n\tby mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m8MGBlri008478\n\tfor <linuxppc-dev@ozlabs.org>; Mon, 22 Sep 2008 12:11:47 -0400",
            "from pobox.devel.redhat.com (pobox.devel.redhat.com [10.11.255.8])\n\tby int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id\n\tm8MGBkrW026762\n\tfor <linuxppc-dev@ozlabs.org>; Mon, 22 Sep 2008 12:11:46 -0400",
            "from warthog.cambridge.redhat.com\n\t(IDENT:U2FsdGVkX19XSa8FqAEsxNX0OoqR9Xs0nR+Z43XwGvw@xen4-1.farm.hsv.redhat.com\n\t[10.15.4.90])\n\tby pobox.devel.redhat.com (8.13.1/8.13.1) with ESMTP id\n\tm8MGBjj1008321\n\tfor <linuxppc-dev@ozlabs.org>; Mon, 22 Sep 2008 12:11:46 -0400",
            "from [127.0.0.1] (helo=warthog.procyon.org.uk)\n\tby warthog.cambridge.redhat.com with esmtp (Exim 4.68 #1 (Red Hat\n\tLinux)) id 1Kho0m-0003jp-LQ\n\tfor linuxppc-dev@ozlabs.org; Mon, 22 Sep 2008 17:11:44 +0100"
        ],
        "Organization": "Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley\n\tPlace, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United\n\tKingdom.\n\tRegistered in England and Wales under Company Registration No.\n\t3798903",
        "From": "David Howells <dhowells@redhat.com>",
        "Subject": "[PATCH] PPC: Fix rtas_log_read()",
        "To": "linuxppc-dev@ozlabs.org",
        "Date": "Mon, 22 Sep 2008 17:11:44 +0100",
        "Message-ID": "<20080922161144.14343.44612.stgit@warthog.procyon.org.uk>",
        "User-Agent": "StGIT/0.14.3",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.58 on 172.16.52.254",
        "X-BeenThere": "linuxppc-dev@ozlabs.org",
        "X-Mailman-Version": "2.1.11",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>",
        "List-Unsubscribe": "<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://ozlabs.org/pipermail/linuxppc-dev>",
        "List-Post": "<mailto:linuxppc-dev@ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@ozlabs.org?subject=help>",
        "List-Subscribe": "<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org"
    },
    "content": "Fix rtas_log_read() to correctly check its buffer after sleeping.  A competing\nprocess may have swiped the error we're attempting to retrieve between us being\nwoken up and retaking the lock, but we return an event and account for it\nanyway without checking.\n\nAny positive result from checking rtas_log_size is invalidated when\nrtasd_log_lock is dropped or if it is not held.\n\nIt is not correct to rely on userspace doing the right thing by assuming only\none userspace process (rtasd) will be attempting read at any one time.\n\nSigned-off-by: David Howells <dhowells@redhat.com>\n---\n\n arch/powerpc/platforms/pseries/rtasd.c |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c\nindex c9ffd8c..1ce132f 100644\n--- a/arch/powerpc/platforms/pseries/rtasd.c\n+++ b/arch/powerpc/platforms/pseries/rtasd.c\n@@ -298,16 +298,16 @@ static ssize_t rtas_log_read(struct file * file, char __user * buf,\n \n \tspin_lock_irqsave(&rtasd_log_lock, s);\n \t/* if it's 0, then we know we got the last one (the one in NVRAM) */\n-\tif (rtas_log_size == 0 && logging_enabled)\n+\twhile (rtas_log_size == 0 && logging_enabled) {\n \t\tnvram_clear_error_log();\n-\tspin_unlock_irqrestore(&rtasd_log_lock, s);\n-\n \n-\terror = wait_event_interruptible(rtas_log_wait, rtas_log_size);\n-\tif (error)\n-\t\tgoto out;\n+\t\tspin_unlock_irqrestore(&rtasd_log_lock, s);\n+\t\terror = wait_event_interruptible(rtas_log_wait, rtas_log_size);\n+\t\tif (error)\n+\t\t\tgoto out;\n+\t\tspin_lock_irqsave(&rtasd_log_lock, s);\n+\t}\n \n-\tspin_lock_irqsave(&rtasd_log_lock, s);\n \toffset = rtas_error_log_buffer_max * (rtas_log_start & LOG_NUMBER_MASK);\n \tmemcpy(tmp, &rtas_log_buf[offset], count);\n \n",
    "prefixes": []
}