[1/4] mount: don't apply superblock flags for external mounts

Submitted by Andrei Vagin on Oct. 26, 2016, 8:55 p.m.

Details

Message ID 1477515324-16187-2-git-send-email-avagin@openvz.org
State Superseded
Series "Fix a few issues to dump/restore Docker containers with userns"
Headers show

Commit Message

Andrei Vagin Oct. 26, 2016, 8:55 p.m.
From: Andrei Vagin <avagin@virtuozzo.com>

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/mount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/mount.c b/criu/mount.c
index 90b6084..6ed70ad 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -1729,7 +1729,7 @@  static int do_new_mount(struct mount_info *mi)
 		goto out;
 	}
 
-	if (remount_ro && mount(NULL, mi->mountpoint, tp->name,
+	if (!mi->is_ns_root && !mi->external && remount_ro) {
 				     MS_REMOUNT | MS_RDONLY, NULL)) {
 		pr_perror("Unable to apply mount options");
 		return -1;

Comments

Pavel Emelianov Oct. 27, 2016, 2:37 p.m.
On 10/26/2016 11:55 PM, Andrei Vagin wrote:
> From: Andrei Vagin <avagin@virtuozzo.com>
> 
> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
> ---
>  criu/mount.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/mount.c b/criu/mount.c
> index 90b6084..6ed70ad 100644
> --- a/criu/mount.c
> +++ b/criu/mount.c
> @@ -1729,7 +1729,7 @@ static int do_new_mount(struct mount_info *mi)
>  		goto out;
>  	}
>  
> -	if (remount_ro && mount(NULL, mi->mountpoint, tp->name,
> +	if (!mi->is_ns_root && !mi->external && remount_ro) {
>  				     MS_REMOUNT | MS_RDONLY, NULL)) {

This won't even compile %)

>  		pr_perror("Unable to apply mount options");
>  		return -1;
>
Andrey Vagin Oct. 27, 2016, 5:45 p.m.
On Thu, Oct 27, 2016 at 05:37:14PM +0300, Pavel Emelyanov wrote:
> On 10/26/2016 11:55 PM, Andrei Vagin wrote:
> > From: Andrei Vagin <avagin@virtuozzo.com>
> > 
> > Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
> > ---
> >  criu/mount.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/criu/mount.c b/criu/mount.c
> > index 90b6084..6ed70ad 100644
> > --- a/criu/mount.c
> > +++ b/criu/mount.c
> > @@ -1729,7 +1729,7 @@ static int do_new_mount(struct mount_info *mi)
> >  		goto out;
> >  	}
> >  
> > -	if (remount_ro && mount(NULL, mi->mountpoint, tp->name,
> > +	if (!mi->is_ns_root && !mi->external && remount_ro) {
> >  				     MS_REMOUNT | MS_RDONLY, NULL)) {
> 
> This won't even compile %)

It is fixed in 3/4 ;). Will resend

> 
> >  		pr_perror("Unable to apply mount options");
> >  		return -1;
> > 
>