From patchwork Sat Jan 13 14:49:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 1886355 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=fTQDxiOS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TC1Xr0JfPz1yP3 for ; Sun, 14 Jan 2024 01:50:20 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id F272E3CE3BC for ; Sat, 13 Jan 2024 15:50:17 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 302423CA4A9 for ; Sat, 13 Jan 2024 15:49:59 +0100 (CET) Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.219]) by in-6.smtp.seeweb.it (Postfix) with ESMTP id D5E6D1400C44 for ; Sat, 13 Jan 2024 15:49:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=F7rDs 22gRFQqKtAU0mQRHTOQu0UDtFEMsyFO6hdckf4=; b=fTQDxiOS4IZIQ6D1asnIv pemyjvu5c8sf3ttcBNlBCF809uT0T9eB8r2nDvt01d5HsQCMIn/ov9knXIFZXABX GYweswD1QFo2V1aG9l1T5/Ee/PYtWZTFiwSeC6rlh+SfaI1Eq6AQiUuq/4Ba0tni yDetiBE3+JHlQmjscFM77Q= Received: from localhost.localdomain (unknown [183.210.226.120]) by zwqz-smtp-mta-g1-2 (Coremail) with SMTP id _____wD3X1IFo6JlDGAUBA--.25846S2; Sat, 13 Jan 2024 22:49:43 +0800 (CST) From: ice_yangxiao@163.com To: ltp@lists.linux.it Date: Sat, 13 Jan 2024 22:49:38 +0800 Message-Id: <20240113144940.133746-1-ice_yangxiao@163.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-CM-TRANSID: _____wD3X1IFo6JlDGAUBA--.25846S2 X-Coremail-Antispam: 1Uf129KBjvJXoW3Xw47CF15GryDKr18AF1UJrb_yoW7Cr43p3 y7Ja4UKF4kJr1fu3Z7Zr40ka1rA3Z2yFyrKF4Ika15ZrsYvw45CFW2qFyrJFyUXr48Kayj yF4fXry2qw1kJFDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UPkusUUUUU= X-Originating-IP: [183.210.226.120] X-CM-SenderInfo: 5lfhs5xdqj5xldr6il2tof0z/xtbBEhFkXmVOBo5MrwAAs5 X-Virus-Scanned: clamav-milter 1.0.3 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] syscalls/preadv: Make make check happy X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" From: Xiao Yang Signed-off-by: Xiao Yang Reviewed-by: Petr Vorel --- testcases/kernel/syscalls/preadv/preadv.h | 19 ++------ testcases/kernel/syscalls/preadv/preadv01.c | 26 +++++------ testcases/kernel/syscalls/preadv/preadv02.c | 50 ++++++++++----------- 3 files changed, 42 insertions(+), 53 deletions(-) diff --git a/testcases/kernel/syscalls/preadv/preadv.h b/testcases/kernel/syscalls/preadv/preadv.h index 73466a9aa..c3e9e5f19 100644 --- a/testcases/kernel/syscalls/preadv/preadv.h +++ b/testcases/kernel/syscalls/preadv/preadv.h @@ -1,18 +1,7 @@ -/* -* Copyright (c) 2015 Fujitsu Ltd. -* Author: Xiao Yang -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of version 2 of the GNU General Public License as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it would be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -* -* You should have received a copy of the GNU General Public License -* alone with this program. -*/ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (c) 2015 Fujitsu Ltd. + * Author: Xiao Yang + */ #ifndef PREADV_H #define PREADV_H diff --git a/testcases/kernel/syscalls/preadv/preadv01.c b/testcases/kernel/syscalls/preadv/preadv01.c index 62f9296f2..aba4748a5 100644 --- a/testcases/kernel/syscalls/preadv/preadv01.c +++ b/testcases/kernel/syscalls/preadv/preadv01.c @@ -1,17 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* -* Copyright (c) 2015 Fujitsu Ltd. -* Author: Xiao Yang -*/ + * Copyright (c) 2015 Fujitsu Ltd. + * Author: Xiao Yang + */ /* -* Test Name: preadv01 -* -* Test Description: -* Testcase to check the basic functionality of the preadv(2). -* Preadv(2) should succeed to read the expected content of data -* and after reading the file, the file offset is not changed. -*/ + * Test Name: preadv01 + * + * Test Description: + * Testcase to check the basic functionality of the preadv(2). + * Preadv(2) should succeed to read the expected content of data + * and after reading the file, the file offset is not changed. + */ #define _GNU_SOURCE @@ -38,7 +38,7 @@ static struct tcase { {1, CHUNK*3/2, CHUNK/2, 'b'} }; -void verify_preadv(unsigned int n) +static void verify_preadv(unsigned int n) { int i; char *vec; @@ -81,7 +81,7 @@ void verify_preadv(unsigned int n) "with content '%c' expectedly", tc->size, tc->content); } -void setup(void) +static void setup(void) { char buf[CHUNK]; @@ -94,7 +94,7 @@ void setup(void) SAFE_WRITE(SAFE_WRITE_ALL, fd, buf, sizeof(buf)); } -void cleanup(void) +static void cleanup(void) { if (fd > 0) SAFE_CLOSE(fd); diff --git a/testcases/kernel/syscalls/preadv/preadv02.c b/testcases/kernel/syscalls/preadv/preadv02.c index 500059e42..65d4795d6 100644 --- a/testcases/kernel/syscalls/preadv/preadv02.c +++ b/testcases/kernel/syscalls/preadv/preadv02.c @@ -1,32 +1,32 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* -* Copyright (c) 2015-2016 Fujitsu Ltd. -* Author: Xiao Yang -*/ + * Copyright (c) 2015-2016 Fujitsu Ltd. + * Author: Xiao Yang + */ /* -* Test Name: preadv02 -* -* Description: -* 1) preadv(2) fails if iov_len is invalid. -* 2) preadv(2) fails if the vector count iovcnt is less than zero. -* 3) preadv(2) fails if offset is negative. -* 4) preadv(2) fails when attempts to read into a invalid address. -* 5) preadv(2) fails if file descriptor is invalid. -* 6) preadv(2) fails if file descriptor is not open for reading. -* 7) preadv(2) fails when fd refers to a directory. -* 8) preadv(2) fails if fd is associated with a pipe. -* -* Expected Result: -* 1) preadv(2) should return -1 and set errno to EINVAL. -* 2) preadv(2) should return -1 and set errno to EINVAL. -* 3) preadv(2) should return -1 and set errno to EINVAL. -* 4) preadv(2) should return -1 and set errno to EFAULT. -* 5) preadv(2) should return -1 and set errno to EBADF. -* 6) preadv(2) should return -1 and set errno to EBADF. -* 7) preadv(2) should return -1 and set errno to EISDIR. -* 8) preadv(2) should return -1 and set errno to ESPIPE. -*/ + * Test Name: preadv02 + * + * Description: + * 1) preadv(2) fails if iov_len is invalid. + * 2) preadv(2) fails if the vector count iovcnt is less than zero. + * 3) preadv(2) fails if offset is negative. + * 4) preadv(2) fails when attempts to read into a invalid address. + * 5) preadv(2) fails if file descriptor is invalid. + * 6) preadv(2) fails if file descriptor is not open for reading. + * 7) preadv(2) fails when fd refers to a directory. + * 8) preadv(2) fails if fd is associated with a pipe. + * + * Expected Result: + * 1) preadv(2) should return -1 and set errno to EINVAL. + * 2) preadv(2) should return -1 and set errno to EINVAL. + * 3) preadv(2) should return -1 and set errno to EINVAL. + * 4) preadv(2) should return -1 and set errno to EFAULT. + * 5) preadv(2) should return -1 and set errno to EBADF. + * 6) preadv(2) should return -1 and set errno to EBADF. + * 7) preadv(2) should return -1 and set errno to EISDIR. + * 8) preadv(2) should return -1 and set errno to ESPIPE. + */ #define _GNU_SOURCE From patchwork Sat Jan 13 14:49:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 1886354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=bHXTWOvN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TC1Xc64TSz1yP3 for ; Sun, 14 Jan 2024 01:50:06 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 323F33CDACF for ; Sat, 13 Jan 2024 15:50:03 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id E37853CA4A9 for ; Sat, 13 Jan 2024 15:49:59 +0100 (CET) Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.219]) by in-7.smtp.seeweb.it (Postfix) with ESMTP id 1BBA6201172 for ; Sat, 13 Jan 2024 15:49:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=UaiHy t1sSRJaSE+Vog/y39DUV2IeecXASyvR7MN+6sY=; b=bHXTWOvN6/zrCF+FS8trE apVKMh2HTPW6znk1PBJmbyhgSXQKIArcutC0P67Z7GEzJJziJiFVcngvvz3QKCHN QnOuewMKA6PwQll/N+2e46VVcKxOO7IrOfdqpxynlkibqSIbaOt6aSK3t7baDB8Z n6KtS45h0qjyOIEg9iByzs= Received: from localhost.localdomain (unknown [183.210.226.120]) by zwqz-smtp-mta-g1-2 (Coremail) with SMTP id _____wD3X1IFo6JlDGAUBA--.25846S3; Sat, 13 Jan 2024 22:49:44 +0800 (CST) From: ice_yangxiao@163.com To: ltp@lists.linux.it Date: Sat, 13 Jan 2024 22:49:39 +0800 Message-Id: <20240113144940.133746-2-ice_yangxiao@163.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20240113144940.133746-1-ice_yangxiao@163.com> References: <20240113144940.133746-1-ice_yangxiao@163.com> MIME-Version: 1.0 X-CM-TRANSID: _____wD3X1IFo6JlDGAUBA--.25846S3 X-Coremail-Antispam: 1Uf129KBjvJXoW3GF4rtr18ur4xtFW8tF1rtFb_yoW7AF4fp3 y7K34qyws5ta1xWrnrXF48Aa4rZ3WfAry3u3W0yrs5Zr4Fqw15JF4aqFy5JFyUXry7KFW7 tr4furW2y3WrZFUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UQIDcUUUUU= X-Originating-IP: [183.210.226.120] X-CM-SenderInfo: 5lfhs5xdqj5xldr6il2tof0z/1tbiqAJkXmVOBoai8gABsq X-Virus-Scanned: clamav-milter 1.0.3 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] syscalls/pwritev: Make make check happy X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" From: Xiao Yang Signed-off-by: Xiao Yang --- testcases/kernel/syscalls/pwritev/pwritev.h | 19 ++------ testcases/kernel/syscalls/pwritev/pwritev01.c | 20 ++++---- testcases/kernel/syscalls/pwritev/pwritev02.c | 46 +++++++++---------- testcases/kernel/syscalls/pwritev/pwritev03.c | 2 +- 4 files changed, 38 insertions(+), 49 deletions(-) diff --git a/testcases/kernel/syscalls/pwritev/pwritev.h b/testcases/kernel/syscalls/pwritev/pwritev.h index 833160ddb..6c12027b5 100644 --- a/testcases/kernel/syscalls/pwritev/pwritev.h +++ b/testcases/kernel/syscalls/pwritev/pwritev.h @@ -1,18 +1,7 @@ -/* -* Copyright (c) 2015 Fujitsu Ltd. -* Author: Xiao Yang -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of version 2 of the GNU General Public License as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it would be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -* -* You should have received a copy of the GNU General Public License -* alone with this program. -*/ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (c) 2015 Fujitsu Ltd. + * Author: Xiao Yang + */ #ifndef PWRITEV_H #define PWRITEV_H diff --git a/testcases/kernel/syscalls/pwritev/pwritev01.c b/testcases/kernel/syscalls/pwritev/pwritev01.c index 66358f7c4..4c2b84c5b 100644 --- a/testcases/kernel/syscalls/pwritev/pwritev01.c +++ b/testcases/kernel/syscalls/pwritev/pwritev01.c @@ -1,17 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* -* Copyright (c) 2015 Fujitsu Ltd. -* Author: Xiao Yang -*/ + * Copyright (c) 2015 Fujitsu Ltd. + * Author: Xiao Yang + */ /* -* Test Name: pwritev01 -* -* Test Description: -* Testcase to check the basic functionality of the pwritev(2). -* pwritev(2) should succeed to write the expected content of data -* and after writing the file, the file offset is not changed. -*/ + * Test Name: pwritev01 + * + * Test Description: + * Testcase to check the basic functionality of the pwritev(2). + * pwritev(2) should succeed to write the expected content of data + * and after writing the file, the file offset is not changed. + */ #define _GNU_SOURCE #include diff --git a/testcases/kernel/syscalls/pwritev/pwritev02.c b/testcases/kernel/syscalls/pwritev/pwritev02.c index 0881b7566..de69d5add 100644 --- a/testcases/kernel/syscalls/pwritev/pwritev02.c +++ b/testcases/kernel/syscalls/pwritev/pwritev02.c @@ -1,30 +1,30 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* -* Copyright (c) 2015-2016 Fujitsu Ltd. -* Author: Xiao Yang -*/ + * Copyright (c) 2015-2016 Fujitsu Ltd. + * Author: Xiao Yang + */ /* -* Test Name: pwritev02 -* -* Description: -* 1) pwritev(2) fails if iov_len is invalid. -* 2) pwritev(2) fails if the vector count iovcnt is less than zero. -* 3) pwritev(2) fails if offset is negative. -* 4) pwritev(2) fails when attempts to write from a invalid address -* 5) pwritev(2) fails if file descriptor is invalid. -* 6) pwritev(2) fails if file descriptor is not open for writing. -* 7) pwritev(2) fails if fd is associated with a pipe. -* -* Expected Result: -* 1) pwritev(2) should return -1 and set errno to EINVAL. -* 2) pwritev(2) should return -1 and set errno to EINVAL. -* 3) pwritev(2) should return -1 and set errno to EINVAL. -* 4) pwritev(2) should return -1 and set errno to EFAULT. -* 5) pwritev(2) should return -1 and set errno to EBADF. -* 6) pwritev(2) should return -1 and set errno to EBADF. -* 7) pwritev(2) should return -1 and set errno to ESPIPE. -*/ + * Test Name: pwritev02 + * + * Description: + * 1) pwritev(2) fails if iov_len is invalid. + * 2) pwritev(2) fails if the vector count iovcnt is less than zero. + * 3) pwritev(2) fails if offset is negative. + * 4) pwritev(2) fails when attempts to write from a invalid address + * 5) pwritev(2) fails if file descriptor is invalid. + * 6) pwritev(2) fails if file descriptor is not open for writing. + * 7) pwritev(2) fails if fd is associated with a pipe. + * + * Expected Result: + * 1) pwritev(2) should return -1 and set errno to EINVAL. + * 2) pwritev(2) should return -1 and set errno to EINVAL. + * 3) pwritev(2) should return -1 and set errno to EINVAL. + * 4) pwritev(2) should return -1 and set errno to EFAULT. + * 5) pwritev(2) should return -1 and set errno to EBADF. + * 6) pwritev(2) should return -1 and set errno to EBADF. + * 7) pwritev(2) should return -1 and set errno to ESPIPE. + */ #define _GNU_SOURCE diff --git a/testcases/kernel/syscalls/pwritev/pwritev03.c b/testcases/kernel/syscalls/pwritev/pwritev03.c index 8b91de336..e60ef191e 100644 --- a/testcases/kernel/syscalls/pwritev/pwritev03.c +++ b/testcases/kernel/syscalls/pwritev/pwritev03.c @@ -90,7 +90,7 @@ static void verify_direct_pwritev(unsigned int n) static void setup(void) { int dev_fd, ret; - + dev_fd = SAFE_OPEN(tst_device->dev, O_RDWR); SAFE_IOCTL(dev_fd, BLKSSZGET, &ret); SAFE_CLOSE(dev_fd);