Improve mounts for container
Our current way to make bind mounts fails on btrfs file systems,
but recursive bind mounts work, so we fallback to recursive bind mounts
if necessary.
@@ -693,6 +693,13 @@ class ContainerExecutor(baseexecutor.BaseExecutor):
try:
container.make_bind_mount(mount_path, mount_path)
except OSError as e:
+ # on btrfs, non-recursive bind mounts faitl
+ if e.errno == errno.EINVAL:
+ try:
+ container.make_bind_mount(mount_path, mount_path, recursive=True)
+ except OSError as e2:
+ logging.debug("Failed to make %s a (recursive) bind mount: %s", mount_path, e2)
+ else:
logging.debug("Failed to make %s a bind mount: %s", mount_path, e)
if not os.path.exists(temp_path):
os.makedirs(temp_path)
