From patchwork Tue Jun 11 13:37:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Bates X-Patchwork-Id: 10986959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0427614BB for ; Tue, 11 Jun 2019 13:37:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6466283E8 for ; Tue, 11 Jun 2019 13:37:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA56C285C9; Tue, 11 Jun 2019 13:37:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62E22283E8 for ; Tue, 11 Jun 2019 13:37:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404082AbfFKNh1 (ORCPT ); Tue, 11 Jun 2019 09:37:27 -0400 Received: from mail-eopbgr670137.outbound.protection.outlook.com ([40.107.67.137]:41824 "EHLO CAN01-TO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403885AbfFKNh1 (ORCPT ); Tue, 11 Jun 2019 09:37:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raithlin.onmicrosoft.com; s=selector1-raithlin-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SYDBg/b/j0kffkGycmizFS4zMTV9rbEvCDNSCdQvOPU=; b=Qh8BFIIUxV2dPBeLzrKRnlvvEE08IyVC1ib2IxpoW3tX0NTa3ObjvTYtMWiRc3lftS9tP5942h1uWFpMbiT28nKAXaOPPqQiDFk6HDTKTH0MKMt1N4LTH/4iOon2et+sadBqRx8vzSIp3D5HWbEpwIL/GmDsvx39gkhccb/UrJk= Received: from YTOPR0101MB0793.CANPRD01.PROD.OUTLOOK.COM (52.132.44.17) by YTOPR0101MB1116.CANPRD01.PROD.OUTLOOK.COM (52.132.50.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.14; Tue, 11 Jun 2019 13:37:25 +0000 Received: from YTOPR0101MB0793.CANPRD01.PROD.OUTLOOK.COM ([fe80::3535:ab58:99bd:516]) by YTOPR0101MB0793.CANPRD01.PROD.OUTLOOK.COM ([fe80::3535:ab58:99bd:516%7]) with mapi id 15.20.1965.017; Tue, 11 Jun 2019 13:37:25 +0000 From: "Stephen Bates" To: "linux-block@vger.kernel.org" CC: Jens Axboe Subject: [PATCH liburing] example/io_uring-test.c: Fix iovecs increment Thread-Topic: [PATCH liburing] example/io_uring-test.c: Fix iovecs increment Thread-Index: AQHVIFrNExpuICTltEa5BqjpHmdcjg== Date: Tue, 11 Jun 2019 13:37:25 +0000 Message-ID: <5C501554-CE72-443C-88B1-FED5AC810554@raithlin.com> Accept-Language: en-CA, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/10.1a.0.190609 authentication-results: spf=none (sender IP is ) smtp.mailfrom=sbates@raithlin.com; x-originating-ip: [2001:bb6:a2c:ed58:2ca3:41e6:9240:e71d] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a605cfba-35f2-498f-c1a7-08d6ee71f0a7 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:YTOPR0101MB1116; x-ms-traffictypediagnostic: YTOPR0101MB1116: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1360; x-forefront-prvs: 006546F32A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(136003)(396003)(39830400003)(376002)(346002)(189003)(199004)(316002)(2616005)(53936002)(2906002)(476003)(4744005)(6486002)(508600001)(86362001)(6512007)(6116002)(83716004)(102836004)(82746002)(71200400001)(36756003)(256004)(8936002)(71190400001)(8676002)(33656002)(81166006)(7736002)(6506007)(305945005)(68736007)(81156014)(58126008)(66946007)(46003)(186003)(5640700003)(66446008)(76116006)(486006)(6436002)(2501003)(5660300002)(66556008)(14454004)(2351001)(91956017)(4326008)(66476007)(73956011)(99286004)(25786009)(6916009)(64756008);DIR:OUT;SFP:1102;SCL:1;SRVR:YTOPR0101MB1116;H:YTOPR0101MB0793.CANPRD01.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: raithlin.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: nyXdCAsmwgSh6FMEAe3WqLZZLv4ND+8UaL7wweoiT+L7R4dZiQ8lhbWmBprQSF7IQSv12qTKNN8IBCEG3dgE67R57kEpowiMT3wmcYJpUzmP+HyfK0tGXqhJeUfwjqumiZuGdRvw4oc8ChO/hwMmMX4TkbsHTRXmNUzGoOo5lUyqEwFPmYBWGbebAfnTFnV6hvzgWOIGPGXOU+08Mb56ZCHZ51RdKNV0sjlNloyUYD+NRHEK1N4FVjGat6vwqc7Npgg1m47EpsSrmPnENccy82LitkldlUvwqIWDp2m/15boIvubAeYTyvLYETg8bjO7D2GzzAYQaFPNQG660E4XyN9BossV7b0SZTDURMsq498RvCJvryLRPVhbrBE8LhzyBlYM9CMXJawcPdRLEPCaF5nO108m8KWQSyodPCtaMqg= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: raithlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: a605cfba-35f2-498f-c1a7-08d6ee71f0a7 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jun 2019 13:37:25.4595 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 18519031-7ff4-4cbb-bbcb-c3252d330f4b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sbates@raithlin.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB1116 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This example misses an increment though the iovecs array. This causes the same buffer to be filled from the block device every time. It would be good to fix this since it is one of the first examples a new-comer to io_uring is exposed too. Signed-off-by: Stephen Bates --- examples/io_uring-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/io_uring-test.c b/examples/io_uring-test.c index bbac3a7..0b975ad 100644 --- a/examples/io_uring-test.c +++ b/examples/io_uring-test.c @@ -56,6 +56,7 @@ int main(int argc, char *argv[]) break; io_uring_prep_readv(sqe, fd, &iovecs[i], 1, offset); offset += iovecs[i].iov_len; + i++; } while (1); ret = io_uring_submit(&ring);