Hardcoded KERNEL_O_LARGEFILE does not work on ARM

Bug #1755787 reported by Mike Kazantsev on 2018-03-14
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
fatrace
Undecided
Unassigned
fatrace (Debian)
Fix Released
Unknown

Bug Description

Running fatrace on aarch64 (armv8) results in following error:
Cannot initialize fanotify: Invalid argument

Looking at strace output, can see error coming from fanotify_init syscall:
fanotify_init(FAN_CLASS_NOTIF, O_RDONLY|O_NOFOLLOW) = -1 EINVAL (Invalid argument)

Which in the code is used as:
fan_fd = fanotify_init (0, KERNEL_O_LARGEFILE);

So there is a discrepancy in how strace interprets passed flags value (as "O_RDONLY|O_NOFOLLOW") vs what it is intended to represent ("O_LARGEFILE").

Replacing fanotify_init line in code with e.g. "fanotify_init(0, 0)" fixes the problem, again pointing at hardcoded KERNEL_O_LARGEFILE value to be the cause of error.

Maybe it can just be wrapped into #ifndef macros, and be defined (presumably for old x86 kernels) only when needed that way?

Also found same issue described here with regards to mips architecture:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=784983

Martin Pitt (pitti) on 2019-09-29
Changed in fatrace:
status: New → Fix Committed
Changed in fatrace (Debian):
status: Unknown → New
Martin Pitt (pitti) wrote :
Changed in fatrace:
status: Fix Committed → Fix Released
Changed in fatrace (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.