Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2542354iog; Sun, 26 Jun 2022 19:32:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uUdVWl9F9omCOBVNcBIEQbdNxXy2Q+PZIeHAiBEToee4naOdD9bBgA0udew/MOEYv0hxfL X-Received: by 2002:a17:90b:4d12:b0:1ed:3124:3ecf with SMTP id mw18-20020a17090b4d1200b001ed31243ecfmr15696576pjb.111.1656297145147; Sun, 26 Jun 2022 19:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656297145; cv=none; d=google.com; s=arc-20160816; b=MOIb/+1mDXtuR+Xw8B1AcI1TTS0v+fwVTUNjsraQWdM4H4lYTw3cvSMpwK8cUuRMET KuVJ58wr0t/xoRN5zeEF450J5N1zfYkfELoo4RhNddr+cDsdHGSTlwLwdHKT6Ivx6aar aVCqFI5wiyrw1LjyfjTM7SZQLyqMQ03sGRQFNEvLNyFuSYFbO4MVVs9zAPNbinvliqJF o6iStI6o0XcbWnIOps1TikFFp+T5CmROHfnWfFYI81KYx72Sv8NDYSSNxB4s/vyRYUab i8iCvjeADFvrLDGDwErCU7SXzvyItn4X9Hvj5HcY9vvxAQIkBGCYpbX+ICWUKs2b/IXK UH7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature; bh=J1m6KgphNIic/L8WHuZiss6XcSSiZCMzYR1UJoO0HMc=; b=eiHIwtQiSFKLU6vkC+QMT5JeCYk294hmYciF99BaTK6LOaGJHOyqvykQU7/ufM/RID j/U0b2XA8tm7WaTBIiEtQoAvk2u+F/oIyXMZHWyNVWVkbNWWmcrmKX5dOxdKXQOI20/1 IuXDUpWRZc5UBx9Rx7ovjvPR5AYmThRVWX9kGSk1pSPtgwyB4kCt2K4rTZ4Q1rzNCz60 WNPiQb7AbMKCppw73lNZzTP/vJhTpRjplIL2pIKiPdDbIBQiY7vhxyNer/sF1twxvd6k KcqO4Y7tHme/WjfTHYPUn8zPlxLLpQM0TRoz3A02YCBL795Dt3tDB3bRoxzxAcHZ089N 3AUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=Kxte3o58; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cx19-20020a17090afd9300b001ed05a3f1ecsi11355461pjb.177.2022.06.26.19.32.13; Sun, 26 Jun 2022 19:32:25 -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=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=Kxte3o58; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231390AbiF0CNA (ORCPT + 99 others); Sun, 26 Jun 2022 22:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231314AbiF0CM7 (ORCPT ); Sun, 26 Jun 2022 22:12:59 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F9FE26DA for ; Sun, 26 Jun 2022 19:12:58 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id w20so14133674lfa.11 for ; Sun, 26 Jun 2022 19:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=J1m6KgphNIic/L8WHuZiss6XcSSiZCMzYR1UJoO0HMc=; b=Kxte3o580Pu1piGMd/tMaeKLcaYVnazjes2jkA1MeRbEVwuAjE11CCbYmYRlNLpsTw ouDSlFLtVKYo+Ypvn/e4PTGdQBuBZSF8EMqVPtqqJKVIpYXcBsUFENRymu17f8RNCuqY Pm/82bhd295KDLa0ilJFqdTMh4JkoC+poaMfMlNN2V80LjCvpchBMl+H7N8FrRyJPJh+ nTSBgMNVuORpGb3zfKVzKxBUE8bd8rfxtdIgZUi1lUKL4fUx6ppsM0QVQldCU+CnZYsd ZJteSZJMdcqSyoMY+ubnkpFtWTm+0VbsbNradd5tM5mDISvt1wyV+NF6yVISG4BfRLXj XbrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=J1m6KgphNIic/L8WHuZiss6XcSSiZCMzYR1UJoO0HMc=; b=UW39K9EO8Tw+YlP9xECNc2USvCzDRIYkGOJs7vMlPqwWSzg3eFHLXfRwHxoeJ2m9bx dF1Mp56kz02jniFsMtl6+mrArNu5WzQ6QGUOenbgfngSmHGSU1qlpv6Fmg0Z8+9xbaSc mkGDHxFfnXEjoZgBiq0l9iRR6zeoCAGvTRPifQEJHGVBveaQEBq/GFRRt5WFfI/62utY zxVxroarUYGXqUAwjYjdMxiMOwpoyYzyz7ETKfAnbCnvTIenMXUFAFE/YmqPD5Coz23+ 6HeL7yrUBhIAT8JsCFIJO07+fXxC4cHSGCnfl03l4gFJrs6MdKJ9sw/8Bl5cuFsIbmzG kMYw== X-Gm-Message-State: AJIora+yX5S1rnzNsQSpNHWiwADKE0n7COkIZo9UxjTGZfpNW5qrZGHV 4a/fw/aCXaIbi+YrOofzLwLWOg== X-Received: by 2002:a05:6512:1288:b0:47f:b7a6:221d with SMTP id u8-20020a056512128800b0047fb7a6221dmr7602818lfs.236.1656295976649; Sun, 26 Jun 2022 19:12:56 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.129]) by smtp.gmail.com with ESMTPSA id g20-20020a2ea4b4000000b002554f044e1asm1206501ljm.116.2022.06.26.19.12.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Jun 2022 19:12:56 -0700 (PDT) Message-ID: Date: Mon, 27 Jun 2022 05:12:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 From: Vasily Averin Subject: [PATCH cgroup] cgroup: set the correct return code if hierarchy limits are reached To: Shakeel Butt , Roman Gushchin , =?UTF-8?Q?Michal_Koutn=c3=bd?= , Michal Hocko , Tejun Heo , Zefan Li , Johannes Weiner Cc: kernel@openvz.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Vlastimil Babka , Muchun Song , cgroups@vger.kernel.org References: <186d5b5b-a082-3814-9963-bf57dfe08511@openvz.org> Content-Language: en-US In-Reply-To: <186d5b5b-a082-3814-9963-bf57dfe08511@openvz.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 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; goto out_unlock; } -- 2.36.1