[CRIU] [PATCH 10/27] crtools: restore nested mount namespaces (v2)

Pavel Emelyanov xemul at parallels.com
Fri Apr 11 05:11:15 PDT 2014


On 04/10/2014 03:03 PM, Andrey Vagin wrote:

> +static struct mount_info *read_mnt_ns_img()
> +{
> +	struct mount_info *pms = NULL;
> +	struct ns_id *nsid;
> +	char *mnt_roots;
> +
> +	nsid = ns_ids;
> +	while (nsid) {
> +		if (nsid->nd != &mnt_ns_desc) {
> +			nsid = nsid->next;
> +			continue;
> +		}
> +
> +		if (nsid->id != root_item->ids->mnt_ns_id) {
> +			mnt_roots = get_mnt_roots(true);

That's the only place where get_mnt_roots() is called with true.
Can we have two calls instead -- one that gets roots and the other
one that creates, and the former one checking that roots have been
created before?

Thanks


More information about the CRIU mailing list