Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3487622iog; Mon, 27 Jun 2022 17:46:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vRo150Obd0+bJvP3b0t+QqhtLkfOm81+qOysicG6YG36+m8D159HrWejf8iTZE619VuxhP X-Received: by 2002:a17:90b:1d84:b0:1ed:5918:74e3 with SMTP id pf4-20020a17090b1d8400b001ed591874e3mr12132457pjb.173.1656377199036; Mon, 27 Jun 2022 17:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656377199; cv=none; d=google.com; s=arc-20160816; b=Q9+5RtOkVQuPXNPBnDlT5CX1+Tqsed0piB4HZUt50pokvwCO6j1skFKjzPYe0vlf+F TPx75gpjz/4FKGmxZ/3sdQrw1/z/b08DGkxyCeJFvvLSQMO2sZfpDQIVUUrJ2q/NGnsM 0VqgNK1rdikoyJg5BluZMsmjWLIdXGmWMlwrb640f1fXX+xYYHTIll/JqZnOEbrmaR1X 49rTp/B3tYR2CyO22UY10lQy1k4rKRh3u7KvzQU6nhOhdpBSGzToCDVbqeXk7Pu7Gqpw gUFkwUG0i5Bxmp5Wd+d0cIeMJWjT0q+FvXJiMhWMR7qkJuSfIpbQ9bp7/ZyiD9DOGaJT qn2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=BJKVsQcWiOvVBIN6ILcbyfHw9khWxf41DSkNpqOzqMc=; b=iemVdgXDXCU7/mHSI1tngUb6R3hijzXJNGZkPf4+eGayYJBJD+1r6aKwsnxSeT8loz WpSEnXIb1tdla3qtXTWSyHSkwmJk+5ePL34M7pSBUdIMIF/kzwVWlcMjwQUnFjwX/jBY iC8JdJNpGMH94hMFg3WEJ7cn5WucuZ5iJMrOonbsPLfFXwg/iGmRIQnt7OdQOrkomf4a nIA48/hg+Bzc4/E8hqZ8sAY6tvFqOs95XIOY9iMJYLCd9v+QJi84KxGfH9pXgiI9oVbB FGbnc0OpjFmwkZpAlvtjaJcc6uWcIgqcHTlsGDrHnHUVSsJg5bf/QID1CXKXOJauhNro eiEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ekLEYclU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jc14-20020a17090325ce00b0016a1ef12851si14818462plb.611.2022.06.27.17.46.25; Mon, 27 Jun 2022 17:46:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ekLEYclU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241995AbiF1Aoz (ORCPT + 99 others); Mon, 27 Jun 2022 20:44:55 -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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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!