From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 EEB8F4F5E0; Wed, 20 May 2026 18:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779300579; cv=none; b=Kd5mRhb6m/esZkhTyfcoKg8xDMIe2mSspFj3UT3M2YeLCw30ZTlLLqwWcxokpfdvF2gRHUwpGr2sGz6RyPDMwyge+s5DV4lYcUPJs8PGaGpmb0TvrcR3JJj6gXqwrV7ADo6tYRUZnMT5desmlaGXu7ZdRdU/JlV7sa6KAyiwJP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779300579; c=relaxed/simple; bh=nJlLQsHnczZUK7EK3um/T9/Ow6yr7efVyzxb75z3T7Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AXXTu3MKprmWMYHO/56MSMO/hkFNcnPk61tJtfIoe4K/QFnuFjvfN37vaP41GUqdnrTw1QktFCR0PbmPiMPVOKEiU3h1rs1t9WbHkNu1+EGy7A4AXXg12DT2V7BSL02GyXBcmJ/ZNxDclvcfGZKpn1plc1aAOyaEdFg94UmFAzI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kjOAF+og; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kjOAF+og" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 659F31F000E9; Wed, 20 May 2026 18:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779300577; bh=DlLrBk6IiP4BdbpSe3o2GYl36nrmnJJfQc2GPGAV3Jo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kjOAF+ogWFFE9lu9fUXuT5fpzr1yVkGttDYc0KQsEnZhWKGIW1eT1ByBpPn11BDqK x0XobFR2iztceuffIDL46i7ncKcWH+PnDpzwko22shZalUMyQF+ZYz7BMYR7S23oVP sdgcFy3gHz1WTTkj7UUXsMXnVS1cr3lt6bedzc8U= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Waiman Long , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Shakeel Butt , Johannes Weiner , Michal Hocko , Mike Rapoport , Muchun Song , Roman Gushchin , Shuah Khan , Tejun Heo , Andrew Morton , Sasha Levin Subject: [PATCH 6.12 228/666] selftest: memcg: skip memcg_sock test if address family not supported Date: Wed, 20 May 2026 18:17:19 +0200 Message-ID: <20260520162116.155009886@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162111.222830634@linuxfoundation.org> References: <20260520162111.222830634@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Waiman Long [ Upstream commit 2d028f3e4bbbfd448928a8d3d2814b0b04c214f4 ] The test_memcg_sock test in memcontrol.c sets up an IPv6 socket and send data over it to consume memory and verify that memory.stat.sock and memory.current values are close. On systems where IPv6 isn't enabled or not configured to support SOCK_STREAM, the test_memcg_sock test always fails. When the socket() call fails, there is no way we can test the memory consumption and verify the above claim. I believe it is better to just skip the test in this case instead of reporting a test failure hinting that there may be something wrong with the memcg code. Link: https://lkml.kernel.org/r/20260311200526.885899-1-longman@redhat.com Fixes: 5f8f019380b8 ("selftests: cgroup/memcontrol: add basic test for socket accounting") Signed-off-by: Waiman Long Acked-by: Michal Koutný Acked-by: Shakeel Butt Cc: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Mike Rapoport Cc: Muchun Song Cc: Roman Gushchin Cc: Shuah Khan Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- tools/testing/selftests/cgroup/test_memcontrol.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c index 16f5d74ae762e..7a44d221b8c4b 100644 --- a/tools/testing/selftests/cgroup/test_memcontrol.c +++ b/tools/testing/selftests/cgroup/test_memcontrol.c @@ -1190,8 +1190,11 @@ static int tcp_server(const char *cgroup, void *arg) saddr.sin6_port = htons(srv_args->port); sk = socket(AF_INET6, SOCK_STREAM, 0); - if (sk < 0) + if (sk < 0) { + /* Pass back errno to the ctl_fd */ + write(ctl_fd, &errno, sizeof(errno)); return ret; + } if (setsockopt(sk, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) goto cleanup; @@ -1321,6 +1324,12 @@ static int test_memcg_sock(const char *root) goto cleanup; close(args.ctl[0]); + /* Skip if address family not supported by protocol */ + if (err == EAFNOSUPPORT) { + ret = KSFT_SKIP; + goto cleanup; + } + if (!err) break; if (err != EADDRINUSE) -- 2.53.0