[systemd-devel] [PATCH 2/2] path-util: fall back to stat() if kernel does not support name_to_handle_at()

Mantas Mikulėnas grawity at gmail.com
Sun Sep 9 05:16:19 PDT 2012


Fixes instant hang on kernels that do not have CONFIG_FHANDLE enabled.

Signed-off-by: Mantas Mikulėnas <grawity at gmail.com>
---
 src/shared/path-util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;
-- 
1.7.12



More information about the systemd-devel mailing list