Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1072861/?format=api
{ "id": 1072861, "url": "http://patchwork.ozlabs.org/api/patches/1072861/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20190401140903.19186-15-eblake@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20190401140903.19186-15-eblake@redhat.com>", "list_archive_url": null, "date": "2019-04-01T14:09:03", "name": "[PULL,14/14] nbd/client: Trace server noncompliance on structured reads", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "0c01758fcc7f4503e9fc4e9b7a44b2deab5a5989", "submitter": { "id": 6591, "url": "http://patchwork.ozlabs.org/api/people/6591/?format=api", "name": "Eric Blake", "email": "eblake@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20190401140903.19186-15-eblake@redhat.com/mbox/", "series": [ { "id": 100345, "url": "http://patchwork.ozlabs.org/api/series/100345/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=100345", "date": "2019-04-01T14:08:49", "name": "[PULL,01/14] qemu-img: Report bdrv_block_status failures", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/100345/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1072861/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1072861/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=209.51.188.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=redhat.com" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 44Xvmw3v4hz9sPB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 2 Apr 2019 01:27:12 +1100 (AEDT)", "from localhost ([127.0.0.1]:37781 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1hAxu2-0002tr-DF\n\tfor incoming@patchwork.ozlabs.org; Mon, 01 Apr 2019 10:27:10 -0400", "from eggs.gnu.org ([209.51.188.92]:46032)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1hAxcv-0002FD-Qq\n\tfor qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:09:30 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1hAxcs-00050l-5Z\n\tfor qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:09:27 -0400", "from mx1.redhat.com ([209.132.183.28]:52308)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1hAxco-0004sn-Gn; Mon, 01 Apr 2019 10:09:22 -0400", "from smtp.corp.redhat.com\n\t(int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id CB2B785A04;\n\tMon, 1 Apr 2019 14:09:20 +0000 (UTC)", "from blue.redhat.com (ovpn-116-75.phx2.redhat.com [10.3.116.75])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 372D827CB3;\n\tMon, 1 Apr 2019 14:09:20 +0000 (UTC)" ], "From": "Eric Blake <eblake@redhat.com>", "To": "qemu-devel@nongnu.org", "Date": "Mon, 1 Apr 2019 09:09:03 -0500", "Message-Id": "<20190401140903.19186-15-eblake@redhat.com>", "In-Reply-To": "<20190401140903.19186-1-eblake@redhat.com>", "References": "<20190401140903.19186-1-eblake@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.84 on 10.5.11.23", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tMon, 01 Apr 2019 14:09:20 +0000 (UTC)", "Content-Transfer-Encoding": "quoted-printable", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]", "X-Received-From": "209.132.183.28", "Subject": "[Qemu-devel] [PULL 14/14] nbd/client: Trace server noncompliance on\n\tstructured reads", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Cc": "Kevin Wolf <kwolf@redhat.com>,\n\tVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,\n\t\"open list:Network Block Dev...\" <qemu-block@nongnu.org>,\n\tMax Reitz <mreitz@redhat.com>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "Just as we recently added a trace for a server sending block status\nthat doesn't match the server's advertised minimum block alignment,\nlet's do the same for read chunks. But since qemu 3.1 is such a\nserver (because it advertised 512-byte alignment, but when serving a\nfile that ends in data but is not sector-aligned, NBD_CMD_READ would\ndetect a mid-sector change between data and hole at EOF and the\nresulting read chunks are unaligned), we don't want to change our\nbehavior of otherwise tolerating unaligned reads.\n\nNote that even though we fixed the server for 4.0 to advertise an\nactual block alignment (which gets rid of the unaligned reads at EOF\nfor posix files), we can still trigger it via other means:\n\n$ qemu-nbd --image-opts driver=blkdebug,align=512,image.driver=file,image.filename=/path/to/non-aligned-file\n\nArguably, that is a bug in the blkdebug block status function, for\nleaking a block status that is not aligned. It may also be possible to\nobserve issues with a backing layer with smaller alignment than the\nactive layer, although so far I have been unable to write a reliable\niotest for that scenario.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <20190330165349.32256-1-eblake@redhat.com>\nReviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>\n---\n block/nbd-client.c | 12 ++++++++++--\n block/trace-events | 1 +\n 2 files changed, 11 insertions(+), 2 deletions(-)", "diff": "diff --git a/block/nbd-client.c b/block/nbd-client.c\nindex 409c2171bc3..790ecc1ee1c 100644\n--- a/block/nbd-client.c\n+++ b/block/nbd-client.c\n@@ -211,7 +211,8 @@ static inline uint64_t payload_advance64(uint8_t **payload)\n return ldq_be_p(*payload - 8);\n }\n\n-static int nbd_parse_offset_hole_payload(NBDStructuredReplyChunk *chunk,\n+static int nbd_parse_offset_hole_payload(NBDClientSession *client,\n+ NBDStructuredReplyChunk *chunk,\n uint8_t *payload, uint64_t orig_offset,\n QEMUIOVector *qiov, Error **errp)\n {\n@@ -233,6 +234,10 @@ static int nbd_parse_offset_hole_payload(NBDStructuredReplyChunk *chunk,\n \" region\");\n return -EINVAL;\n }\n+ if (client->info.min_block &&\n+ !QEMU_IS_ALIGNED(hole_size, client->info.min_block)) {\n+ trace_nbd_structured_read_compliance(\"hole\");\n+ }\n\n qemu_iovec_memset(qiov, offset - orig_offset, 0, hole_size);\n\n@@ -390,6 +395,9 @@ static int nbd_co_receive_offset_data_payload(NBDClientSession *s,\n \" region\");\n return -EINVAL;\n }\n+ if (s->info.min_block && !QEMU_IS_ALIGNED(data_size, s->info.min_block)) {\n+ trace_nbd_structured_read_compliance(\"data\");\n+ }\n\n qemu_iovec_init(&sub_qiov, qiov->niov);\n qemu_iovec_concat(&sub_qiov, qiov, offset - orig_offset, data_size);\n@@ -712,7 +720,7 @@ static int nbd_co_receive_cmdread_reply(NBDClientSession *s, uint64_t handle,\n * in qiov */\n break;\n case NBD_REPLY_TYPE_OFFSET_HOLE:\n- ret = nbd_parse_offset_hole_payload(&reply.structured, payload,\n+ ret = nbd_parse_offset_hole_payload(s, &reply.structured, payload,\n offset, qiov, &local_err);\n if (ret < 0) {\n s->quit = true;\ndiff --git a/block/trace-events b/block/trace-events\nindex debb25c0ac8..7335a425404 100644\n--- a/block/trace-events\n+++ b/block/trace-events\n@@ -158,6 +158,7 @@ iscsi_xcopy(void *src_lun, uint64_t src_off, void *dst_lun, uint64_t dst_off, ui\n\n # nbd-client.c\n nbd_parse_blockstatus_compliance(const char *err) \"ignoring extra data from non-compliant server: %s\"\n+nbd_structured_read_compliance(const char *type) \"server sent non-compliant unaligned read %s chunk\"\n nbd_read_reply_entry_fail(int ret, const char *err) \"ret = %d, err: %s\"\n nbd_co_request_fail(uint64_t from, uint32_t len, uint64_t handle, uint16_t flags, uint16_t type, const char *name, int ret, const char *err) \"Request failed { .from = %\" PRIu64\", .len = %\" PRIu32 \", .handle = %\" PRIu64 \", .flags = 0x%\" PRIx16 \", .type = %\" PRIu16 \" (%s) } ret = %d, err: %s\"\n\n", "prefixes": [ "PULL", "14/14" ] }