get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49552,
    "url": "https://patches.dpdk.org/api/patches/49552/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190108114509.31489-1-findtheonlyway@gmail.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20190108114509.31489-1-findtheonlyway@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190108114509.31489-1-findtheonlyway@gmail.com",
    "date": "2019-01-08T11:45:09",
    "name": "vhostuser: fix deadlock when vhost unregister",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f39b0ecfd13c1181f2f79996ea33b5f11b621918",
    "submitter": {
        "id": 1203,
        "url": "https://patches.dpdk.org/api/people/1203/?format=api",
        "name": "孙文杰",
        "email": "findtheonlyway@gmail.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190108114509.31489-1-findtheonlyway@gmail.com/mbox/",
    "series": [
        {
            "id": 3076,
            "url": "https://patches.dpdk.org/api/series/3076/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3076",
            "date": "2019-01-08T11:45:09",
            "name": "vhostuser: fix deadlock when vhost unregister",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/3076/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/49552/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/49552/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 614311B57A;\n\tWed,  9 Jan 2019 17:50:32 +0100 (CET)",
            "from mail-pf1-f193.google.com (mail-pf1-f193.google.com\n\t[209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 2245CDE0\n\tfor <dev@dpdk.org>; Tue,  8 Jan 2019 12:45:20 +0100 (CET)",
            "by mail-pf1-f193.google.com with SMTP id z9so1829372pfi.2\n\tfor <dev@dpdk.org>; Tue, 08 Jan 2019 03:45:20 -0800 (PST)",
            "from localhost.localdomain ([203.100.54.194])\n\tby smtp.gmail.com with ESMTPSA id\n\tk24sm107135524pfj.13.2019.01.08.03.45.17\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 08 Jan 2019 03:45:18 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=+bPlxsTsDkJl5Yw+rLL6S5m/2V0OsFFkhjmdgoroABg=;\n\tb=E9IcbCxp2xB6zmI55IuxmjsaEq1OHB0qoUcQNB4duJ5yt2ysyvvzL7Th5rZgfRnKZf\n\tzKOQ7gDZ4pRPnNvO7aNLZxu0rBis0D8zEafWN3+loyitTCg/mjs7nex+eBvCxf0+vJ9s\n\tdSB2Ef0gYuxT/sReYAfe/ATj4nlGA+gJur0/Z8TgRSmai9yWuUrPKoucmrgbQvqsYvn1\n\t4JPJtsT/IJiyape8oNAglQ6NfCvU7xTKXt65GvSYdAlbGTMt+6o9rk7EkXlwDSpjMvY1\n\tRvGrlnHK4VBIKLCMiiNcaC/TKl2PFUo9HADD/WIpMj16yN4Er0Xr0HE5iTO8aFKPRMeh\n\tkSVA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=+bPlxsTsDkJl5Yw+rLL6S5m/2V0OsFFkhjmdgoroABg=;\n\tb=cOkQb8ykORi4oDJI2gqQEt14+a6XS6F6LoRUIn82GVe1y6N7PKECUE7X9MFngdPu3T\n\txZLDA86pI3PqNKbDDIGPbh7m0mCbBtZDZdXjQS2jZ8JVvRV56DtmmZLRh1baSatRGFU3\n\tCJXHPOTIIInG14vH+WvN/q0DzyX1lS4IMlJh0i2ITRXhhZ7MfIDUtalCuS69A71KvCGQ\n\tyVdSvwShpiCAxZv9F4UykvKhBpBJFrJEDXNhheSzhCWcSB+KnBQWU0NAB/0wk5+zZ39d\n\tiOgJOZW9SMLFMaORcYtkLveV7rWtN3S6SzPxX6UzvB96rw1Pvqjpf+Aw2bYtYhoDdXEg\n\toonw==",
        "X-Gm-Message-State": "AJcUukdOKvZXgKgXVsIEhF6lECc1tt8pZfmDCNdKw8nQBzeEcsavHxFU\n\thGNKhKXOSSOlPl/1z/6zuFkvpt28",
        "X-Google-Smtp-Source": "ALg8bN6Z+ax9rJWAD+wyibo4WV+f5E5sMzR0P5d7yjif1FWx9M5p7bOFYmIsB14cSctmOPPzS621Bw==",
        "X-Received": "by 2002:a65:590b:: with SMTP id f11mr1263978pgu.60.1546947918810;\n\tTue, 08 Jan 2019 03:45:18 -0800 (PST)",
        "From": "sunwenjie <findtheonlyway@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "sunwenjie <findtheonlyway@gmail.com>",
        "Date": "Tue,  8 Jan 2019 19:45:09 +0800",
        "Message-Id": "<20190108114509.31489-1-findtheonlyway@gmail.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Wed, 09 Jan 2019 17:50:30 +0100",
        "Subject": "[dpdk-dev] [PATCH] vhostuser: fix deadlock when vhost unregister",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When rte_vhost_driver_unregister  delete the connection fd, fdset_try_del will\n always try and donot release the  vhostuser.mutex if the fd is busy, but the\n fdset_event_dispatch will set the  fd to busy and call vhost_user_msg_handler\n to get vhostuser.mutex, which will  cause deadlock.\n\nTo fix it:\n    Unlock the vhost_user.mutex if fdset_try_del fail and relock it when\n    retry.\n---\n lib/librte_vhost/socket.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c\nindex 9cf34ad17..a9effa115 100644\n--- a/lib/librte_vhost/socket.c\n+++ b/lib/librte_vhost/socket.c\n@@ -961,13 +961,12 @@ rte_vhost_driver_unregister(const char *path)\n \tint count;\n \tstruct vhost_user_connection *conn, *next;\n \n+again:\n \tpthread_mutex_lock(&vhost_user.mutex);\n \n \tfor (i = 0; i < vhost_user.vsocket_cnt; i++) {\n \t\tstruct vhost_user_socket *vsocket = vhost_user.vsockets[i];\n-\n \t\tif (!strcmp(vsocket->path, path)) {\n-again:\n \t\t\tpthread_mutex_lock(&vsocket->conn_mutex);\n \t\t\tfor (conn = TAILQ_FIRST(&vsocket->conn_list);\n \t\t\t     conn != NULL;\n@@ -981,6 +980,7 @@ rte_vhost_driver_unregister(const char *path)\n \t\t\t\t */\n \t\t\t\tif (fdset_try_del(&vhost_user.fdset,\n \t\t\t\t\t\t  conn->connfd) == -1) {\n+\t\t\t\t\tpthread_mutex_unlock(&vhost_user.mutex);\n \t\t\t\t\tpthread_mutex_unlock(\n \t\t\t\t\t\t\t&vsocket->conn_mutex);\n \t\t\t\t\tgoto again;\n",
    "prefixes": []
}