From 0b2a7223bbb2dd5b8ea150e6c5f22ec6b3072fcc Mon Sep 17 00:00:00 2001 From: Nicolas Viennot Date: Fri, 10 Sep 2021 16:53:22 +0000 Subject: [PATCH] mount: fix double-dump file system bug In the function dump_one_fs(), there's a comment that says "mnt_bind is a cycled list, so list_for_each can't be used here." That means that the list head of the list is also a node of the list. The subsequent list_for_each_entry() marks all the mount info nodes as dumped, except it skips the list head, which is also a mount info. This is the bug we fix. This bug made CRIU dump a file system twice. See https://github.com/checkpoint-restore/criu-image-streamer/issues/8 Signed-off-by: Nicolas Viennot --- criu/mount.c | 1 + 1 file changed, 1 insertion(+) diff --git a/criu/mount.c b/criu/mount.c index 3670be9ae..ec31f02c2 100644 --- a/criu/mount.c +++ b/criu/mount.c @@ -1549,6 +1549,7 @@ static int dump_one_fs(struct mount_info *mi) if (ret < 0) return ret; + pm->dumped = true; list_for_each_entry(t, &pm->mnt_bind, mnt_bind) t->dumped = true; return 0;