Review: Approve

This is quite an excellent solution; I had been thinking about using mount 
namespaces for this but private is much simpler.

Diff comments:

> diff --git a/curtin/util.py b/curtin/util.py
> index be063d7..7be3033 100644
> --- a/curtin/util.py
> +++ b/curtin/util.py
> @@ -695,7 +695,22 @@ class ChrootableTarget(object):
>              log_call(subp, ['udevadm', 'settle'])
>  
>          for p in reversed(self.umounts):
> -            do_umount(p)
> +            # Consider the following sequence:
> +            #
> +            # mkdir a a/b c
> +            # mount --bind a c
> +            # mount -t sysfs sysfs a/b
> +            # umount c
> +            #
> +            # This umount fails with "mountpoint is busy", because of
> +            # the mountpoint at c/b. But if we unmount c recursively,
> +            # a/b ends up getting unmounted. What we need to do is to
> +            # make the mountpoints c and c/b "private" so that
> +            # unmounting them does not propagate to the mount tree c
> +            # was cloned from (See "Shared subtree operations" in
> +            # mount(8) for more on this).

Thanks for the comment, I'd also include one or two of the bugs that this fixes 
in the comments, it's
useful to see the practical problem we encountered for reference.

> +            subp(['mount', '--make-rprivate', p])
> +            do_umount(p, recursive=True)
>  
>          rconf = paths.target_path(self.target, "/etc/resolv.conf")
>          if self.sys_resolvconf and self.rconf_d:


-- 
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/405670
Your team curtin developers is subscribed to branch curtin:master.


-- 
Mailing list: https://launchpad.net/~curtin-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~curtin-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to