From: Mike Yuan Date: Mon, 10 Feb 2025 19:22:09 +0000 (+0100) Subject: core/mount: report accurate can_start and can_reload X-Git-Tag: v258-rc1~1343^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74c0d9726cfbd4ecdf1807adf5433fcf4b1d86b4;p=thirdparty%2Fsystemd.git core/mount: report accurate can_start and can_reload --- diff --git a/src/core/mount.c b/src/core/mount.c index 6998f02d5a4..9632a12ca67 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1424,6 +1424,12 @@ static int mount_reload(Unit *u) { return 1; } +static bool mount_can_reload(Unit *u) { + Mount *m = ASSERT_PTR(MOUNT(u)); + + return get_mount_parameters_fragment(m); +} + static int mount_serialize(Unit *u, FILE *f, FDSet *fds) { Mount *m = ASSERT_PTR(MOUNT(u)); @@ -2361,6 +2367,9 @@ static int mount_can_start(Unit *u) { return r; } + if (!get_mount_parameters_fragment(m)) + return -ENOENT; + return 1; } @@ -2475,7 +2484,9 @@ const UnitVTable mount_vtable = { .start = mount_start, .stop = mount_stop, + .reload = mount_reload, + .can_reload = mount_can_reload, .clean = mount_clean, .can_clean = mount_can_clean,