[CRIU] [PATCH 2/2] mount: take into account btrfs workaround for converting st_dev to phys_dev

Andrew Vagin avagin at openvz.org
Thu Apr 17 04:04:01 PDT 2014


BTRFS returns subvolume dev-id instead of superblock dev-id

Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 mount.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mount.c b/mount.c
index cddaf7f..eb2e982 100644
--- a/mount.c
+++ b/mount.c
@@ -469,6 +469,7 @@ static struct mount_info *mnt_build_tree(struct mount_info *list)
  */
 static int __open_mountpoint(struct mount_info *pm, int mnt_fd)
 {
+	dev_t dev;
 	struct stat st;
 	int ret;
 
@@ -490,9 +491,10 @@ static int __open_mountpoint(struct mount_info *pm, int mnt_fd)
 		goto err;
 	}
 
-	if (st.st_dev != kdev_to_odev(pm->s_dev)) {
+	dev = phys_stat_resolve_dev(st.st_dev, pm->mountpoint + 1);
+	if (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);
+				pm->s_dev, (int)dev, pm->fstype->name, pm->mountpoint);
 		goto err;
 	}
 
-- 
1.9.0



More information about the CRIU mailing list