From: Lennart Poettering Date: Wed, 19 Dec 2018 00:03:52 +0000 (+0100) Subject: nspawn: no need to make top-level directory a bind mount if we just dissected an... X-Git-Tag: v242-rc1~217^2~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e50cd82f688b69065fe67314f6f45a35c01ee6ee;p=thirdparty%2Fsystemd.git nspawn: no need to make top-level directory a bind mount if we just dissected an image --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 18ba76f0cd6..f668fffb6e0 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2896,10 +2896,12 @@ static int outer_child( "Selected user namespace base " UID_FMT " and range " UID_FMT ".", arg_uid_shift, arg_uid_range); } - /* Turn directory into bind mount */ - r = mount_verbose(LOG_ERR, directory, directory, NULL, MS_BIND|MS_REC, NULL); - if (r < 0) - return r; + if (!dissected_image) { + /* Turn directory into bind mount */ + r = mount_verbose(LOG_ERR, directory, directory, NULL, MS_BIND|MS_REC, NULL); + if (r < 0) + return r; + } r = setup_pivot_root( directory,