Comment 4 for bug 1721279

Revision history for this message
Scott Moser (smoser) wrote :

As I understand the change
 http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/xenial-proposed/revision/1423
what has been done is to sort /proc/self/mounts with C locale sorting and unmount.

A more correct change is to just read the file backwards.

That is what mount-image-callback does in 'umount_r'
 http://bazaar.launchpad.net/~cloud-utils-dev/cloud-utils/trunk/view/head:/bin/mount-image-callback#L52

I'm guessing the change you made was sufficient for your use case, but /proc/mounts lists mounts in order of operation, so those later are guaranteed to be "on top" of those listed earlier.