[oe-commits] [openembedded-core] 10/10: systemd: fix NFS regression

git at git.openembedded.org git at git.openembedded.org
Fri Sep 27 12:40:10 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 9973f89dafdf9d21f4021f59f1f4669f4ac13aff
Author: Chen Qi <Qi.Chen at windriver.com>
AuthorDate: Fri Sep 27 14:42:51 2019 +0800

    systemd: fix NFS regression
    
    Currently systemd cannot boot correctly on NFS. This is because
    the code uses readdir which returns DT_UNKNOWN instead of DT_LNK
    on NFS. So consider DT_UNKNOWN to fix this problem.
    
    Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ...-consider-symlink-on-filesystems-like-NFS.patch | 42 ++++++++++++++++++++++
 meta/recipes-core/systemd/systemd_243.bb           |  1 +
 2 files changed, 43 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd/0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch b/meta/recipes-core/systemd/systemd/0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch
new file mode 100644
index 0000000..ba20a0b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch
@@ -0,0 +1,42 @@
+From d0122c077d2d8fd0fd29b463c501e7ddf9177ff3 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen at windriver.com>
+Date: Tue, 24 Sep 2019 17:04:50 +0800
+Subject: [PATCH] unit-file.c: consider symlink on filesystems like NFS
+
+Some filesystems do not fully support readdir, according to the manual,
+so we should also consider DT_UNKNOWN to correctly handle symlinks.
+
+Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
+
+Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/13637]
+---
+ src/shared/unit-file.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/shared/unit-file.c b/src/shared/unit-file.c
+index 4a5f23e6c1..8373103000 100644
+--- a/src/shared/unit-file.c
++++ b/src/shared/unit-file.c
+@@ -247,6 +247,7 @@ int unit_file_build_name_map(
+                         _cleanup_free_ char *_filename_free = NULL, *simplified = NULL;
+                         const char *suffix, *dst = NULL;
+                         bool valid_unit_name;
++                        struct stat sb;
+ 
+                         valid_unit_name = unit_name_is_valid(de->d_name, UNIT_NAME_ANY);
+ 
+@@ -279,7 +280,10 @@ int unit_file_build_name_map(
+                         if (hashmap_contains(ids, de->d_name))
+                                 continue;
+ 
+-                        if (de->d_type == DT_LNK) {
++                        if (de->d_type == DT_LNK ||
++                            (de->d_type == DT_UNKNOWN &&
++                             lstat(filename, &sb) == 0 &&
++                             (sb.st_mode & S_IFMT) == S_IFLNK)) {
+                                 /* We don't explicitly check for alias loops here. unit_ids_map_get() which
+                                  * limits the number of hops should be used to access the map. */
+ 
+-- 
+2.17.1
+
diff --git a/meta/recipes-core/systemd/systemd_243.bb b/meta/recipes-core/systemd/systemd_243.bb
index d0f9d17..eaa12ed 100644
--- a/meta/recipes-core/systemd/systemd_243.bb
+++ b/meta/recipes-core/systemd/systemd_243.bb
@@ -22,6 +22,7 @@ SRC_URI += "file://touchscreen.rules \
            file://0003-implment-systemd-sysv-install-for-OE.patch \
            file://0004-rules-whitelist-hd-devices.patch \
            file://0005-rules-watch-metadata-changes-in-ide-devices.patch \
+           file://0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch \
            file://99-default.preset \
            "
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list