Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795913821; b=X+H00xBOKjdTBdSHMfHfHJ1Mo1Am6Abtgbgov7ELZHQPlwWLLuOnTsCeJsl6o/sOA3RE 0veSKYVbJDck6cRYqcZF5TkDaeJfw8iYf/F4n1T+BJLBgBKOm3v8SRcgZ7HtPJsqSr0GI zJFyG85QaCrRTaarztU4rEdpO2+52Wr2a7gkNkubVRl1JATK8sTJrCBffLvyCPHk0Aw/c MB4SqapiKs42WlL3Jl8Tp24FZHaGjd0JqU/VzgEDiYqMGDm/Mo6uvEwCic1noFd2CPNMK me3P4t/y3ACAPLWpBS+HeCF43q75eWtoOU39/kbuLmB0Nu2UwLlxDoxwMGvDH3ARPrA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795913821; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=UoUtPBiNz4KIq2KUlSpKkwYxbG8BMgd2/6b0Qk11yKE=; b=XX0Hiyiru16afaXFs4S/gY4K2m21f3nE/NDlAJrTl/rSbuS1ilaL6596ltDRU8N8jfC+ iMsLmxtqKk25WOMFExJRGQPn2dFYP0qXgS90cei4YZpepDHUzNJoYrom9KCaAuB9NnxH6 sm9AS6dgl7+Rn+rSgTYn/x6N3i38G3f78DyA2CCHI2bzeSQN/YZcElxEecxIrQ7aNQcBD 3nO8wB6WSmf0Tel4JJ+t9PxJyynzdknRiroX4UGumSdIcVhwlLHiYCYYqSb/0QhQGu87F HDLNFlxhFnevYwxxVm0bBgI+Kr33WXwvL/sy2wLp1JCpi+7Hp/al0ISGpK5762hhOow== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Rhs4yoei; arc=none smtp.remote-ip=209.85.160.180 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A43F1606A31C for ; Sun, 29 Nov 2026 00:57:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A43F1606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Rhs4yoei Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-5366ae57896so94362341cf.3 for ; Sat, 28 Nov 2026 16:57:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795913819; x=1796518619; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=UoUtPBiNz4KIq2KUlSpKkwYxbG8BMgd2/6b0Qk11yKE=; b=Rhs4yoeiCUf6YZ0y2HjPGQLc1ZA+As3GL6Tx9yEiy9XA4wl1itZPLRPuDzweb/txCR cVbePAgxpqtG3uqTAHOO3IZT344b1xUlibI8L8eDOamf141VmqDzGtDruRmfOKcPb8FS ZOqAVJHwpwBm/bU/eoIJecHyyoqMO6+o4qVKqAAE9dIfNC2LUin+nwY9VHLIT8w4a7Nl 2N6kpxyGLcxyTREVKFw6kuY4cAh1kCRne+17Qdk0G+WS2y1SysfmRTbRlgpPybGBaw2T B5nI3At/6hC2QFUbAqGfnwUKlYRoOXdKn5ySRPStXzgaxMr0Gdo0y20cZcEnrEjxWiUb SYVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795913819; x=1796518619; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=UoUtPBiNz4KIq2KUlSpKkwYxbG8BMgd2/6b0Qk11yKE=; b=GcPyK375h2Uyi81TKkkG78dp6Z/1QB8UyK8/IelGKMVHpj8/8Lu3QkxVuga1Z0mMnz zun8s5hoIRuN57aNUKEInidw9W6jNSOh5f/cXpmOMshWKEGHGSsqo0lK4teEq2bIJURj +q+R+FburPE+pkpIotSFP2vIwp+05V2jTlLqwdK8AFfKp0aIxGEprFWvzdDgWWRJQEKo aFbRl0tx0vNsbZeHU/WiRhRaXzHXdpE3V7TcgHJqgMf6a/eaVz4XlSdmqHjeFpsV+XHg M/PMRygQGVcQuq6BDybUno2e+IeBewXWZhz8pX94Vz/QZik8TFkKkabIMS2pTjMuihn2 R5VA== X-Forwarded-Encrypted: i=1; AL+hErF5IOGjqKpXfmaHksZOrM92ZAh31lsJjxMwwWWGTqHJ7DFb462mm7dypNbFwHdFGJZZ49IJhCFctmRV7jTiGF4=@vger.kernel.org X-Gm-Message-State: APuU4Z810WnSBMCnzOduXY/gMiEFWsAJIdVevUcKtPseIr5HNpy0raJX cTXNL0jAj9pG3h3G18p9r70XZFim3TkbvMWDsI20C1FSTZd1r+1SP8u1 X-Gm-Gg: AZFdTZcCt4eX4ZPX5+xf0A+hGVQexSVC9/iA4HuAIe/2qNuEPRA5Rka8U4Q9g6P40Rj 7vZMWrzQVz0NuOeROKYP3KskKXmKauSZeCOjcT3iImhMR1+v+uAw10Ueb8Z8novQbJLyHKsG0dd 6QZ89LIewWOX+ULCNhlJXmBQoIdbdzq9+i3WNmHildlgdSphdn+IIgoIlOFQBOBYA13acaW5pju FCPa2y6f5ePWBlMt26H/h+zik4Ym1FHsTyRoKzBlRLVD+ZEsPrkbfpqy9r8nZLGz3vGbAG+PMs2 INVHyowxSqRFNffqFdYIcQlQV9a8AEfec7IkkUBTAWH8W7+jQmu2n+ObqlncZo9bjGbGNy42fqk 75Tsz28CNuwnuErHADLSY9p/O4Vf/hCVjTBTMuGF2sFrYNyEATt/CxbZfocdWmTOn0gUcljgp78 g5vFvbnhgvGfwd1YwvBp7i/dqcA1gc9fNaPZMsz+fSZluu6zKdAKMzwrEzqvVPLOHNbhfBC/feJ +AVnUhmcn12nsgPB26/DTgvkLpDkpezdhr2Lh/rABiEFXqXDI9CHItCii/mm8WQ2XD9R2Vmim8Z 8izZFuOmj5wvSRCjycIJmWuuI+LdPMxZIY8Lxv3GnhV3WkuaKHhV0TeXRtAjqUg4ayyXKy0rxvU iUA0/ X-Received: by 2002:a05:622a:4113:b0:55d:339e:1f94 with SMTP id d75a77b69052e-55d76a4c13amr581990281cf.28.1795913819527; Sat, 28 Nov 2026 16:56:59 -0800 (PST) Received: from localhost ([138.197.109.108]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-55d7c654585sm238428571cf.5.2026.11.28.16.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 16:56:59 -0800 (PST) From: Nikolai Dokutovich To: Shuah Khan , Andrew Morton Cc: Paul White , Manfred Spraul , Davidlohr Bueso , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Nikolai Dokutovich Subject: [PATCH] selftests/ipc: restore ENOSYS handling for MSG_COPY and clean up Date: Sun, 29 Nov 2026 03:56:56 +0300 Message-ID: <20261129005656.52865-1-ndokutovich@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit msgrcv(MSG_COPY) is rejected with -ENOSYS by do_msgrcv() when the kernel is built without CONFIG_CHECKPOINT_RESTORE: prepare_copy() is stubbed to return ERR_PTR(-ENOSYS) in ipc/msg.c. The test used to skip on that error, but commit fd3c1fd8baf4 ("selftests: ipc: change operation not supported error number") changed the check to EOPNOTSUPP, which is not what this kernel path returns, so the suite now reports not ok 1 Failed to copy IPC message: Function not implemented (38) on every kernel without CONFIG_CHECKPOINT_RESTORE. While here, stop skipping from dump_queue(): ksft_exit_skip() leaves the queue allocated, and a rerun in the same IPC namespace then fails at msgget(IPC_CREAT | IPC_EXCL) with -EEXIST. Return the error to main(), remove the queue and only then skip. Reproduced on a kernel without CONFIG_CHECKPOINT_RESTORE: before the fix, a run failed with the message above and a second run failed with "Can't create queue: -17"; after it, both runs report 1..0 # SKIP MSG_COPY not supported Fixes: fd3c1fd8baf4 ("selftests: ipc: change operation not supported error number") Signed-off-by: Nikolai Dokutovich --- tools/testing/selftests/ipc/msgque.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c index 4b4c1abfac0f..b6058be9a005 100644 --- a/tools/testing/selftests/ipc/msgque.c +++ b/tools/testing/selftests/ipc/msgque.c @@ -161,8 +161,8 @@ int dump_queue(struct msgque_data *msgque) ret = msgrcv(msgque->msq_id, &msgque->messages[i].mtype, MAX_MSG_SIZE, i, IPC_NOWAIT | MSG_COPY); if (ret < 0) { - if (errno == EOPNOTSUPP) - ksft_exit_skip("MSG_COPY not supported\n"); + if (errno == ENOSYS) + return -ENOSYS; ksft_test_result_fail("Failed to copy IPC message: %m (%d)\n", errno); return -errno; @@ -222,6 +222,15 @@ int main(int argc, char **argv) } err = dump_queue(&msgque); + if (err == -ENOSYS) { + /* + * MSG_COPY is not available. Remove the queue before leaving: + * a leftover queue makes a rerun fail at msgget(IPC_EXCL). + */ + if (msgctl(msgque.msq_id, IPC_RMID, NULL)) + ksft_exit_fail_msg("Failed to destroy queue: %d\n", -errno); + ksft_exit_skip("MSG_COPY not supported\n"); + } if (err) { ksft_test_result_fail("Failed to dump queue: %d\n", err); goto err_destroy; -- 2.43.0