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