From patchwork Fri Dec 7 20:15:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 10718811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9E8113BF for ; Fri, 7 Dec 2018 20:16:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7CCA2AB84 for ; Fri, 7 Dec 2018 20:16:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBEB42AC1E; Fri, 7 Dec 2018 20:16:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77A3E2AB84 for ; Fri, 7 Dec 2018 20:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726365AbeLGUPm (ORCPT ); Fri, 7 Dec 2018 15:15:42 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40903 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbeLGUPl (ORCPT ); Fri, 7 Dec 2018 15:15:41 -0500 Received: by mail-pf1-f196.google.com with SMTP id i12so2437767pfo.7; Fri, 07 Dec 2018 12:15:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oiVWgL/WHUTd0gentorRc6DDTrlDET1vasHz44Fkvas=; b=Tl6AQp5NBS+Vty8MRgicYJ/jVsKR0CryNf5wkhgDTDviSmtB5Wz5KcTOni7EQWYiOH M7G/A/ahbj0zI4CX/oWxaTi3eJ6MDEIHpJoed0IEfumnekz0XOS5c/X94GXsjpeRxgu+ l2CL4eRuaWgoJimP0SL5rSZ5XqAxlywguM+C8fB+TRPnFh7lzKNozNYlW0wRdQBzUa/a ao6SOAXWMayp5gxtmPSMC71qWuSZw4ETGeggMgxoH2KE8z3aAC0/mT4J9+OJA3FOHaru l5GNQdJ37yTs4EbHlaXxMHzY7kffSwszM0uq23KIDYpnEAM7yJecJW8OXtILW++JSxuo zwQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oiVWgL/WHUTd0gentorRc6DDTrlDET1vasHz44Fkvas=; b=B1U9JjQEq6+sMMcLcb8vzVAT6YRoR810hN8Gw3T5Y+GICcwfjHv2waip1foTnzvrzy tuDjARzfxpWXE9OjZCv9nTQbbfuH2mPEAOi3uY2RRbzGbQwEfEyce4H1hbRzuFTeUuCv pyEZnh2G1LU2+oON2B5QVsimR/fEH7ytoxVr89y13gCrHZpK9YQHgZeMsBF+b3YDeU2H zSdwz631ZJc9apFcRpfToel9uQHWs3t24vPOF4rWbuRunooGhXEaX57fC+h3aowLvNfT gSy+5tm3LiWTjapdDPSI9lgbwVBinbOaXFlKDKKidCbDuXkek7KQ27QcUprzzoljwxwX tFfA== X-Gm-Message-State: AA+aEWZEi8V1rpqZUATGfW8Q6b5Shxo8QZci5h23Pw4ouLbpFN4Z/01X jS9zr2EtRXhTNAxhd+Ap66w= X-Google-Smtp-Source: AFSGD/W5GF7l5xue5w7Lkrut0LyE2fg5jVo/CiU87iJyb7jzaQvHLrVInJWKnL5WvqjQBRBvOaQdpA== X-Received: by 2002:a63:26c1:: with SMTP id m184mr2951411pgm.367.1544213740629; Fri, 07 Dec 2018 12:15:40 -0800 (PST) Received: from castle.thefacebook.com ([2620:10d:c090:200::6:d83b]) by smtp.gmail.com with ESMTPSA id q75sm5870898pfa.38.2018.12.07.12.15.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Dec 2018 12:15:39 -0800 (PST) From: Roman Gushchin X-Google-Original-From: Roman Gushchin To: Tejun Heo , Oleg Nesterov Cc: Dan Carpenter , Mike Rapoport , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Roman Gushchin , Shuah Khan , linux-kselftest@vger.kernel.org Subject: [PATCH v5 5/7] kselftests: cgroup: don't fail on cg_kill_all() error in cg_destroy() Date: Fri, 7 Dec 2018 12:15:29 -0800 Message-Id: <20181207201531.1665-6-guro@fb.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181207201531.1665-1-guro@fb.com> References: <20181207201531.1665-1-guro@fb.com> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the cgroup destruction races with an exit() of a belonging process(es), cg_kill_all() may fail. It's not a good reason to make cg_destroy() fail and leave the cgroup in place, potentially causing next test runs to fail. Signed-off-by: Roman Gushchin Cc: Shuah Khan Cc: Tejun Heo Cc: kernel-team@fb.com Cc: linux-kselftest@vger.kernel.org --- tools/testing/selftests/cgroup/cgroup_util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c index 14c9fe284806..eba06f94433b 100644 --- a/tools/testing/selftests/cgroup/cgroup_util.c +++ b/tools/testing/selftests/cgroup/cgroup_util.c @@ -227,9 +227,7 @@ int cg_destroy(const char *cgroup) retry: ret = rmdir(cgroup); if (ret && errno == EBUSY) { - ret = cg_killall(cgroup); - if (ret) - return ret; + cg_killall(cgroup); usleep(100); goto retry; }