From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A52A1C43334 for ; Tue, 28 Jun 2022 00:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241489AbiF1Ao4 (ORCPT ); Mon, 27 Jun 2022 20:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240124AbiF1Aox (ORCPT ); Mon, 27 Jun 2022 20:44:53 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726F7DF21; Mon, 27 Jun 2022 17:44:45 -0700 (PDT) Date: Mon, 27 Jun 2022 17:44:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1656377082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BJKVsQcWiOvVBIN6ILcbyfHw9khWxf41DSkNpqOzqMc=; b=ekLEYclUAddgPYXUB6/jK1M8WfV2S0/heY/TFpzAhtwr3G+vhsRzcHjs9s+ifHpSzWUAqL jr4/DX/9M4qhweBKLppSaFBWG5fa2YfNHNnQHouWd9QaAgcvuzQ23Gjt7a5lnJ0n8AFDGE E0SFxI5Vz0fibcZLH5Jsrvu8APe9lyY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Vasily Averin Cc: Shakeel Butt , Michal =?iso-8859-1?Q?Koutn=FD?= , Michal Hocko , Tejun Heo , Zefan Li , Johannes Weiner , kernel@openvz.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Vlastimil Babka , Muchun Song , cgroups@vger.kernel.org Subject: Re: [PATCH cgroup] cgroup: set the correct return code if hierarchy limits are reached Message-ID: References: <186d5b5b-a082-3814-9963-bf57dfe08511@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 27, 2022 at 05:12:55AM +0300, Vasily Averin wrote: > When cgroup_mkdir reaches the limits of the cgroup hierarchy, it should > not return -EAGAIN, but instead react similarly to reaching the global > limit. > > Signed-off-by: Vasily Averin > --- > kernel/cgroup/cgroup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c > index 1be0f81fe8e1..243239553ea3 100644 > --- a/kernel/cgroup/cgroup.c > +++ b/kernel/cgroup/cgroup.c > @@ -5495,7 +5495,7 @@ int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name, umode_t mode) > return -ENODEV; > > if (!cgroup_check_hierarchy_limits(parent)) { > - ret = -EAGAIN; > + ret = -ENOSPC; I'd not argue whether ENOSPC is better or worse here, but I don't think we need to change it now. It's been in this state for a long time and is a part of ABI. EAGAIN is pretty unique as a mkdir() result, so systemd can handle it well. Thanks!