From 0c41c1187ba55fde6299d01c94c99fb4fe51a08d Mon Sep 17 00:00:00 2001 From: Pavel Tikhomirov Date: Wed, 8 Jul 2020 09:57:33 +0300 Subject: [PATCH] mount: fix broken remounted_rw check Expression (x && REMOUNTED_RW) is always same as just (x). It should've been (x & REMOUNTED_RW) to check if mount is marked as temporary remounted writable and requires to be switched back. By fixing this check we eliminate excess readonly remounts. Cherry-picked from Virtuozzo criu: https://src.openvz.org/projects/OVZ/repos/criu/commits/167f8ac67 Signed-off-by: Pavel Tikhomirov --- criu/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/mount.c b/criu/mount.c index b2810b7a5..3421ef491 100644 --- a/criu/mount.c +++ b/criu/mount.c @@ -4113,7 +4113,7 @@ static int __remount_readonly_mounts(struct ns_id *ns) if (ns && mi->nsid != ns) continue; - if (!(*mi->remounted_rw && REMOUNTED_RW)) + if (!(*mi->remounted_rw & REMOUNTED_RW)) continue; /*