[CRIU] [PATCH 3/4] mount: fix comparison of stat.st_dev and mount_info->s_dev (v2)

Andrey Vagin avagin at openvz.org
Tue Apr 15 22:04:26 PDT 2014


st_dev and s_dev have different formats.
st_dev is (MAJOR(dev) << 8) | MINOR(dev)
s_dev is (MAJOR(dev) << 20) | MINOR(dev)

so we need to convert one of them

v2: use kdev_to_odev
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 mount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mount.c b/mount.c
index 52a327e..b7e4f55 100644
--- a/mount.c
+++ b/mount.c
@@ -502,7 +502,7 @@ static int __open_mountpoint(struct mount_info *pm, int mnt_fd)
 		goto err;
 	}
 
-	if (st.st_dev != pm->s_dev) {
+	if (st.st_dev != kdev_to_odev(pm->s_dev)) {
 		pr_err("The file system %#x (%#x) %s %s is inaccessible\n",
 				pm->s_dev, (int)st.st_dev, pm->fstype->name, pm->mountpoint);
 		goto err;
-- 
1.8.5.3



More information about the CRIU mailing list