From patchwork Wed Jun 5 14:28:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1110511 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45JrkW3PyJz9s3l for ; Thu, 6 Jun 2019 00:28:35 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 962B93EA6CF for ; Wed, 5 Jun 2019 16:28:32 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5]) by picard.linux.it (Postfix) with ESMTP id BC0A03EA678 for ; Wed, 5 Jun 2019 16:28:30 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id A374460084B for ; Wed, 5 Jun 2019 16:28:32 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 775CBAE84; Wed, 5 Jun 2019 14:28:29 +0000 (UTC) From: Cyril Hrubis To: ltp@lists.linux.it Date: Wed, 5 Jun 2019 16:28:24 +0200 Message-Id: <20190605142824.28921-1-chrubis@suse.cz> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-5.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-5.smtp.seeweb.it Subject: [LTP] [COMMITTED] [PATCH] syscalls/preadv203: Fix two bugs X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Since commit: commit d7ddbe1134cf825163992a6a761360d3ed9897e2 Author: Murphy Zhou Date: Wed Jun 5 13:33:12 2019 +0800 syscalls/preadv2/preadv203: set mount_device flag The test would fail in two different ways. First of all on subset of filesystem the test will end up with TBROK because preadv2 returns EOPNOTSUP for the RWF_NOWAIT flag. Secondly the size of the written data is too close to the default test block device size and does not leave enough space for metadata. We escaped that limitation by using the /tmp/ instead previously. Anyways this is intended as fast fix for the test, I need to reevaluate it later on, because I've been testing the call only on ext4 due to my silly mistake. Signed-off-by: Cyril Hrubis CC: Murphy Zhou CC: Xiao Yang --- testcases/kernel/syscalls/preadv2/preadv203.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/preadv2/preadv203.c b/testcases/kernel/syscalls/preadv2/preadv203.c index e4f68a51b..91618f5f5 100644 --- a/testcases/kernel/syscalls/preadv2/preadv203.c +++ b/testcases/kernel/syscalls/preadv2/preadv203.c @@ -50,7 +50,7 @@ #define CHUNK_SZ 4123 #define CHUNKS 60 #define MNTPOINT "mntpoint" -#define FILES 1000 +#define FILES 500 static int fds[FILES]; @@ -225,6 +225,19 @@ static void verify_preadv2(void) tst_res(TFAIL, "Haven't got EAGAIN"); } +static void check_preadv2_nowait(int fd) +{ + char buf[1]; + struct iovec iovec[] = { + {buf, sizeof(buf)}, + }; + + TEST(preadv2(fd, iovec, 1, 0, RWF_NOWAIT)); + + if (TST_ERR == EOPNOTSUPP) + tst_brk(TCONF | TERRNO, "preadv2()"); +} + static void setup(void) { char path[1024]; @@ -237,6 +250,9 @@ static void setup(void) fds[i] = SAFE_OPEN(path, O_RDWR | O_CREAT, 0644); + if (i == 0) + check_preadv2_nowait(fds[i]); + for (j = 0; j < CHUNKS; j++) { memset(buf, '0' + j, sizeof(buf)); SAFE_WRITE(1, fds[i], buf, sizeof(buf));