[CRIU] [PATCH 10/17] dump: dump user namespaces (v2)

Cyrill Gorcunov gorcunov at gmail.com
Fri Nov 7 04:14:42 PST 2014


On Fri, Nov 07, 2014 at 03:07:08PM +0300, Andrey Vagin wrote:
> For that we need to save per-namespace mappings of user and group IDs.
> 
> And all id-s for tasks and files are saved from the target user
> namespace.
> 
> v2: move code into collect_namespaces()
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
...
> +
> +		if (len == size) {
> +			UidGidExtent *t;
> +
> +			size = size * 2 + 1;
> +			t = xrealloc(extents, size * sizeof(UidGidExtent));
> +			if (t == NULL)
> +				break;
> +			extents = t;
> +		}

Just for your info (no need to rework) -- we have xrealloc_safe helper

	if (xrealloc_safe(&extents, size * sizeof(UidGidExtent)))
		break;
	...



More information about the CRIU mailing list