get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 121533,
    "url": "http://patches.dpdk.org/api/patches/121533/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230103185732.2007210-1-ashish.sadanandan@gmail.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": "<20230103185732.2007210-1-ashish.sadanandan@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230103185732.2007210-1-ashish.sadanandan@gmail.com",
    "date": "2023-01-03T18:57:32",
    "name": "[1/1] eal/linux: reject mountpt shorter than --huge-dir",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "644e5cd2e4c0ec63d7cdb0041c0605b00abbb15e",
    "submitter": {
        "id": 2031,
        "url": "http://patches.dpdk.org/api/people/2031/?format=api",
        "name": "Ashish Sadanandan",
        "email": "ashish.sadanandan@gmail.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230103185732.2007210-1-ashish.sadanandan@gmail.com/mbox/",
    "series": [
        {
            "id": 26363,
            "url": "http://patches.dpdk.org/api/series/26363/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26363",
            "date": "2023-01-03T18:57:32",
            "name": "[1/1] eal/linux: reject mountpt shorter than --huge-dir",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/26363/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/121533/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/121533/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 0FB06A00C2;\n\tTue,  3 Jan 2023 19:57:46 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4BD0540698;\n\tTue,  3 Jan 2023 19:57:45 +0100 (CET)",
            "from mail-pf1-f170.google.com (mail-pf1-f170.google.com\n [209.85.210.170])\n by mails.dpdk.org (Postfix) with ESMTP id A3FD440697;\n Tue,  3 Jan 2023 19:57:44 +0100 (CET)",
            "by mail-pf1-f170.google.com with SMTP id k137so16443868pfd.8;\n Tue, 03 Jan 2023 10:57:44 -0800 (PST)",
            "from tbs-1052-sim.qualcomm.com (i-global254.qualcomm.com.\n [199.106.103.254]) by smtp.gmail.com with ESMTPSA id\n u11-20020a62790b000000b00580a0bb411fsm20080558pfc.174.2023.01.03.10.57.41\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 03 Jan 2023 10:57:42 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=qIO9rK9S7oabGfEUXyp5suyrEAHyS0P+yKgfI4QCoRI=;\n b=MasMb7CCxp1xjqMph1h66Sxhv21h+rp6rhoXd4QVIeQkEx6/HwLH6+O/U/Ez0RjM4a\n lW4tftjR9AB8oWuw1Uhpb4HPdcHtotkflJo74kO/Dp87Zfk+hJV5q8W7gbvXP9jQDyXD\n FXBqVo+fw9MkNc1VDfXD/hdYmBwZjBZcQ8YxxoJA2p4Hht6aFBe+HB4jEu/oRddUOLlG\n ctKXbaAmDvkNgI9uadpS675xazTIBK7iHXHHsGqhC4xW5N19Kji5Ut9ltfuyTGhbBYne\n xO5Pvv7jJigWN6Jk3bhkf1Vi5ShIQzc96jparsfT5oIpDLION2s94myJhgOiyA9GULn6\n ww0Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=qIO9rK9S7oabGfEUXyp5suyrEAHyS0P+yKgfI4QCoRI=;\n b=gq4+hIFM6gtJTLG1V25Cp6X5Hqo2PlvCdiyEjqUyMFbBPabcykDod1I54bLUaz7vdj\n g5IjvbZWqAF6YQYUIu3S/BhxxikKZKIv96cZAYcqocNNvrrOPorig1v3eG/TzuVlHzgN\n 0H1wWp93kgxz7lPKAAzNy7sZloWQMQIYLd5RVHncG16TJkaEm83mV4ud3yME9JF0CmZ7\n Mt9ZbouEN3SCBslMN0uGLa+tH/ZdxM0ofXhgf7KjxvUtHxovxiLg7vmdekQx06tHHChl\n hHONu5pWyzcd4X/IsxBhSKU5PDNHNOvBTpBT3sN/XAtURDsIkGe2BNhAz7HP+1rbtmXS\n wmIQ==",
        "X-Gm-Message-State": "AFqh2kpgwZqQGd1Lf/gok2Ih4HTdwB2n6FgcAnwRIxbEK7Vr0VcD3muH\n ExjxFCmgpusLOkeRs17gg01rc3AVKzSdwemr",
        "X-Google-Smtp-Source": "\n AMrXdXvn8CWOsdNXWKLRQo1xk1llxCJY05nuX81oUWQoK6VuH/1JzTt7Da7cZA6KU7g64/r2gIyTqg==",
        "X-Received": "by 2002:a62:1754:0:b0:582:1145:a946 with SMTP id\n 81-20020a621754000000b005821145a946mr15844232pfx.8.1672772263232;\n Tue, 03 Jan 2023 10:57:43 -0800 (PST)",
        "From": "Ashish Sadanandan <ashish.sadanandan@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ashish Sadanandan <ashish.sadanandan@gmail.com>, john.levon@nutanix.com,\n stable@dpdk.org",
        "Subject": "[PATCH 1/1] eal/linux: reject mountpt shorter than --huge-dir",
        "Date": "Tue,  3 Jan 2023 11:57:32 -0700",
        "Message-Id": "<20230103185732.2007210-1-ashish.sadanandan@gmail.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "The code added for allowing --huge-dir to specify hugetlbfs\nsub-directories has a bug where it incorrectly matches mounts that\ncontain a prefix of the specified --huge-dir.\n\nConsider --huge-dir=/dev/hugepages1G is passed to rte_eal_init. Given\nthe following hugetlbfs mounts\n\n$ mount | grep hugetlbfs\nhugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)\nhugetlbfs on /dev/hugepages1G type hugetlbfs (rw,relatime,pagesize=1024M)\nhugetlbfs on /mnt/huge type hugetlbfs (rw,relatime,pagesize=2M)\n\nget_hugepage_dir is first called with hugepage_sz=2097152. While\niterating over all mount points, /dev/hugepages is incorrectly\ndetermined to be a match because it's a prefix of --huge-dir. The caller\nthen obtains an exclusive lock on --huge-dir.\n\nIn the next call to get_hugepage_dir, hugepage_sz=1073741824. This call\ncorrectly determines /dev/hugepages1G is a match. The caller again\nattempts to obtain an exclusive lock on --huge-dir and deadlocks because\nit's already holding a lock.\n\nThis has been corrected by rejecting the mount point being considered if\nits length is smaller than the specified --huge-dir.\n\nFixes: 24d5a1ce6b85 (\"eal/linux: allow hugetlbfs sub-directories\")\nCc: john.levon@nutanix.com\nCc: stable@dpdk.org\n---\n lib/eal/linux/eal_hugepage_info.c | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c\nindex a1b6cb31ff..fcc3d82fdf 100644\n--- a/lib/eal/linux/eal_hugepage_info.c\n+++ b/lib/eal/linux/eal_hugepage_info.c\n@@ -269,16 +269,19 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)\n \t\t * Ignore any mount that doesn't contain the --huge-dir\n \t\t * directory.\n \t\t */\n-\t\tif (strncmp(internal_conf->hugepage_dir, splitstr[MOUNTPT],\n-\t\t\tstrlen(splitstr[MOUNTPT])) != 0) {\n+\t\tsize_t mountpt_len = strlen(splitstr[MOUNTPT]);\n+\n+\t\tif (strlen(internal_conf->hugepage_dir) > mountpt_len)\n+\t\t\tcontinue;\n+\t\telse if (strncmp(internal_conf->hugepage_dir, splitstr[MOUNTPT],\n+\t\t\tmountpt_len) != 0)\n \t\t\tcontinue;\n-\t\t}\n \n \t\t/*\n \t\t * We found a match, but only prefer it if it's a longer match\n \t\t * (so /mnt/1 is preferred over /mnt for matching /mnt/1/2)).\n \t\t */\n-\t\tif (strlen(splitstr[MOUNTPT]) > strlen(found))\n+\t\tif (mountpt_len > strlen(found))\n \t\t\tstrlcpy(found, splitstr[MOUNTPT], len);\n \t} /* end while fgets */\n \n",
    "prefixes": [
        "1/1"
    ]
}