From 19d2422b99df72e6fc8f794c630687cb2740a20b Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Wed, 15 Feb 2017 11:28:24 -0700 Subject: [PATCH] c/r: only supply --ext-mount-map for bind mounts The rest of the mounts can be restored normally. Signed-off-by: Tycho Andersen --- src/lxc/criu.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lxc/criu.c b/src/lxc/criu.c index 53c368b2a..9b0ccacb6 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -334,8 +334,18 @@ static void exec_criu(struct criu_opts *opts) goto err; while (getmntent_r(mnts, &mntent, buf, sizeof(buf))) { - char *fmt, *key, *val; + char *fmt, *key, *val, *mntdata; char arg[2 * PATH_MAX + 2]; + unsigned long flags; + + if (parse_mntopts(mntent.mnt_opts, &flags, &mntdata) < 0) + goto err; + + free(mntdata); + + /* only add --ext-mount-map for actual bind mounts */ + if (!(flags & MS_BIND)) + continue; if (strcmp(opts->action, "dump") == 0) { fmt = "/%s:%s";