summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2015-11-21 20:59:28 +0000
committerRichard Maw <richard.maw@gmail.com>2015-11-21 21:14:21 +0000
commit5c4b805dbdc83ef4269d0990dc4ed481ebb3d5ff (patch)
treeb8f32bb848c5137f629207bb399be77f5a7679df
parent07d016785495c3cf53a6008ea13326831b395121 (diff)
downloadsandboxlib-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.py3
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: