Hi,

there is another ubuntu bug about this:

https://launchpad.net/bugs/1161989

The referenced kernel bug seems to conclude that this is an error with fatrace
rather than a kernel bug. Instead, fanotify_init should be called with
O_LARGEFILE it seems. A bug for arch linux came to the same conclusion:

https://bugs.archlinux.org/task/34520

Attached, find a hack/patch which fixed the problem for me.

cheers, josch
Description: works around a limitation on 64bit systems and files larger than 2G
 If opening a file larger than 2G on a 64bit system, fatrace will quit with
 "read: Value too large for defined data type". This patch works around this
 issue until it is fixed elsewhere.
Author: Johannes Schauer <j.scha...@email.de>
Bug: https://patchwork.kernel.org/patch/2142341/
Bug-Ubuntu:
 https://launchpad.net/bugs/1161989
 https://launchpad.net/bugs/1018939

--- fatrace-0.6.orig/fatrace.c
+++ fatrace-0.6/fatrace.c
@@ -33,6 +33,8 @@
 #include <sys/fanotify.h>
 #include <sys/time.h>
 
+#define O_LARGEFILE   0100000
+
 /* command line options */
 static char* option_output = NULL;
 static long option_timeout = -1;
@@ -334,7 +336,7 @@ main (int argc, char** argv)
 
     parse_args (argc, argv);
 
-    fan_fd = fanotify_init (0, 0);
+    fan_fd = fanotify_init (0, O_LARGEFILE);
     if (fan_fd < 0) {
         err = errno;
         fprintf (stderr, "Cannot initialize fanotify: %s\n", strerror (err));

Reply via email to