[CRIU] Re: [PATCH cr] dump: handle overmounted devices

Pavel Emelyanov xemul at parallels.com
Mon Aug 6 10:39:19 EDT 2012


On 08/06/2012 04:52 PM, Andrey Vagin wrote:
> 
> "init" in LXC opens /dev/null and then mounts devtmpfs in /dev,
> so crtools can not resolve the path to the origin /dev/null.
> 
> crtools with the option --evasive-device will check the origin
> device and a new device are the same and if it's true, crtools will
> dump a new path.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  crtools.c         |    4 ++++
>  files-reg.c       |    4 ++++
>  include/crtools.h |    1 +
>  test/zdtm.sh      |    2 +-
>  4 files changed, 10 insertions(+), 1 deletions(-)
> 

> @@ -289,6 +289,10 @@ static int check_path_remap(char *rpath, const struct stat *ost, int lfd, u32 id
>  		 * FIXME linked file, but the name we see it by is reused
>  		 * by somebody else.
>  		 */
> +		if (opts.evasive_device &&
> +		    (S_ISCHR(ost->st_mode) || S_ISBLK(ost->st_mode)))
> +			if (pst.st_rdev == ost->st_rdev)
> +				return 0;
>  		pr_err("Unaccessible path opened %u:%u, need %u:%u\n",
>  				(int)pst.st_dev, (int)pst.st_ino,
>  				(int)ost->st_dev, (int)ost->st_ino);

Write it in one if statement.

> @@ -86,6 +86,7 @@ int main(int argc, char *argv[])
>  			{ "close", required_argument, 0, 43 },
>  			{ "log-pid", no_argument, 0, 44},
>  			{ "version", no_argument, 0, 'V'},
> +			{ "evasive-device", no_argument, 0, 45},
>  			{ },
>  		};
>  

Document it at least in the --help output.


More information about the CRIU mailing list