* [LTP] [PATCH 1/1] fanotify: Fix for musl
@ 2019-11-16 0:20 Petr Vorel
2019-11-16 17:22 ` Jan Stancek
0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2019-11-16 0:20 UTC (permalink / raw)
To: ltp
FSID_VAL_MEMBER() wrapper was meant to be only for struct
fanotify_event_info_fid, it was used also for struct event_t
(which has also __kernel_fsid_t fsid, but shouldn't be redefined).
This caused error on recent musl v1.1.23 (with f67b3c17),
which has struct fanotify_event_info_fid.
Fixes: 0498fc0a8 ("fanotify: Detect val vs. __val
fanotify_event_info_fid.fsid member")
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Hi,
I'm sorry, one more error sneaked in.
I accidentally tested it on toolchains which has older musl release.
Helper should have obvious name to show it's just for fanotify_event_info_fid,
but something like EVENT_INFO_FID_FSID_VAL_MEMBER() is too long.
Posting just in case you prefer renaming (fanotify.h is getting a bit
complicated).
NOTE: I also find in various uclibc arch dependent kernel_types.h headers
libc/sysdeps/linux/x86_64/bits/kernel_types.h (19 of 29 archs)
typedef struct {
#ifdef __USE_ALL
int val[2];
#else
int __val[2];
#endif
} __kernel_fsid_t;
which would suggest we need also detection and helper for general
__kernel_fsid_t usage. But I'd ignore it unless anybody reports it's
really needed. I haven't found whether __USE_ALL is set as default, but
I expect it so.
Kind regards,
Petr
testcases/kernel/syscalls/fanotify/fanotify.h | 1 +
testcases/kernel/syscalls/fanotify/fanotify13.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h
index 5370e30bb..9c98aaa1d 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify.h
+++ b/testcases/kernel/syscalls/fanotify/fanotify.h
@@ -143,6 +143,7 @@ struct fanotify_event_info_fid {
};
#endif /* HAVE_STRUCT_FANOTIFY_EVENT_INFO_FID */
+/* NOTE: only for struct fanotify_event_info_fid */
#ifdef HAVE_STRUCT_FANOTIFY_EVENT_INFO_FID_FSID___VAL
# define FSID_VAL_MEMBER(fsid, i) (fsid.__val[i])
#else
diff --git a/testcases/kernel/syscalls/fanotify/fanotify13.c b/testcases/kernel/syscalls/fanotify/fanotify13.c
index 26212ab62..3d8de6009 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify13.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify13.c
@@ -130,8 +130,8 @@ static int setup_marks(unsigned int fd, struct test_case_t *tc)
"kernel");
return 1;
} else if (errno == ENODEV &&
- !FSID_VAL_MEMBER(event_set[i].fsid, 0) &&
- !FSID_VAL_MEMBER(event_set[i].fsid, 1)) {
+ !event_set[i].fsid.val[0] &&
+ !event_set[i].fsid.val[1]) {
tst_res(TCONF,
"FAN_REPORT_FID not supported on "
"filesystem type %s",
--
2.24.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH 1/1] fanotify: Fix for musl
2019-11-16 0:20 [LTP] [PATCH 1/1] fanotify: Fix for musl Petr Vorel
@ 2019-11-16 17:22 ` Jan Stancek
2019-11-17 10:04 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Jan Stancek @ 2019-11-16 17:22 UTC (permalink / raw)
To: ltp
----- Original Message -----
> FSID_VAL_MEMBER() wrapper was meant to be only for struct
> fanotify_event_info_fid, it was used also for struct event_t
> (which has also __kernel_fsid_t fsid, but shouldn't be redefined).
>
> This caused error on recent musl v1.1.23 (with f67b3c17),
> which has struct fanotify_event_info_fid.
>
> Fixes: 0498fc0a8 ("fanotify: Detect val vs. __val
> fanotify_event_info_fid.fsid member")
>
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
If it's needed for __kernel_fsid_t we'll need to come up with better names.
This basically reverts part of previous patch, which looks ok to me.
Acked-by: Jan Stancek <jstancek@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH 1/1] fanotify: Fix for musl
2019-11-16 17:22 ` Jan Stancek
@ 2019-11-17 10:04 ` Petr Vorel
2019-11-18 20:33 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2019-11-17 10:04 UTC (permalink / raw)
To: ltp
Hi Jan,
> ----- Original Message -----
> > FSID_VAL_MEMBER() wrapper was meant to be only for struct
> > fanotify_event_info_fid, it was used also for struct event_t
> > (which has also __kernel_fsid_t fsid, but shouldn't be redefined).
> > This caused error on recent musl v1.1.23 (with f67b3c17),
> > which has struct fanotify_event_info_fid.
> > Fixes: 0498fc0a8 ("fanotify: Detect val vs. __val
> > fanotify_event_info_fid.fsid member")
> > Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> If it's needed for __kernel_fsid_t we'll need to come up with better names.
+1. But hope this is not needed.
> This basically reverts part of previous patch, which looks ok to me.
Yep. I'll add this to commit message, to be obvious.
> Acked-by: Jan Stancek <jstancek@redhat.com>
Thanks for your review.
I'll wait with merge till Monday (if Cyril has some comments).
Kind regards,
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH 1/1] fanotify: Fix for musl
2019-11-17 10:04 ` Petr Vorel
@ 2019-11-18 20:33 ` Petr Vorel
0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2019-11-18 20:33 UTC (permalink / raw)
To: ltp
Hi,
> > If it's needed for __kernel_fsid_t we'll need to come up with better names.
> +1. But hope this is not needed.
> > This basically reverts part of previous patch, which looks ok to me.
> Yep. I'll add this to commit message, to be obvious.
> > Acked-by: Jan Stancek <jstancek@redhat.com>
> Thanks for your review.
> I'll wait with merge till Monday (if Cyril has some comments).
Merged.
Kind regards,
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-18 20:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-16 0:20 [LTP] [PATCH 1/1] fanotify: Fix for musl Petr Vorel
2019-11-16 17:22 ` Jan Stancek
2019-11-17 10:04 ` Petr Vorel
2019-11-18 20:33 ` Petr Vorel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.