[CRIU] [PATCH] mounts: handle device numbers in different formats properly

Andrey Vagin avagin at openvz.org
Wed Mar 9 14:38:40 PST 2016


From: Andrew Vagin <avagin at virtuozzo.com>

We have two formats for devices and we had to use proper
helpers for them and compare values of a one format.

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 criu/mount.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/criu/mount.c b/criu/mount.c
index 451b294..f74155e 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -191,7 +191,7 @@ struct mount_info *lookup_overlayfs(char *rpath, unsigned int st_dev,
 
 	/* If the mnt_id and device number match for some entry, no fixup is needed */
 	for (m = mntinfo; m != NULL; m = m->next)
-		if (st_dev == m->s_dev && mnt_id == m->mnt_id)
+		if (st_dev == kdev_to_odev(m->s_dev) && mnt_id == m->mnt_id)
 			return NULL;
 
 	return __lookup_overlayfs(mntinfo, rpath, st_dev, st_ino, mnt_id);
@@ -1583,7 +1583,8 @@ static int fusectl_dump(struct mount_info *pm)
 		}
 
 		for (it = mntinfo; it; it = it->next) {
-			if (it->fstype->code == FSTYPE__FUSE && id == minor(it->s_dev) && !it->external) {
+			if (it->fstype->code == FSTYPE__FUSE &&
+					id == kdev_minor(it->s_dev) && !it->external) {
 				pr_err("%s is a fuse mount but not external\n", it->mountpoint);
 				goto out;
 			}
-- 
2.5.0



More information about the CRIU mailing list