[Devel] mounts: support NFS bind-mounts in the same shared group

Submitted by Stanislav Kinsburskiy on July 19, 2017, 7:43 a.m.

Details

Message ID 20170719074320.69107.88029.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "mounts: support NFS bind-mounts in the same shared group"
Headers show

Commit Message

Stanislav Kinsburskiy July 19, 2017, 7:43 a.m.
Initial patch was supporting only slave mounts as bind-mounts.

https://jira.sw.ru/browse/PSBM-68663

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 criu/mount.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/mount.c b/criu/mount.c
index 3abdb6e..7ed5d6e 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -768,11 +768,14 @@  static bool unsupported_nfs_bindmounts(const struct mount_info *m)
 	const struct mount_info *bm;
 
 	list_for_each_entry(bm, &m->mnt_bind, mnt_bind) {
-		if (bm->shared_id != m->master_id) {
-			pr_err("Bind-mount %s has another shared "
-					"group, than %s: %d != %d\n",
-					bm->mountpoint, m->mountpoint,
-					bm->shared_id, m->master_id);
+		if ((bm->shared_id != m->master_id) &&
+		    (bm->shared_id != m->shared_id)) {
+			pr_err("NFS bind-mount %s (id %d) has another shared "
+				"group, than %s (id %d): %d != %d (!= %d)\n",
+				bm->mountpoint, bm->mnt_id,
+				m->mountpoint, m->mnt_id,
+				bm->shared_id, m->master_id,
+				m->shared_id);
 			return true;
 		}
 		if (unsupported_nfs_mount(bm))

Comments

Andrey Vagin July 24, 2017, 4:32 p.m.
On Wed, Jul 19, 2017 at 10:43:26AM +0300, Stanislav Kinsburskiy wrote:
> Initial patch was supporting only slave mounts as bind-mounts.
> 
> https://jira.sw.ru/browse/PSBM-68663
>

Reviewed-by: Andrei Vagin <avagin@virtuozzo.com>
 
> Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
> ---
>  criu/mount.c |   13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/criu/mount.c b/criu/mount.c
> index 3abdb6e..7ed5d6e 100644
> --- a/criu/mount.c
> +++ b/criu/mount.c
> @@ -768,11 +768,14 @@ static bool unsupported_nfs_bindmounts(const struct mount_info *m)
>  	const struct mount_info *bm;
>  
>  	list_for_each_entry(bm, &m->mnt_bind, mnt_bind) {
> -		if (bm->shared_id != m->master_id) {
> -			pr_err("Bind-mount %s has another shared "
> -					"group, than %s: %d != %d\n",
> -					bm->mountpoint, m->mountpoint,
> -					bm->shared_id, m->master_id);
> +		if ((bm->shared_id != m->master_id) &&
> +		    (bm->shared_id != m->shared_id)) {
> +			pr_err("NFS bind-mount %s (id %d) has another shared "
> +				"group, than %s (id %d): %d != %d (!= %d)\n",
> +				bm->mountpoint, bm->mnt_id,
> +				m->mountpoint, m->mnt_id,
> +				bm->shared_id, m->master_id,
> +				m->shared_id);
>  			return true;
>  		}
>  		if (unsupported_nfs_mount(bm))
> 
> _______________________________________________
> Devel mailing list
> Devel@openvz.org
> https://lists.openvz.org/mailman/listinfo/devel