ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
a19bc6
From 530c665c059d3117c21b0dd6c1046accbf07208c Mon Sep 17 00:00:00 2001
a19bc6
From: Michal Sekletar <msekleta@redhat.com>
a19bc6
Date: Thu, 4 May 2017 16:53:30 +0200
a19bc6
Subject: [PATCH] readahead-collect: don't print warning message when handling
a19bc6
 symlink
a19bc6
a19bc6
Since we call open() with O_NOFOLLOW we can't really open symlinks (we
a19bc6
would need to add O_PATH and we don't want that). Let's shortcut things
a19bc6
and return immediately, but don't treat this as an error.
a19bc6
a19bc6
Resolves: #1387095
a19bc6
---
a19bc6
 src/readahead/readahead-collect.c | 3 +++
a19bc6
 1 file changed, 3 insertions(+)
a19bc6
a19bc6
diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c
c62b8e
index 822a803a41..90f7f70bce 100644
a19bc6
--- a/src/readahead/readahead-collect.c
a19bc6
+++ b/src/readahead/readahead-collect.c
a19bc6
@@ -106,6 +106,9 @@ static int pack_file(FILE *pack, const char *fn, bool on_btrfs) {
a19bc6
                 if (errno == EPERM || errno == EACCES)
a19bc6
                         return 0;
a19bc6
 
a19bc6
+                if (errno == ELOOP)
a19bc6
+                        return 0;
a19bc6
+
a19bc6
                 log_warning("open(%s) failed: %m", fn);
a19bc6
                 r = -errno;
a19bc6
                 goto finish;