Commit 0241e9e2 authored by Chen Ridong's avatar Chen Ridong Committed by Tejun Heo
Browse files

cpuset: simplify node setting on error



There is no need to jump to the 'done' label upon failure, as no cleanup
is required. Return the error code directly instead.

Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
Reviewed-by: default avatarWaiman Long <longman@redhat.com>
Reviewed-by: default avatarMichal Koutný <mkoutny@suse.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 01a74355
Loading
Loading
Loading
Loading
+9 −12
Original line number Diff line number Diff line
@@ -2897,21 +2897,19 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs,
	 */
	retval = nodelist_parse(buf, trialcs->mems_allowed);
	if (retval < 0)
		goto done;
		return retval;

	if (!nodes_subset(trialcs->mems_allowed,
			  top_cpuset.mems_allowed)) {
		retval = -EINVAL;
		goto done;
	}
			  top_cpuset.mems_allowed))
		return -EINVAL;

	/* No change? nothing to do */
	if (nodes_equal(cs->mems_allowed, trialcs->mems_allowed))
		return 0;

	if (nodes_equal(cs->mems_allowed, trialcs->mems_allowed)) {
		retval = 0;		/* Too easy - nothing to do */
		goto done;
	}
	retval = validate_change(cs, trialcs);
	if (retval < 0)
		goto done;
		return retval;

	check_insane_mems_config(&trialcs->mems_allowed);

@@ -2921,8 +2919,7 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs,

	/* use trialcs->mems_allowed as a temp variable */
	update_nodemasks_hier(cs, &trialcs->mems_allowed);
done:
	return retval;
	return 0;
}

bool current_cpuset_is_being_rebound(void)