Bug 707577

Summary: systemd-readahead-collect fails, if auditd is started and selinux is turned on
Product: [Fedora] Fedora Reporter: Harald Hoyer <harald>
Component: kernelAssignee: Eric Paris <eparis>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: gansalmon, itamar, jforbes, johannbg, jonathan, kernel-maint, lpoetter, madhu.chinakonda, metherid, mschmidt, notting, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-23 17:24:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Harald Hoyer 2011-05-25 12:33:52 UTC
From: Harald Hoyer <harald>

At the start of auditd, we are temporarily not able to read
from the fanotify fd. Ignoring it, seems to work.
---
 src/readahead-collect.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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");

Comment 1 Harald Hoyer 2011-05-25 15:09:55 UTC
ok, seems to be a kernel bug... reassigning.

Comment 2 Lennart Poettering 2011-05-25 19:11:24 UTC
I have no applied Harald's fix to work around the problem for now. It's also in F15.

Comment 3 Josh Boyer 2012-06-06 13:02:40 UTC
Did this ever get worked on/fixed?

Comment 4 Harald Hoyer 2012-06-06 17:55:53 UTC
(In reply to comment #3)
> Did this ever get worked on/fixed?

Don't know.. might still be present

Comment 5 Harald Hoyer 2012-06-06 17:58:28 UTC
current systemd-readahead-collect works around the "bug"

                if ((n = read(fanotify_fd, &data, sizeof(data))) < 0) {

                        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");
                        r = -errno;
                        goto finish;
                }

Comment 6 Eric Paris 2012-06-06 18:13:10 UTC
It's still there.  Man I'm a bad maintainer.

Comment 7 Fedora End Of Life 2013-04-03 14:49:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 8 Justin M. Forbes 2013-04-05 19:55:15 UTC
Is this still an issue with the 3.9 kernels in F19?

Comment 9 Justin M. Forbes 2013-04-23 17:24:44 UTC
This bug is being closed with INSUFFICIENT_DATA as there has not been a
response in 2 weeks.  If you are still experiencing this issue,
please reopen and attach the relevant data from the latest kernel you are
running and any data that might have been requested previously.