[systemd-devel] [PATCH 1/2] core: keep mountinfo .mounts until late shutdown
Umut Tezduyar
umut at tezduyar.com
Mon Feb 4 06:03:59 PST 2013
Downside of this patch is, mountinfo mounts stick around as inactive-dead
even when the file system they represent is unmounted.
On Mon, Feb 4, 2013 at 3:00 PM, Umut Tezduyar <umut at tezduyar.com> wrote:
> .mount units coming from /proc/self/mountinfo file are
> unmounted after local-fs.target is reached during shutdown.
>
> Problem: .mount units popping up in mountinfo file are
> added to systemd without any dependency. For that reason,
> they are the first one to be unmounted during shutdown.
> Whichever program mounted the file system deserves a
> chance to also unmount it. This patch ensures that
> /proc/self/mountinfo units will be unmounted after
> local-fs.target during shutdown (if they haven't been
> unmounted already)
> ---
> src/core/mount.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/src/core/mount.c b/src/core/mount.c
> index 2aaf78c..29ce440 100644
> --- a/src/core/mount.c
> +++ b/src/core/mount.c
> @@ -1488,6 +1488,10 @@ static int mount_add_one(
> goto fail;
> }
>
> + r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE,
> UNIT_REQUIRED_BY, SPECIAL_LOCAL_FS_TARGET, NULL, true);
> + if (r < 0)
> + goto fail;
> +
> unit_add_to_load_queue(u);
> } else {
> delete = false;
> --
> 1.7.2.5
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130204/4dd75a2f/attachment.html>
More information about the systemd-devel
mailing list