Call it on mount points validation and abort in case NFS is overmounted.
This patch also adds nfs_mount helper, which fixes the issue with skipping
this check for NFSv4 mount point.

Signed-off-by: Stanislav Kinsburskiy <skinsbur...@virtuozzo.com>
---
 criu/mount.c |   23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/criu/mount.c b/criu/mount.c
index 942515e..667b279 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -739,6 +739,25 @@ static bool mnt_is_external(struct mount_info *m)
        return 0;
 }
 
+static bool nfs_mount(const struct mount_info *m)
+{
+       return !strcmp(m->fstype->name, "nfs") ||
+              !strcmp(m->fstype->name, "nfs4");
+
+}
+
+static bool unsupported_mount(const struct mount_info *m)
+{
+       struct mount_info *parent = m->parent;
+
+       if (parent && nfs_mount(parent)) {
+               pr_err("overmounted NFS (%s) is not supported yet:\n",
+                               parent->mountpoint);
+               return true;
+       }
+       return false;
+}
+
 static int validate_mounts(struct mount_info *info, bool for_dump)
 {
        struct mount_info *m, *t;
@@ -810,10 +829,8 @@ skip_fstype:
                        return -1;
                }
 
-               if (!strcmp(m->fstype->name, "nfs") && 
!list_empty(&m->children)) {
-                       pr_err("overmounted NFS (%s) is not supported yet\n", 
m->mountpoint);
+               if (unsupported_mount(m))
                        return -1;
-               }
        }
 
        return 0;

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to