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 317ED3148DA; Sat, 30 May 2026 17:12:34 +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=1780161155; cv=none; b=Bp/dIHLjgpnfBeDWwYp+01a3K157Nk5Nut+lfJblnuwgngetG8y5uO96VGoUbc0cp6WFqxNN+QSJC1FtQl3g/dv/9t8eQQEyc8mqCd78e0erlqLpJwWhOirfXxZlggN7RzV/9kG3BREygZMJ2aG+OMGrd3MJs4ZXqNWbYZSo40w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780161155; c=relaxed/simple; bh=u0SP/HXhmda+OGflFuDCm5sAQWKVzSWBig8Rbhb++64=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aIYhdIAkfxpTWsoDUNQuFjmcBRyqXa4u9SJ0fyzjauxlSogHt3wWEcMz3i79u2lEyUiS8Jjo4ZgLxpczF/rTdVt8N8wmNAg8ymHVaR/KqA3rzVT7/jgUvYlOBxh1N/eKkDGKTpU0mmkl+czg+QB7h3jUENx3G9HQBGpGSGWdWPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rmbngIy+; 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="rmbngIy+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76E5E1F00893; Sat, 30 May 2026 17:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780161154; bh=uPUpXz1gYiosH3IXVav/ttsBESFDBX370pRJsG3PiOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rmbngIy+lx6O1HAs0/m/RxiztNPkR0IAu5BcibI2s3ep1ZcocKIXSZH4iLVOmIAQy DGuu3UH2P3vJBJ+maUv8fMPgLDkG6QysKF93gsT7817Dld1lNzR92htEPrODFNNvMb W0u501gM5PZF8Bws/ysN64t/UDJVEC2tgSv/BuH4= 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.1 542/969] selftest: memcg: skip memcg_sock test if address family not supported Date: Sat, 30 May 2026 18:01:06 +0200 Message-ID: <20260530160315.338927071@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@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.1-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 5a526a8e7d333..e75ff9289e419 100644 --- a/tools/testing/selftests/cgroup/test_memcontrol.c +++ b/tools/testing/selftests/cgroup/test_memcontrol.c @@ -921,8 +921,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; @@ -1049,6 +1052,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