mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
Merge pull request #32844 from YHNdnzj/mount-defaultdep-followup
core/mount: correctly set DefaultDependencies=no for mounts from mountinfo
This commit is contained in:
@@ -604,6 +604,9 @@ static int mount_add_non_exec_dependencies(Mount *m) {
|
||||
if (!m->where)
|
||||
return 0;
|
||||
|
||||
if (mount_is_credentials(m))
|
||||
UNIT(m)->default_dependencies = false;
|
||||
|
||||
/* Adds in all dependencies directly responsible for ordering the mount, as opposed to dependencies
|
||||
* resulting from the ExecContext and such. */
|
||||
|
||||
@@ -650,9 +653,6 @@ static int mount_add_extras(Mount *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
if (mount_is_credentials(m))
|
||||
u->default_dependencies = false;
|
||||
|
||||
r = unit_patch_contexts(u);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -374,7 +374,7 @@ static int swap_setup_unit(
|
||||
int priority,
|
||||
bool set_flags) {
|
||||
|
||||
_cleanup_(unit_freep) Unit *new = NULL;
|
||||
_cleanup_(unit_freep) Unit *new_unit = NULL;
|
||||
_cleanup_free_ char *e = NULL;
|
||||
Unit *u;
|
||||
Swap *s;
|
||||
@@ -398,11 +398,11 @@ static int swap_setup_unit(
|
||||
"Swap appeared twice with different device paths %s and %s, refusing.",
|
||||
s->parameters_proc_swaps.what, what_proc_swaps);
|
||||
} else {
|
||||
r = unit_new_for_name(m, sizeof(Swap), e, &new);
|
||||
r = unit_new_for_name(m, sizeof(Swap), e, &new_unit);
|
||||
if (r < 0)
|
||||
return log_warning_errno(r, "Failed to load swap unit '%s': %m", e);
|
||||
|
||||
u = new;
|
||||
u = new_unit;
|
||||
s = ASSERT_PTR(SWAP(u));
|
||||
|
||||
s->what = strdup(what);
|
||||
@@ -438,7 +438,7 @@ static int swap_setup_unit(
|
||||
p->priority_set = true;
|
||||
|
||||
unit_add_to_dbus_queue(u);
|
||||
TAKE_PTR(new);
|
||||
TAKE_PTR(new_unit);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user