get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64740,
    "url": "https://patches.dpdk.org/api/patches/64740/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1579140457-14805-1-git-send-email-wangzhike@jd.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": "<1579140457-14805-1-git-send-email-wangzhike@jd.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1579140457-14805-1-git-send-email-wangzhike@jd.com",
    "date": "2020-01-16T02:07:37",
    "name": "vhost:fix crash on port deletion and VM shutdown at same time",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7a74a3cacd6df0e9148656e5452cee1181faeb86",
    "submitter": {
        "id": 873,
        "url": "https://patches.dpdk.org/api/people/873/?format=api",
        "name": "王志克",
        "email": "wangzhike@jd.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/1579140457-14805-1-git-send-email-wangzhike@jd.com/mbox/",
    "series": [
        {
            "id": 8145,
            "url": "https://patches.dpdk.org/api/series/8145/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=8145",
            "date": "2020-01-16T02:07:37",
            "name": "vhost:fix crash on port deletion and VM shutdown at same time",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/8145/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/64740/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/64740/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 42EDAA0513;\n\tThu, 16 Jan 2020 03:08:15 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7C6F61C194;\n\tThu, 16 Jan 2020 03:08:14 +0100 (CET)",
            "from m12-11.163.com (m12-11.163.com [220.181.12.11])\n by dpdk.org (Postfix) with ESMTP id 285061C130;\n Thu, 16 Jan 2020 03:08:11 +0100 (CET)",
            "from localhost.localdomain (unknown [106.38.115.16])\n by smtp7 (Coremail) with SMTP id C8CowABHQ0ODxR9enceIHQ--.61685S2;\n Thu, 16 Jan 2020 10:08:07 +0800 (CST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;\n s=s110527; h=From:Subject:Date:Message-Id; bh=HBssOeYyzY1zuGXlfo\n 5aGdSqmU6WA/KQrBiGUzZ1gH8=; b=M6KynUi6aGeyRFkdZ33z18SDalieZfROf1\n X46HTTq+q1IF98de4klcbVEv59Eiax97tnvQIXL+Y4UkSYYEGXIJudmgbfjMohr2\n YbrqY41KAfouhXzDTQK6R9iWjKwFSEx9PO6o44d3toawLSPz5/kDeEDDhfP/+xYN\n 0bGQ/tkUE=",
        "From": "Zhike Wang <wangzhike@jd.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com,\n stable@dpdk.org, Zhike Wang <wangzhike@jd.com>",
        "Date": "Thu, 16 Jan 2020 10:07:37 +0800",
        "Message-Id": "<1579140457-14805-1-git-send-email-wangzhike@jd.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "X-CM-TRANSID": "C8CowABHQ0ODxR9enceIHQ--.61685S2",
        "X-Coremail-Antispam": "1Uf129KBjvJXoW7WFyrWr43AFW7GF47Xry5Jwb_yoW8GF1UpF\n yUtFy3Jr97JwnYvFZxua15X340k3Wku3W7G3s7G3W8Aw4DGw4Yq39Y93W09r17JFWkAFyU\n AF4jgw4a9F4jk3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jfUUUUUUUU=",
        "X-Originating-IP": "[106.38.115.16]",
        "X-CM-SenderInfo": "pzdqw6bntsiqqrwthudrp/1tbiTgesulUDB8FKWgAAsf",
        "Subject": "[dpdk-dev] [PATCH] vhost:fix crash on port deletion and VM shutdown\n\tat same time",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The vhost_user_read_cb() and rte_vhost_driver_unregister() can be\ncalled at the same time by 2 threads. Eg thread1 calls vhost_user_read_cb()\nand removes the vsocket from conn_list, then thread2 calls\nrte_vhost_driver_unregister() and frees the vsocket since it is NOT in the\nconn_list. So thread1 will access invalid memory when trying to reconnect.\n\nThe fix is to move the \"removing of vsocket from conn_list\" to end of the\nvhost_user_read_cb(), then avoid the race condition.\n\nThe core trace is\nProgram terminated with signal 11, Segmentation fault.\n\nSigned-off-by: Zhike Wang <wangzhike@jd.com>\n---\n lib/librte_vhost/socket.c | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c\nindex ebb2ff6..01a9dec 100644\n--- a/lib/librte_vhost/socket.c\n+++ b/lib/librte_vhost/socket.c\n@@ -318,16 +318,16 @@ struct vhost_user {\n \n \t\tvhost_destroy_device(conn->vid);\n \n+\t\tif (vsocket->reconnect) {\n+\t\t\tcreate_unix_socket(vsocket);\n+\t\t\tvhost_user_start_client(vsocket);\n+\t\t}\n+\n \t\tpthread_mutex_lock(&vsocket->conn_mutex);\n \t\tTAILQ_REMOVE(&vsocket->conn_list, conn, next);\n \t\tpthread_mutex_unlock(&vsocket->conn_mutex);\n \n \t\tfree(conn);\n-\n-\t\tif (vsocket->reconnect) {\n-\t\t\tcreate_unix_socket(vsocket);\n-\t\t\tvhost_user_start_client(vsocket);\n-\t\t}\n \t}\n }\n \n",
    "prefixes": []
}