Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795917329; b=3MwkK6FNp+ZykREYA/TLN/dSGgdIu8+YgwsI589ZfAb6UjxqbAAUMyCB25mYa/YQs/YW Qsev4BX/2LNOqBse/zOeXpjOUpPctl7ACK0ozmO3N5UBCiJ0pShC9hmmuahWhcQ3AtSuR nQk1X5Jw10c2QT3qDjIQ+A79h6Xsq1ss66rT1S6L1+NwrL/YM2UgOsLnd20XBRH9kVbB0 64rq0/KXI0VVGQIaypQc5HdH3L3ukP71qV1FrMmAyvRemz9Akb7UayloIt/Praz0+nGUs lzmVIeDTeTXeIwSJapQeh+k13TGbvAE7nzhGV6P0nJkxGrHu5tPs5QmRUMO1ozjtuhw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795917329; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=iBUpD2+kwT+lrAYZHApItwrgnqmXo1wtezeQ8WUDvks=; b=AHkl58Hf/WxlFd9u8AomZoO97yIiRr5O6OQ1p0TVFeyAQJmI3PTQoQyHz4ML7PzVSBlA qGwU6p3IZx4WdfAC95npbN8YRgli/CXDxC3SQtJR4bTvtU0qQVkq1HiEPPSNKkH7kh0Kk L5PuRMYpnO5lwvp7XNzOHrul2mbVYEYhKWBlt8KgNf2sTB6XvJ4kVRK1lcTef5XtlTlom Vgr8BniaAKPYSkInl2w2mtxK1tZeWF3ZaiBB2xcPUKq0C0cbOB0ezFs3yauVYGprKSQu/ Ld8I0iUCMcgtzDHqveuFvZgV95QCJwGg+gOM+CqWQ6N52IQ7OByHTB0WoGHxKx6Dk6A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=WtXjB9Ro; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D5FA606A31C for ; Sun, 29 Nov 2026 01:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=WtXjB9Ro Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28AD51F00896; Sun, 29 Nov 2026 01:55:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1795917329; bh=iBUpD2+kwT+lrAYZHApItwrgnqmXo1wtezeQ8WUDvks=; h=Date:To:From:In-Reply-To:References:Subject; b=WtXjB9RorzUC1W4gwmqjEDQY9XsW0ZZCYh4MO4Vc3Wx6kREMo+jCkWLFsqSTkxtIn FCAmgrw+LNrs1vHN/IsM0Blym1yK8DlMZRhEh5rciDWhC6jhNSbyuRwlDVDFDLZzgA w59L+fQFrUg4+064OsWMcQ1sVq7yHUrAA+lJy9js= Date: Sat, 28 Nov 2026 17:55:28 -0800 To: mm-commits@vger.kernel.org,shuah@kernel.org,paul.white.kernel@gmail.com, manfred@colorfullife.com,dave@stgolabs.net,ndokutovich@gmail.com, akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261129005656.52865-1-ndokutovich@gmail.com> References: <20261129005656.52865-1-ndokutovich@gmail.com> Subject: + selftests-ipc-restore-enosys-handling-for-msg_copy-and-clean-up.patch added to mm-nonmm-unstable branch Message-Id: <20261129015529.28AD51F00896@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: selftests/ipc: restore ENOSYS handling for MSG_COPY and clean up has been added to the -mm mm-nonmm-unstable branch. Its filename is selftests-ipc-restore-enosys-handling-for-msg_copy-and-clean-up.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-ipc-restore-enosys-handling-for-msg_copy-and-clean-up.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Nikolai Dokutovich Subject: selftests/ipc: restore ENOSYS handling for MSG_COPY and clean up Date: Sun, 29 Nov 2026 03:56:56 +0300 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 Link: https://patch.msgid.link/20261129005656.52865-1-ndokutovich@gmail.com Fixes: fd3c1fd8baf4 ("selftests: ipc: change operation not supported error number") Signed-off-by: Nikolai Dokutovich Signed-off-by: Andrew Morton Cc: Shuah Khan Cc: Paul White Cc: Manfred Spraul Cc: Davidlohr Bueso tools/testing/selftests/ipc/msgque.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/ipc/msgque.c~selftests-ipc-restore-enosys-handling-for-msg_copy-and-clean-up +++ a/tools/testing/selftests/ipc/msgque.c @@ -161,8 +161,8 @@ int dump_queue(struct msgque_data *msgqu 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; _ Patches currently in -mm which might be from ndokutovich@gmail.com are selftests-ipc-restore-enosys-handling-for-msg_copy-and-clean-up.patch