diff --git a/src/core/mount.c b/src/core/mount.c index dc86031c0..dc938d00d 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -898,7 +898,14 @@ static void mount_enter_mounting(Mount *m) { if (r < 0) goto fail; - if (m->from_fragment) + if (m->from_fragment) { + _cleanup_free_ char *opts = NULL; + + r = fstab_filter_options(m->parameters_fragment.options, + "nofail\0" "fail\0" "noauto\0" "auto\0", NULL, NULL, &opts); + if (r < 0) + goto fail; + r = exec_command_set( m->control_command, "/bin/mount", @@ -906,9 +913,9 @@ static void mount_enter_mounting(Mount *m) { m->parameters_fragment.what, m->where, "-t", m->parameters_fragment.fstype ? m->parameters_fragment.fstype : "auto", - m->parameters_fragment.options ? "-o" : NULL, m->parameters_fragment.options, + isempty(opts) ? "-o" : NULL, isempty(opts) ? m->parameters_fragment.options : NULL, NULL); - else + } else r = -ENOENT; if (r < 0)