[systemd-devel] [PATCH 1/2] core: keep mountinfo .mounts until late shutdown

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Feb 4 07:23:16 PST 2013


Hi,

On Mon, Feb 04, 2013 at 03:03:59PM +0100, Umut Tezduyar wrote:
> 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,
Hm, what do you mean exactly by that? Mount units I see have dependencies
on mount points higher in the hierarchy. E.g.
Requires=systemd-journald.socket -.mount home.mount
After=systemd-journald.socket -.mount home.mount
Description=/home/zbyszek/debian-x32/home
SourcePath=/proc/self/mountinfo

> > they are the first one to be unmounted during shutdown.
This seems correct. Usually they were mounted last, by an admin,
and should be unmounted first.

Zbyszek

> > 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
> >
> >

> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel



More information about the systemd-devel mailing list