[PATCH 6/9] cgroup: make rebind_subsystems() handle file additions and removals with proper error handling

Li Zefan lizefan at huawei.com
Thu Jul 11 07:09:46 UTC 2013


> @@ -1651,26 +1647,32 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type,
>  		if (ret)
>  			goto unlock_drop;
>  
> +		sb->s_root->d_fsdata = root_cgrp;
> +		root_cgrp->dentry = sb->s_root;
> +
> +		cred = override_creds(&init_cred);
> +
> +		ret = cgroup_addrm_files(root_cgrp, NULL, cgroup_base_files, true);
> +		if (ret)
> +			goto rm_base_files;

if (ret) {
	free_cgrp_cset_links(&tmp_links);
	goto ...
}

> +
>  		ret = rebind_subsystems(root, root->subsys_mask, 0);
> -		if (ret == -EBUSY) {
> +		if (ret) {
>  			free_cgrp_cset_links(&tmp_links);
> -			goto unlock_drop;
> +			goto rm_base_files;
>  		}




More information about the Containers mailing list