From patchwork Tue Feb 12 18:48:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 10808565 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 BBAD11390 for ; Tue, 12 Feb 2019 18:48:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC5B62C15A for ; Tue, 12 Feb 2019 18:48:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0C632C1AE; Tue, 12 Feb 2019 18:48:43 +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 00C6A2C185 for ; Tue, 12 Feb 2019 18:48:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730586AbfBLSsi (ORCPT ); Tue, 12 Feb 2019 13:48:38 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:45761 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732142AbfBLSsW (ORCPT ); Tue, 12 Feb 2019 13:48:22 -0500 Received: by mail-pl1-f195.google.com with SMTP id r14so1701318pls.12; Tue, 12 Feb 2019 10:48:22 -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 :mime-version:content-transfer-encoding; bh=EXXdq7GrYAICjYexP9jF/A5d/mueQ96ws92MW4tT5O4=; b=LQpG3etk7MTKXkfQSPMgt1GsnnOOJYCT94TODTqM2M4NDx7aIxlM1gAMAGiH2LBzkK NsRzL1/yNTTUICGEVjV5WPrLB+lyt/3CIefoAEWj5uyYfaYJ0ifBO/3LHtyzQtZGj4OJ gkjtVGi1ypGgB81f/5pHoPT5OFe77VWTI2QSlF0ZMCXvXMmHq36ciHy7f0Yh+e0tveoe XDPch2lyiJKH5xe/oQcdyVzCxF5/izdKBGpK+blGJmNJNgp8kOWczhtjfnc/Xnb/7l0q 8MtaUhoRHjMPgW8tfeTeulUr68IHzq0NoJ496q8NQk/IDPxLha0Y2VDeACSRbftDPECt vCgA== 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:mime-version:content-transfer-encoding; bh=EXXdq7GrYAICjYexP9jF/A5d/mueQ96ws92MW4tT5O4=; b=BufwefrxlPgNroho/BFCuE6qzhQXCWikjHDzzfhLKfSN2R4MuCr8E8Gau19NngIZzg GJixwg0Y7xftBAUKy8jmnse3Kwc7TzlnopSoeSnheGeOHf2yGTtBJ3iqDFETShkDEP8x dyaPXYDv/4MzryTez24yovp1KOOAdNdd2l+YPEJPCf60Qn1vkUX9ktWyGYcwL1A5/+w2 48xKrREfBWdFxNARwmDw4+PkSOR3u2Zek5+hbe/P3NgoIU+rg3QzUkHfJrfpKz6XDT4M sVgICXl+XS6rnCRq6PmEmFzCmuyk6gn04Hk8NHFVWp6P88ChIR0tkABo575a4n8jYU7F i4wg== X-Gm-Message-State: AHQUAuaui0r4rRN+qpNQFVbolC+P5X7ICq2YfXUCUoSjw2jlhRnnSTES swPkOh+F1p+TDhA+2Oi3V/8= X-Google-Smtp-Source: AHgI3IZxkt6SYUcEuE4t9K530eIUitBSZkQRxyk2p9QQ2vbSllLsI6oRn4HG60y7V1ipU1VTYDetpQ== X-Received: by 2002:a17:902:241:: with SMTP id 59mr5328309plc.72.1549997302410; Tue, 12 Feb 2019 10:48:22 -0800 (PST) Received: from tower.thefacebook.com ([2620:10d:c090:200::5:4d62]) by smtp.gmail.com with ESMTPSA id f67sm25480102pfc.141.2019.02.12.10.48.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Feb 2019 10:48:21 -0800 (PST) From: Roman Gushchin X-Google-Original-From: Roman Gushchin To: Tejun Heo , Oleg Nesterov Cc: kernel-team@fb.com, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Roman Gushchin , Shuah Khan , linux-kselftest@vger.kernel.org Subject: [PATCH v7 5/7] kselftests: cgroup: don't fail on cg_kill_all() error in cg_destroy() Date: Tue, 12 Feb 2019 10:48:05 -0800 Message-Id: <20190212184807.20304-6-guro@fb.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190212184807.20304-1-guro@fb.com> References: <20190212184807.20304-1-guro@fb.com> MIME-Version: 1.0 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; }