From patchwork Tue Apr 9 05:18:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13621833 X-Patchwork-Delegate: bpf@iogearbox.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F97A5465D; Tue, 9 Apr 2024 05:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712639947; cv=none; b=Va3107CZrwtNROIwQz59Z1jmQ+cIC95vLBrlIOha+8ziuhlEqhEpYiK8c+Q9VeLHWu9gTxn10N5Jvmi6pRFFMwtTvtN5Mh4MnhpVPUoNj980PezwRpD9e63WfUj2o2N/pOR17gF7BGj3ue6y6tjKLKbkxglHvFWHssfcErfOjr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712639947; c=relaxed/simple; bh=pxtZsQzsrFzTf5hlamv+xZaGazrmSilttmcacnT6NkQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=i8Spt6WpOxYTM+xp9ZJLlW3WrmV4Kys/hHQS7vSmG9TxiwzuxkPMmrCyZoSOzrg+l0yiBc2DnKg5lT0Os0sqtjGtwrkgDJLR7ien9mtnKyqnPVNxqlMsWACrO4JGngXdUbMnOn3CrW0toGKtYw+gnJlu7570aqDthcX3oHbJZ5M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CNqFhXWH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CNqFhXWH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71374C433F1; Tue, 9 Apr 2024 05:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712639947; bh=pxtZsQzsrFzTf5hlamv+xZaGazrmSilttmcacnT6NkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CNqFhXWHcThphlUaFiLOACWSYdyY/O3mAFTiFvchziiZUCtU59aIrpFxIGPaqYBl4 g/WEouSe3d363UOYNY9czK4dz01zfYYcODBITK4Ur4zyjA7cnjCejOWxFFSx8taAtg LvtGt7nMnWlsJxq6bshcDbckkU+GLFJ1l89CqCzCX1ydajV2zdHIpq5oTK8EFmmdC6 tbR/Gj0Q7Bg+VHm+38tz+HNWg8h4mOFrxWre1PPk8UT0JqJgwyI0wGwPXMLOqO65a9 ttZZPyGuvHF9E0FTmycINdKHpBlNahRD87HI7qqUcIYTWrjpdPZwUGGAuS0XlDbRPV 41pYmTRe9gTfw== From: Geliang Tang To: Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , Jakub Sitnicki Cc: Geliang Tang , bpf@vger.kernel.org, mptcp@lists.linux.dev Subject: [PATCH bpf v4 2/2] selftests/bpf: Fix umount cgroup2 error in test_sockmap Date: Tue, 9 Apr 2024 13:18:40 +0800 Message-Id: <0399983bde729708773416b8488bac2cd5e022b8.1712639568.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net From: Geliang Tang This patch fixes the following "umount cgroup2" error in test_sockmap.c: (cgroup_helpers.c:353: errno: Device or resource busy) umount cgroup2 Cgroup fd cg_fd should be closed before cleanup_cgroup_environment(). Fixes: 13a5f3ffd202 ("bpf: Selftests, sockmap test prog run without setting cgroup") Signed-off-by: Geliang Tang Acked-by: Yonghong Song --- tools/testing/selftests/bpf/test_sockmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index 4feed253fca2..efb4f34bf703 100644 --- a/tools/testing/selftests/bpf/test_sockmap.c +++ b/tools/testing/selftests/bpf/test_sockmap.c @@ -2107,9 +2107,9 @@ int main(int argc, char **argv) free(options.whitelist); if (options.blacklist) free(options.blacklist); + close(cg_fd); if (cg_created) cleanup_cgroup_environment(); - close(cg_fd); return err; }