From 82cb4b4bd419b1ac63c49db61e488ac7c875bc3e Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Tue, 6 Jun 2017 09:50:57 +0300 Subject: [PATCH] mount: don't use phys_stat_resolve_dev() in open_mount() We don't need to look up a mount info element, because we already have it there. Cc: Cyrill Gorcunov Cc: Dmitry Safonov Signed-off-by: Andrei Vagin --- criu/mount.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/criu/mount.c b/criu/mount.c index 8773ca2e8..672930945 100644 --- a/criu/mount.c +++ b/criu/mount.c @@ -1019,8 +1019,8 @@ int mnt_is_dir(struct mount_info *pm) */ int __open_mountpoint(struct mount_info *pm, int mnt_fd) { - dev_t dev; struct stat st; + int dev; int ret; if (mnt_fd == -1) { @@ -1049,7 +1049,7 @@ int __open_mountpoint(struct mount_info *pm, int mnt_fd) goto err; } - dev = phys_stat_resolve_dev(pm->nsid, st.st_dev, pm->ns_mountpoint + 1); + dev = MKKDEV(major(st.st_dev), minor(st.st_dev)); /* * Always check for @s_dev_rt here, because the @s_dev * from the image (in case of restore) has all rights @@ -1058,7 +1058,7 @@ int __open_mountpoint(struct mount_info *pm, int mnt_fd) */ if (dev != pm->s_dev_rt) { pr_err("The file system %#x %#x (%#x) %s %s is inaccessible\n", - pm->s_dev, pm->s_dev_rt, (int)dev, + pm->s_dev, pm->s_dev_rt, dev, pm->fstype->name, pm->ns_mountpoint); goto err; }