diff options
author | Richard Maw <richard.maw@gmail.com> | 2015-11-21 20:59:28 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@gmail.com> | 2015-11-21 21:14:21 +0000 |
commit | 5c4b805dbdc83ef4269d0990dc4ed481ebb3d5ff (patch) | |
tree | b8f32bb848c5137f629207bb399be77f5a7679df | |
parent | 07d016785495c3cf53a6008ea13326831b395121 (diff) | |
download | sandboxlib-5c4b805dbdc83ef4269d0990dc4ed481ebb3d5ff.tar.gz |
sandboxlib.chroot: Don't attempt to unmount remount mounts
The mount operation is overloaded to also remount to change flags.
This does not result in a new mount,
so unmounting it is the wrong thing to do in this case.
For now, we assume that we're modifying a mount we created earlier,
so we can just avoid unmounting when we remount,
rather than having to determine how to reverse the changing of flags.
-rw-r--r-- | sandboxlib/chroot.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sandboxlib/chroot.py b/sandboxlib/chroot.py index a787c93..9724368 100644 --- a/sandboxlib/chroot.py +++ b/sandboxlib/chroot.py @@ -147,7 +147,8 @@ def mount_all(rootfs_path, mount_info_list): os.makedirs(path) mount(source, path, mount_type, mount_options) - mounted.append(path) + if not mount_options or 'remount' not in mount_options: + mounted.append(path) yield finally: |