Re: [PATCH v1 2/3] cgroup: allow for unprivileged subtree management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, Aleksa.

On Tue, Jul 19, 2016 at 02:18:15AM +1000, Aleksa Sarai wrote:
> +static int cgroup_permission(struct inode *inode, struct kernfs_node *kn,
> +			     int mask)
> +{
> +	int ret;
> +	struct cgroup *cgroup;
> +	struct cgroup_namespace *cgroupns;
> +
> +	/*
> +	 * First, compute the generic_permission return value. In most cases
> +	 * this will succeed and we can also avoid duplicating this code.
> +	 */
> +
> +	cgroup = kn->priv;
> +	cgroup_get(cgroup);

This pattern which is repated for cgroupns doesn't make sense.  The
code is already assuming that the cgroup is safe to deref.  Getting
its reference doesn't do anything.  Getting it here would only make
sense if the pointer is passed to an asynchronous context.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux