From patchwork Tue Mar 4 12:21:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 14000635 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B71D61FFC7E for ; Tue, 4 Mar 2025 12:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.60.130.6 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741090892; cv=none; b=MJMdvGohekj4fqRSqCiV/7d9AJ2mA5uXtS0GYuhWR/SVEqEdsvJ1UcfmIzMWghttuL59NHGKadrtJIhKNeaeL6WSW9WQKPUbLm9BVUfVrDIjUjrJC7VsbJ5NIUiIyDT6cxVE/4IGUPVsHB1/IQvfKPwZB23OIENFNCXrtP7FVB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741090892; c=relaxed/simple; bh=N8TKVt5ZoZilmj95nNHHXeIQrwaPFKCV/8ZelweOb/g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q3pEI/dpE/n/O0fKoZ8pY6PbOzEdyBCGlspaX1E94Y47xBsXnDpjFQAzX8eI43vtAQK9lM6rZUyi8GwmWI1l4aszpDf1jKNNzucMQgy/GsaEx8I2VRmrN3OosRqag5XzaQpjbT2dvpNVckq7E8IgsiECMisOO1eaFlz84HD2+aE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=ZZLR6Nmo; arc=none smtp.client-ip=178.60.130.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="ZZLR6Nmo" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sseHBSEkdoeMPJvSH1dIIphkpGRXEQsVTzidSof9Ams=; b=ZZLR6NmoU1jYQ//vuDJj+7czEP pNY81ansrozaKyOjhjPadj/CZ9MlELae+45mHOiyVKIXuOL3R8nXmIuf5Q3yKZbcnGfvjAn1OyeZD f1K3DsrwtJM6rWb+misLi0DKs1jThncwZ7Qj8nqh1MVOEAtJEsdFLCcaTCDCrm6SC5kNtzeXveXkC 5y4+Qb6ayHycRq/bftGpSOR8l1h5bO32Fn1z2z00firWpaMq1AqxVmuqwOUy7cVmhzoJHP44slv/M wMnxQBGNyxTMheSeq5MlCY4wc57Md7BHuzzKdZXmzLq0uFcLz8YvzE6dOpSFNKfitVTa43J+7bbIE PwndXjwA==; Received: from bl23-10-177.dsl.telepac.pt ([144.64.10.177] helo=localhost) by fanzine2.igalia.com with utf8esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1tpRGz-003hiL-JD; Tue, 04 Mar 2025 13:21:27 +0100 From: Luis Henriques To: Zorro Lang Cc: fstests@vger.kernel.org, Luis Henriques Subject: [PATCH 1/2] src: include libgen.h for function basename() if not using GNU libc Date: Tue, 4 Mar 2025 12:21:18 +0000 Message-ID: <20250304122119.21412-2-luis@igalia.com> In-Reply-To: <20250304122119.21412-1-luis@igalia.com> References: <20250304122119.21412-1-luis@igalia.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Compiling fstests on a system without the GNU libc fails because the basename() is defined in libgen.h by POSIX and not in string.h. Fix that by including the libgen.h header if __USE_GNU isn't defined. Signed-off-by: Luis Henriques --- src/aio-dio-regress/aio-dio-append-write-read-race.c | 3 +++ src/splice-test.c | 3 +++ src/t_ext4_dax_inline_corruption.c | 3 +++ src/t_ext4_dax_journal_corruption.c | 3 +++ src/t_mmap_collision.c | 3 +++ src/t_mmap_dio.c | 3 +++ 6 files changed, 18 insertions(+) diff --git a/src/aio-dio-regress/aio-dio-append-write-read-race.c b/src/aio-dio-regress/aio-dio-append-write-read-race.c index d9f8982f007c..1a0c8e99c61f 100644 --- a/src/aio-dio-regress/aio-dio-append-write-read-race.c +++ b/src/aio-dio-regress/aio-dio-append-write-read-race.c @@ -19,6 +19,9 @@ #include #include #include +#ifndef __USE_GNU +#include +#endif #include #include diff --git a/src/splice-test.c b/src/splice-test.c index eb8636738064..e6753a15dc47 100644 --- a/src/splice-test.c +++ b/src/splice-test.c @@ -18,6 +18,9 @@ #include #include #include +#ifndef __USE_GNU +#include +#endif unsigned int sector_size; unsigned int buffer_size; diff --git a/src/t_ext4_dax_inline_corruption.c b/src/t_ext4_dax_inline_corruption.c index e1a39a6c1e46..a6cb768512fc 100644 --- a/src/t_ext4_dax_inline_corruption.c +++ b/src/t_ext4_dax_inline_corruption.c @@ -10,6 +10,9 @@ #include #include #include +#ifndef __USE_GNU +#include +#endif #define PAGE(a) ((a)*0x1000) #define STRLEN 256 diff --git a/src/t_ext4_dax_journal_corruption.c b/src/t_ext4_dax_journal_corruption.c index ba7a96e43559..4e5762d77058 100644 --- a/src/t_ext4_dax_journal_corruption.c +++ b/src/t_ext4_dax_journal_corruption.c @@ -10,6 +10,9 @@ #include #include #include +#ifndef __USE_GNU +#include +#endif #define PAGE(a) ((a)*0x1000) #define STRLEN 256 diff --git a/src/t_mmap_collision.c b/src/t_mmap_collision.c index c872f4e26940..638424d2e619 100644 --- a/src/t_mmap_collision.c +++ b/src/t_mmap_collision.c @@ -24,6 +24,9 @@ #include #include #include +#ifndef __USE_GNU +#include +#endif void *dax_data; int nodax_fd; diff --git a/src/t_mmap_dio.c b/src/t_mmap_dio.c index 6c8ca1a39181..342e2c6deb4b 100644 --- a/src/t_mmap_dio.c +++ b/src/t_mmap_dio.c @@ -14,6 +14,9 @@ #include #include #include +#ifndef __USE_GNU +#include +#endif void usage(char *prog) { From patchwork Tue Mar 4 12:21:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 14000637 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B716F1FDE3A for ; Tue, 4 Mar 2025 12:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.60.130.6 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741090893; cv=none; b=KMhNd/GB8/vbK2QVI9h1Zo58qS33OjJ2+YAH5osTN8SUbHqQ4Kcs9B6ZJcPSnDu235cDuTduPMycAYEMsXin+c9C3OAfm6/KYH4elZEQfzu2nQhZmEOX0uyYorWaVlxQDEt/a4NtU1Fp1U/oAEQ7e7qU0is824hbquWzHZGJhe0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741090893; c=relaxed/simple; bh=J8sJY678tZZ3mBsIUGjvYAdzxCAvmbcaoqXldDDbMT8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ag9l5ZwBIBnK20n6SOY0pXbPLpq7BMabDYvW0frAgOD9wjrSg5bMbsbQlGQynErG8cK4BSrEnw1apQa3BFbpAGqBj/YkwMWsJ0HF+acNkx7syEsRB8nxPIosaOMsPMj1RQvwUsAwpFGflMETCrsCsl5cRFjqJzGw1KU+T235/l4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=bgGNQeSS; arc=none smtp.client-ip=178.60.130.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="bgGNQeSS" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9BcOhNMk3ESzOPxh3/TI4t80RwKZNb3aL1HnFIpJG4w=; b=bgGNQeSSVCsdZqfrN/JeuGfurA cvpyIc/y8qmPyE/Ypb5wu76BdF0mCBIBqPP5TgHIqO20+F+wStNNsLlZYLMHSivjNEdx2TF1EXZVW Mnu/y5jNmK89ST2HnDAfa5rz0vYiwjp1RTxRP5iT58wJqWgo+RDD+3W+szQYJm+JSbDG9oz+eddbx tkC5X2OHO/+D83jI5q40j0MqTduuwUbbjIw9/uYE6exdtlIx5TXCwh5HlmRC5qIIck/95lMW0Br5F 6H3ifyL0OARHFhjHXPZQL3iJnA2+klRkI3cAcXLSZ3WpKx7f+5w4wL1w8XL9jX+8xtV+jaSdhbBZz oUUo8gjw==; Received: from bl23-10-177.dsl.telepac.pt ([144.64.10.177] helo=localhost) by fanzine2.igalia.com with utf8esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1tpRGz-003hiR-QV; Tue, 04 Mar 2025 13:21:27 +0100 From: Luis Henriques To: Zorro Lang Cc: fstests@vger.kernel.org, Luis Henriques Subject: [PATCH 2/2] src/locktest: add missing struct cast with syscall getsockname() Date: Tue, 4 Mar 2025 12:21:19 +0000 Message-ID: <20250304122119.21412-3-luis@igalia.com> In-Reply-To: <20250304122119.21412-1-luis@igalia.com> References: <20250304122119.21412-1-luis@igalia.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The usage of variable 'myAddr' (struct sockaddr_in) is being casted into a 'struct sockaddr' when used with bind() and with connect(). This patch adds that cast when used with getsockname() as well, otherwise we'll get the following error: locktest.c: In function 'main': locktest.c:1155:39: error: passing argument 2 of 'getsockname' from incompatible pointer type [-Wincompatible-pointer-types] 1155 | if (getsockname(s_fd, &myAddr, &addr_len)) { | ^~~~~~~ | | | struct sockaddr_in * In file included from /usr/include/fortify/sys/socket.h:23, from locktest.c:19: /usr/include/sys/socket.h:391:23: note: expected 'struct sockaddr * restrict' but argument is of type 'struct sockaddr_in *' 391 | int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict); | ^ Signed-off-by: Luis Henriques Reviewed-by: Zorro Lang --- src/locktest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locktest.c b/src/locktest.c index 0e7c3008d1d0..a6cf3b1d5a99 100644 --- a/src/locktest.c +++ b/src/locktest.c @@ -1152,7 +1152,7 @@ main(int argc, char *argv[]) if (port == 0) { socklen_t addr_len = sizeof(myAddr); - if (getsockname(s_fd, &myAddr, &addr_len)) { + if (getsockname(s_fd, (struct sockaddr *)&myAddr, &addr_len)) { perror("getsockname"); exit(1); }