mount-setup: don't complain if we try to fix the label of a dir beneath a mount but can't due to EROFS

This commit is contained in:
Lennart Poettering
2012-07-03 16:25:50 +02:00
parent 61b1477c81
commit c9bc076461
6 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -314,7 +314,7 @@ static int open_dev_autofs(Manager *m) {
if (m->dev_autofs_fd >= 0)
return m->dev_autofs_fd;
label_fix("/dev/autofs", false);
label_fix("/dev/autofs", false, false);
if ((m->dev_autofs_fd = open("/dev/autofs", O_CLOEXEC|O_RDONLY)) < 0) {
log_error("Failed to open /dev/autofs: %s", strerror(errno));
+4 -4
View File
@@ -121,7 +121,7 @@ static int mount_one(const MountPoint *p, bool relabel) {
/* Relabel first, just in case */
if (relabel)
label_fix(p->where, true);
label_fix(p->where, true, true);
if ((r = path_is_mount_point(p->where, true)) < 0)
return r;
@@ -150,7 +150,7 @@ static int mount_one(const MountPoint *p, bool relabel) {
/* Relabel again, since we now mounted something fresh here */
if (relabel)
label_fix(p->where, false);
label_fix(p->where, false, false);
return 1;
}
@@ -347,7 +347,7 @@ static int nftw_cb(
if (_unlikely_(ftwbuf->level == 0))
return FTW_CONTINUE;
label_fix(fpath, true);
label_fix(fpath, false, false);
/* /run/initramfs is static data and big, no need to
* dynamically relabel its contents at boot... */
@@ -391,7 +391,7 @@ int mount_setup(bool loaded_policy) {
/* Explicitly relabel these */
NULSTR_FOREACH(j, relabel)
label_fix(j, true);
label_fix(j, true, false);
after_relabel = now(CLOCK_MONOTONIC);