get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 35095,
    "url": "http://patches.dpdk.org/api/patches/35095/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180209171455.2904-1-tomaszx.kulasek@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20180209171455.2904-1-tomaszx.kulasek@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180209171455.2904-1-tomaszx.kulasek@intel.com",
    "date": "2018-02-09T17:14:55",
    "name": "[dpdk-dev] vhost: fix double free on shutdown",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "b410bfd498e9491cad3912bc186f3179ea330d3a",
    "submitter": {
        "id": 155,
        "url": "http://patches.dpdk.org/api/people/155/?format=api",
        "name": "Tomasz Kulasek",
        "email": "tomaszx.kulasek@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180209171455.2904-1-tomaszx.kulasek@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/35095/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/35095/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 EB4801B852;\n\tFri,  9 Feb 2018 18:16:12 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 26D071B851;\n\tFri,  9 Feb 2018 18:16:11 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Feb 2018 09:16:10 -0800",
            "from unknown (HELO Sent) ([10.103.103.74])\n\tby fmsmga001.fm.intel.com with SMTP; 09 Feb 2018 09:16:07 -0800",
            "by Sent (sSMTP sendmail emulation); Fri, 09 Feb 2018 18:15:03 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.46,483,1511856000\"; d=\"scan'208\";a=\"29526669\"",
        "From": "Tomasz Kulasek <tomaszx.kulasek@intel.com>",
        "To": "yliu@fridaylinux.org",
        "Cc": "dev@dpdk.org, yuanhan.liu@linux.intel.com, stable@dpdk.org,\n\tDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>",
        "Date": "Fri,  9 Feb 2018 18:14:55 +0100",
        "Message-Id": "<20180209171455.2904-1-tomaszx.kulasek@intel.com>",
        "X-Mailer": "git-send-email 2.12.3",
        "Subject": "[dpdk-dev] [PATCH] vhost: fix double free on shutdown",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The vhost connection can be closed concurrently from 2 places:\n * the connection thread itself\n * rte_vhost_driver_unregister\n\nThe connection thread will terminate the connection if any recv error\noccurred. The unregister function will terminate the connection together\nwith the thread. However, there is no sychronization between those two.\nThe connection thread runs in the background without any mutex.\n\nThe rte_vhost_driver_unregister now signals the connection thread\nto terminate itself and waits until it's killed.\n\nFixes: 65388b43f592 (\"vhost: fix fd leaks for vhost-user server mode\")\nCc: yuanhan.liu@linux.intel.com\nCc: stable@dpdk.org\n\nSigned-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>\nSigned-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>\n---\n lib/librte_vhost/socket.c | 21 ++++++++-------------\n 1 file changed, 8 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c\nindex 83befdced..46ac88efd 100644\n--- a/lib/librte_vhost/socket.c\n+++ b/lib/librte_vhost/socket.c\n@@ -735,7 +735,7 @@ rte_vhost_driver_unregister(const char *path)\n {\n \tint i;\n \tint count;\n-\tstruct vhost_user_connection *conn, *next;\n+\tstruct vhost_user_connection *conn;\n \n \tpthread_mutex_lock(&vhost_user.mutex);\n \n@@ -752,22 +752,17 @@ rte_vhost_driver_unregister(const char *path)\n \t\t\t}\n \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-\t\t\t     conn = next) {\n-\t\t\t\tnext = TAILQ_NEXT(conn, next);\n-\n-\t\t\t\tfdset_del(&vhost_user.fdset, conn->connfd);\n-\t\t\t\tRTE_LOG(INFO, VHOST_CONFIG,\n-\t\t\t\t\t\"free connfd = %d for device '%s'\\n\",\n-\t\t\t\t\tconn->connfd, path);\n+\t\t\tTAILQ_FOREACH(conn, &vsocket->conn_list, next) {\n \t\t\t\tclose(conn->connfd);\n-\t\t\t\tvhost_destroy_device(conn->vid);\n-\t\t\t\tTAILQ_REMOVE(&vsocket->conn_list, conn, next);\n-\t\t\t\tfree(conn);\n \t\t\t}\n \t\t\tpthread_mutex_unlock(&vsocket->conn_mutex);\n \n+\t\t\tdo {\n+\t\t\t\tpthread_mutex_lock(&vsocket->conn_mutex);\n+\t\t\t\tconn = TAILQ_FIRST(&vsocket->conn_list);\n+\t\t\t\tpthread_mutex_unlock(&vsocket->conn_mutex);\n+\t\t\t} while (conn != NULL);\n+\n \t\t\tpthread_mutex_destroy(&vsocket->conn_mutex);\n \t\t\tfree(vsocket->path);\n \t\t\tfree(vsocket);\n",
    "prefixes": [
        "dpdk-dev"
    ]
}