From patchwork Tue Nov 5 00:53:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1189266 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="r7RQur+r"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 476WQC25TCz9sNx for ; Tue, 5 Nov 2019 11:54:07 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B5DA03C2506 for ; Tue, 5 Nov 2019 01:53:59 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id 229F83C1CA4 for ; Tue, 5 Nov 2019 01:53:56 +0100 (CET) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 582BA1000A36 for ; Tue, 5 Nov 2019 01:53:56 +0100 (CET) Received: by mail-wm1-x341.google.com with SMTP id 11so18859497wmk.0 for ; Mon, 04 Nov 2019 16:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+h7lHCAqL5RiVauqyaQhFDTWUpZfS/EsiJJpG5IgSQQ=; b=r7RQur+rVoqMO+UZN2DPnVzuJsiip/fBOWVlDc4hGje1rFEivaJx31MWqwAe4dU1Xs oA0V0oNWQxpF4i0FC8t88RslFb0nkqeof82EL24DDHdBdsi1a8cw7X/vM8cLEhQrD9f9 fr56I9qDS8oKLjz3QD6pqO4Sy05Fxe2AsxZCkonHSz203pta/c74fsnSQ3FY/TtIlvcS b2RLDn6GNrciNop76qy01M1OVt9elGhnKv9GKhpv5yb6ncmIiozWQ6kz7gAkxxvWlNhl rMhCV8rRTwoYX9Dk+RmPvbn5bIA40LSNWbYxipgmmc1dO3uHVGG7h+p77zoAfE3UiviC hhvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+h7lHCAqL5RiVauqyaQhFDTWUpZfS/EsiJJpG5IgSQQ=; b=pPu/yNkWgDI1wOQTUQL2Iq+pmEzJqxTWCQfwZngB/sPJdLUTq1uZdobEaZU/d2zGt7 99mfwB+09QlawRrfTF/tyiXr+ib08nVAdXw1xamMaIJPwRTMYxbTTujCXwr96VuAHnXh DDTw7KKw/PxNYFX4JGSzR/gbVELQhJaYs2oQKGuRz//iw89biEGJiNSxxqznTKiDnYXV +fUsOGMLb2xlRvrLzSnrp4puJMPAxcKy/Ur37nUlCRYwZu3X8tf9ekxvnSWJDjkmvdtP ovX1v/0/WloioEGJ6EsLnXIpRaHl6UqikgwgWpSq53O0RO1kyW/tBz2sRsa3z5VcmnLK HyOQ== X-Gm-Message-State: APjAAAVTibsofMmqBqr5XSyDA7MC9y7e+JwK8OtlMU/2hzk3jRFTRuYm 4zkez1T0Lbb/Qx2vQqxo7XX7PdGqX30= X-Google-Smtp-Source: APXvYqzsltvY7GCRXiS7WAfDDuu6UlZQNyq0qj8UvI3xLF2yT6y1ZuFPj3ZW3JUIeLnrpeybTJlJYA== X-Received: by 2002:a1c:64d6:: with SMTP id y205mr1462930wmb.136.1572915235623; Mon, 04 Nov 2019 16:53:55 -0800 (PST) Received: from localhost.localdomain ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id g69sm20002476wme.31.2019.11.04.16.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 16:53:55 -0800 (PST) From: Petr Vorel To: ltp@lists.linux.it Date: Tue, 5 Nov 2019 01:53:40 +0100 Message-Id: <20191105005341.19033-2-petr.vorel@gmail.com> X-Mailer: git-send-email 2.24.0.rc2 In-Reply-To: <20191105005341.19033-1-petr.vorel@gmail.com> References: <20191105005341.19033-1-petr.vorel@gmail.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.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, FREEMAIL_FROM, SPF_HELO_NONE, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] fanotify: Move __kernel_fsid_t definition to correct place 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" This fixes errors: fanotify.h:149:55: error: unknown type name ‘__kernel_fsid_t’ static inline void fanotify_get_fid(const char *path, __kernel_fsid_t *fsid, ^~~~~~~~~~~~~~~ fanotify13.c:47:2: error: unknown type name ‘__kernel_fsid_t’ __kernel_fsid_t fsid; Fixes: b8aebc835 ("fanotify: Fix missing __kernel_fsid_t definition") Signed-off-by: Petr Vorel --- testcases/kernel/syscalls/fanotify/fanotify.h | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h index 435f100d8..563a4eb5b 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify.h +++ b/testcases/kernel/syscalls/fanotify/fanotify.h @@ -116,6 +116,15 @@ struct fanotify_mark_type { const char * name; }; +#ifdef HAVE_NAME_TO_HANDLE_AT +#ifndef __kernel_fsid_t +typedef struct { + int val[2]; +} lapi_fsid_t; +#define __kernel_fsid_t lapi_fsid_t +#endif +#endif /* HAVE_NAME_TO_HANDLE_AT */ + #ifndef FAN_REPORT_FID #define FAN_REPORT_FID 0x00000200 @@ -126,20 +135,13 @@ struct fanotify_event_info_header { }; #ifdef HAVE_NAME_TO_HANDLE_AT -#ifndef __kernel_fsid_t -typedef struct { - int val[2]; -} lapi_fsid_t; -#define __kernel_fsid_t lapi_fsid_t -#endif - struct fanotify_event_info_fid { struct fanotify_event_info_header hdr; __kernel_fsid_t fsid; unsigned char handle[0]; }; -#endif -#endif +#endif /* HAVE_NAME_TO_HANDLE_AT */ +#endif /* ! FAN_REPORT_FID */ #ifdef HAVE_NAME_TO_HANDLE_AT /* From patchwork Tue Nov 5 00:53:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1189267 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LPmryqQD"; dkim-atps=neutral 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 476WQF2lbsz9sP6 for ; Tue, 5 Nov 2019 11:54:13 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id F33353C2533 for ; Tue, 5 Nov 2019 01:54:08 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id 20AE03C1CA4 for ; Tue, 5 Nov 2019 01:53:58 +0100 (CET) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 910551A0100E for ; Tue, 5 Nov 2019 01:53:57 +0100 (CET) Received: by mail-wr1-x442.google.com with SMTP id a15so19262043wrf.9 for ; Mon, 04 Nov 2019 16:53:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lgaPH/p38PXhg7aPp8RnvQ3dNQTWWWF+byKXYa1Z/Dw=; b=LPmryqQDXvuNcc2EmX6neLVVvwzLYwRkGsNirdEvjhyJmKPGlmm2Ce5TmJsJWnL4Ss HcJeyiiFg01dxDDMbCWZP/VNymMVlCOgWg3s3qPDEHPqCwN0CV3IJ2KdnRuYTQTBy0TL MjTK+SGXv/y1NJ3UyDaJnKByEbeLINbyuXMJ3aKaQ/qXtjPOZvIj1MvCQGNJwilBDfeZ 7/eq/PbY/OcMLdGfKBF3sZ0rDVySEtCzyZuaBNa65GSLXnmSXlut5qftSpXc0CICCV5C FKXEnJeaQXtfhnVp2XW90V8DaBQArDGQNaPu6QfFDCzz/MZSdXhyg4recfBPH/QRByDV fJog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lgaPH/p38PXhg7aPp8RnvQ3dNQTWWWF+byKXYa1Z/Dw=; b=d/Kb1E/67EYjDx17S5xPXDFQndWRJqHc7WN0TUnVh4yXkzJS4mF6hVw6LxjjJeS16J yvF7qp8Ysc63gefPHXljCr/V+TDl7UbwEgtHCd4xkRM1UYjM+WILhqMfAbZ2NeGzUjaL LBH5DHaw6h92f+F1TlqVHt5wrESSHcupgXNZ3eRHS4IYoy1HHBs6AjIHZ+tb0kGZSXRk Ko9cPiJXEK3x0Na0Nn7uAtlQ46cies7KPyO1Xt90B2WyaVDPxWCsPcZESEJg+A7eIL3T t+rrPbMmfxhw3RshFKbGuekEa3HjMZbWaSJNdwQHyShvu7/K97nf88kCFUC38rA0eZOE xQ/w== X-Gm-Message-State: APjAAAV5Q9FQ4nW4VRw1cMDlTcsFPAjAeKwjV5Aun3njFvNMzXIYIac7 G3bZ1gARQ9cEjVosAulJYEVV+5l+xek= X-Google-Smtp-Source: APXvYqxoayCM4zY0VSlDQJiqhelCK+XirgHZsSbsJ6qSg6e7jkd3NApd3A+okYb3OH0G2jByiDKO2w== X-Received: by 2002:adf:c786:: with SMTP id l6mr21288248wrg.45.1572915236853; Mon, 04 Nov 2019 16:53:56 -0800 (PST) Received: from localhost.localdomain ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id g69sm20002476wme.31.2019.11.04.16.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 16:53:56 -0800 (PST) From: Petr Vorel To: ltp@lists.linux.it Date: Tue, 5 Nov 2019 01:53:41 +0100 Message-Id: <20191105005341.19033-3-petr.vorel@gmail.com> X-Mailer: git-send-email 2.24.0.rc2 In-Reply-To: <20191105005341.19033-1-petr.vorel@gmail.com> References: <20191105005341.19033-1-petr.vorel@gmail.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.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, FREEMAIL_FROM, SPF_HELO_NONE, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] fanotify: Rename fanotify_event_info_fid struct 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" To fix build on musl, which also defines fanotify_event_info_fid, but uses fsid_t type for fsid instead of __kernel_fsid_t. This fixes errors: fanotify13.c: In function ‘do_test’: fanotify13.c:278:20: error: ‘fsid_t’ {aka ‘struct __fsid_t’} has no member named ‘val’; did you mean ‘__val’? event_fid->fsid.val[0], ^~~ ../../../../include/tst_test.h:49:53: note: in definition of macro ‘tst_res’ tst_res_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__) ^~~~~~~~~~~ fanotify13.c:279:20: error: ‘fsid_t’ {aka ‘struct __fsid_t’} has no member named ‘val’; did you mean ‘__val’? event_fid->fsid.val[1], musl (unlike glibc and uclibc-ng) defines fanotify_event_info_fid in fanotify.h and uses fsid_t as type for fanotify_event_info_fid.fsid member, which defines __val[2] (unlike val[2] in __kernel_fsid_t). /* musl (include/sys/fanotify.h) */ struct fanotify_event_info_fid { struct fanotify_event_info_header hdr; fsid_t fsid; unsigned char handle[]; }; /* musl (include/sys/statfs.h) */ typedef struct __fsid_t { int __val[2]; } fsid_t; /* kernel (include/uapi/linux/fanotify.h) */ struct fanotify_event_info_fid { struct fanotify_event_info_header hdr; __kernel_fsid_t fsid; /* * Following is an opaque struct file_handle that can be passed as * an argument to open_by_handle_at(2). */ unsigned char handle[0]; }; /* kernel include/uapi/asm-generic/posix_types.h */ typedef struct { int val[2]; } __kernel_fsid_t; Signed-off-by: Petr Vorel --- testcases/kernel/syscalls/fanotify/fanotify.h | 6 ++---- testcases/kernel/syscalls/fanotify/fanotify13.c | 4 ++-- testcases/kernel/syscalls/fanotify/fanotify15.c | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h index 563a4eb5b..faac178cf 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify.h +++ b/testcases/kernel/syscalls/fanotify/fanotify.h @@ -133,17 +133,15 @@ struct fanotify_event_info_header { uint8_t pad; uint16_t len; }; +#endif /* ! FAN_REPORT_FID */ #ifdef HAVE_NAME_TO_HANDLE_AT -struct fanotify_event_info_fid { +struct lapi_fanotify_event_info_fid { struct fanotify_event_info_header hdr; __kernel_fsid_t fsid; unsigned char handle[0]; }; -#endif /* HAVE_NAME_TO_HANDLE_AT */ -#endif /* ! FAN_REPORT_FID */ -#ifdef HAVE_NAME_TO_HANDLE_AT /* * Helper function used to obtain fsid and file_handle for a given path. * Used by test files correlated to FAN_REPORT_FID functionality. diff --git a/testcases/kernel/syscalls/fanotify/fanotify13.c b/testcases/kernel/syscalls/fanotify/fanotify13.c index 030734285..e0ce887e7 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify13.c +++ b/testcases/kernel/syscalls/fanotify/fanotify13.c @@ -159,7 +159,7 @@ static void do_test(unsigned int number) struct file_handle *event_file_handle; struct fanotify_event_metadata *metadata; - struct fanotify_event_info_fid *event_fid; + struct lapi_fanotify_event_info_fid *event_fid; struct test_case_t *tc = &test_cases[number]; struct fanotify_mark_type *mark = &tc->mark; @@ -207,7 +207,7 @@ static void do_test(unsigned int number) for (i = 0, metadata = (struct fanotify_event_metadata *) events_buf; FAN_EVENT_OK(metadata, len); metadata = FAN_EVENT_NEXT(metadata, len), i++) { - event_fid = (struct fanotify_event_info_fid *) (metadata + 1); + event_fid = (struct lapi_fanotify_event_info_fid *) (metadata + 1); event_file_handle = (struct file_handle *) event_fid->handle; /* File descriptor is redundant with FAN_REPORT_FID */ diff --git a/testcases/kernel/syscalls/fanotify/fanotify15.c b/testcases/kernel/syscalls/fanotify/fanotify15.c index e9e926078..e9f1ff70d 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify15.c +++ b/testcases/kernel/syscalls/fanotify/fanotify15.c @@ -53,7 +53,7 @@ static void do_test(void) struct file_handle *event_file_handle; struct fanotify_event_metadata *metadata; - struct fanotify_event_info_fid *event_fid; + struct lapi_fanotify_event_info_fid *event_fid; if (fanotify_mark(fanotify_fd, FAN_MARK_ADD | FAN_MARK_FILESYSTEM, FAN_CREATE | FAN_DELETE | FAN_ATTRIB | @@ -125,7 +125,7 @@ static void do_test(void) for (i = 0, metadata = (struct fanotify_event_metadata *) events_buf; FAN_EVENT_OK(metadata, len); metadata = FAN_EVENT_NEXT(metadata,len), i++) { - event_fid = (struct fanotify_event_info_fid *) (metadata + 1); + event_fid = (struct lapi_fanotify_event_info_fid *) (metadata + 1); event_file_handle = (struct file_handle *) event_fid->handle; if (i >= count) {