[systemd-commits] 2 commits - src/readahead-collect.c

Lennart Poettering lennart at kemper.freedesktop.org
Wed May 25 09:02:59 PDT 2011


 src/readahead-collect.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit cf37e24688971b29223858f733beb1b85e3af03c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed May 25 18:02:28 2011 +0200

    readahead: explain that it is safe to ignore EACCES

diff --git a/src/readahead-collect.c b/src/readahead-collect.c
index 913a340..20881b3 100644
--- a/src/readahead-collect.c
+++ b/src/readahead-collect.c
@@ -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");

commit 3afe3725fcf21fab7204243b9485a118e499b4a3
Author: Harald Hoyer <harald at redhat.com>
Date:   Wed May 25 13:09:08 2011 +0200

    readahead-collect: ignore EACCES for fanotify
    
    At the start of auditd, we are temporarily not able to read
    from the fanotify fd. Ignoring it, seems to work.

diff --git a/src/readahead-collect.c b/src/readahead-collect.c
index 3c48a02..913a340 100644
--- a/src/readahead-collect.c
+++ b/src/readahead-collect.c
@@ -380,7 +380,7 @@ static int collect(const char *root) {
 
                 if ((n = read(fanotify_fd, &data, sizeof(data))) < 0) {
 
-                        if (errno == EINTR || errno == EAGAIN)
+                        if (errno == EINTR || errno == EAGAIN || errno == EACCES)
                                 continue;
 
                         log_error("Failed to read event: %m");



More information about the systemd-commits mailing list