]> err.no Git - systemd/commitdiff
readahead: explain that it is safe to ignore EACCES
authorLennart Poettering <lennart@poettering.net>
Wed, 25 May 2011 16:02:28 +0000 (18:02 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 25 May 2011 16:02:28 +0000 (18:02 +0200)
src/readahead-collect.c

index 913a34005e3c69f8a8c31dfa5510997e68bb9a17..20881b3944673c4fb33b9a2ec6a34492d5e8fe43 100644 (file)
@@ -380,7 +380,17 @@ static int collect(const char *root) {
 
                 if ((n = read(fanotify_fd, &data, sizeof(data))) < 0) {
 
-                        if (errno == EINTR || errno == EAGAIN || errno == EACCES)
+                        if (errno == EINTR || errno == EAGAIN)
+                                continue;
+
+                        /* fanotify sometimes returns EACCES on read()
+                         * where it shouldn't. For now let's just
+                         * ignore it here (which is safe), but
+                         * eventually this should be
+                         * dropped when the kernel is fixed.
+                         *
+                         * https://bugzilla.redhat.com/show_bug.cgi?id=707577 */
+                        if (errno == EACCES)
                                 continue;
 
                         log_error("Failed to read event: %m");