[systemd-commits] 2 commits - src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Mon Sep 10 00:22:31 PDT 2012


 src/shared/path-util.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit fa125f4e44aaf102548ab464e3ea457214fd56e0
Author: Mantas MikulÄ—nas <grawity at gmail.com>
Date:   Sun Sep 9 15:16:19 2012 +0300

    path-util: fall back to stat() if kernel does not support name_to_handle_at()
    
    Fixes instant hang on kernels that do not have CONFIG_FHANDLE enabled.

diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index 97a2005..b51a68d 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -349,8 +349,8 @@ int path_is_mount_point(const char *t, bool allow_symlink) {
 
         r = name_to_handle_at(AT_FDCWD, t, h, &mount_id, allow_symlink ? AT_SYMLINK_FOLLOW : 0);
         if (r < 0) {
-                if (errno == ENOTSUP)
-                        /* This file system does not support
+                if (errno == ENOSYS || errno == ENOTSUP)
+                        /* This kernel or file system does not support
                          * name_to_handle_at(), hence fallback to the
                          * traditional stat() logic */
                         goto fallback;

commit 8ac7549330c774b8ca04034c1303165fe6a920b0
Author: Mantas MikulÄ—nas <grawity at gmail.com>
Date:   Sun Sep 9 15:16:18 2012 +0300

    path-util: do not fail in path_is_mountpoint() if path doesn't exist
    
    This was accidentally lost in commit 1640a0b6b05b.

diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index 39f77f6..97a2005 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -387,8 +387,12 @@ fallback:
         else
                 r = lstat(t, &a);
 
-        if (r < 0)
+        if (r < 0) {
+                if (errno == ENOENT)
+                        return 0;
+
                 return -errno;
+        }
 
         r = path_get_parent(t, &parent);
         if (r < 0)



More information about the systemd-commits mailing list