[CRIU] [PATCH 3/4] mount: fix comparison of stat.st_dev and mount_info->s_dev
Andrey Vagin
avagin at openvz.org
Tue Apr 15 01:31:41 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
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 adce76a..4b93858 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 (MKKDEV(MAJOR(st.st_dev), MINOR(st.st_dev)) != 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