chiark / gitweb /
label: udev might be making changes in /dev while we iterate through it
authorLennart Poettering <lennart@poettering.net>
Fri, 25 Feb 2011 00:47:31 +0000 (01:47 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 25 Feb 2011 00:47:31 +0000 (01:47 +0100)
Also, there are most likely dead symlinks in there, so let's ignore
ENOENT when we relabel.

https://bugzilla.redhat.com/show_bug.cgi?id=680169

TODO
src/automount.c
src/label.c
src/label.h
src/mount-setup.c
src/tmpfiles.c

diff --git a/TODO b/TODO
index 0f643073d70d0dae37bc78bbe7a47521c7799647..b3c33ad1e20dd24a23e52e60bc32e77a000cb028 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,7 @@
 F15:
 
+* swap units that are activated by one name but shown in the kernel under another are semi-broken
+
 * dep cycle basic → udev-retry → auditd → iptables → basic
 
 * isolate multi-user.target doesn't start a getty@tty1 if we run it from graphical.target
@@ -19,7 +21,11 @@ F15:
 
 * Make systemd-cryptsetup cancellable
 
-* udev should be able to upgrade its database on its own
+* add fstab fields to add wait timeouts, change Wants to Requires by local-fs.target
+
+* hook emergency.target into local-fs.target in some way as OnFailure with isolate
+
+* convince Karel to give us our own mount option prefix
 
 Features:
 
index 9447c0d8fcf81af7c3c3a169bc4bccd70741ca90..7289311684caff948922999bb420b157a7191b0f 100644 (file)
@@ -305,7 +305,7 @@ static int open_dev_autofs(Manager *m) {
         if (m->dev_autofs_fd >= 0)
                 return m->dev_autofs_fd;
 
-       label_fix("/dev/autofs");
+       label_fix("/dev/autofs", false);
 
         if ((m->dev_autofs_fd = open("/dev/autofs", O_CLOEXEC|O_RDONLY)) < 0) {
                 log_error("Failed to open /dev/autofs: %s", strerror(errno));
index 218d0dfa06f119e34991f2bd4d281c163e5b9f9f..09ded642fb1d51003230b09e41e484ae0dd48209 100644 (file)
@@ -65,7 +65,7 @@ int label_init(void) {
         return r;
 }
 
-int label_fix(const char *path) {
+int label_fix(const char *path, bool ignore_enoent) {
         int r = 0;
 
 #ifdef HAVE_SELINUX
@@ -90,6 +90,10 @@ int label_fix(const char *path) {
                         /* If the FS doesn't support labels, then exit without warning */
                         if (r < 0 && errno == ENOTSUP)
                                 return 0;
+
+                        /* Ignore ENOENT in some cases */
+                        if (r < 0 && ignore_enoent && errno == ENOENT)
+                                return 0;
                 }
         }
 
index f1bf5d6d5e2ce449a5474ced579249285dbf9dd2..7ea11cdc552b5a0ba75151737d6f5d734d9ffb67 100644 (file)
 ***/
 
 #include <sys/types.h>
+#include <stdbool.h>
 
 int label_init(void);
 void label_finish(void);
 
-int label_fix(const char *path);
+int label_fix(const char *path, bool ignore_enoent);
 
 int label_socket_set(const char *label);
 void label_socket_clear(void);
index 64fb4765f613d9929e956e753673ca813544a28c..5cbaee6be7eb8a0d06b00aee6ff3e6df28594433 100644 (file)
@@ -121,7 +121,7 @@ static int mount_one(const MountPoint *p) {
                 return p->fatal ? -errno : 0;
         }
 
-        label_fix(p->where);
+        label_fix(p->where, false);
 
         return 0;
 }
@@ -216,7 +216,7 @@ static int nftw_cb(
         if (ftwbuf->level == 0)
                 return 0;
 
-        label_fix(fpath);
+        label_fix(fpath, true);
         return 0;
 };
 
index 917747a4a48548237549ac743c710e0a11172ac7..0302262394ef1f694f6f6745a62bc633961832c8 100644 (file)
@@ -507,7 +507,7 @@ static int create_item(Item *i) {
                 break;
         }
 
-        if ((r = label_fix(i->path)) < 0)
+        if ((r = label_fix(i->path, false)) < 0)
                 goto finish;
 
         log_debug("%s created successfully.", i->path);