[CRIU] [PATCH] mnt: Carry run-time device ID in mount_info

Cyrill Gorcunov gorcunov at gmail.com
Thu Dec 3 05:31:55 PST 2015


On Thu, Dec 03, 2015 at 03:48:08PM +0300, Pavel Emelyanov wrote:
> > 
> > How is that? There is two points where @s_dev and @s_dev_rt are
> > assigned
> > 
> > 1) When we parse procfs => @s_dev = @s_dev_rt always
> > 2) When we do mount the device and fetch new run-time @s_dev_rt
> >    from the stat call, so I really don't see how coincide may happen/
> 
> Consider you restore two mountpoints that have devices 1.11 and 2.22 in 
> the images. When you mount them they get 2.22 and 3.33 devices respectively.
> 
> Now you try to open the 2nd mountpoint, but due to the BUG() in criu code
> you effectively open the 1st one. So with your patch you will compare
> 
> 	if (opened_dev != 2.22 and opened_dev != 3.33)
> 		goto error.
> 
> and will NOT detect this error, but should.

So we have to test @s_dev_rt only, right?

> 
> >>
> >> This stat() should in in do_mount_one() after the 
> > 
> > Why? Every mount point created go through restore_shared_options, don't they?
> 
> Yes, but it's quite strange that a routine that has to restore shared options
> (that's its name) suddenly picks up the device maj:min pair.

I see. OK, will do. You know, while it looks indeed a bit strange in lexical
context it allows me to made code simplier ;)


More information about the CRIU mailing list