Linux MM tree latest commits
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
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
Subject: + selftests-ipc-restore-enosys-handling-for-msg_copy-and-clean-up.patch added to mm-nonmm-unstable branch
Date: Sat, 28 Nov 2026 17:55:28 -0800	[thread overview]
Message-ID: <20261129015529.28AD51F00896@smtp.kernel.org> (raw)
In-Reply-To: <20261129005656.52865-1-ndokutovich@gmail.com>


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 <ndokutovich@gmail.com>
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 <ndokutovich@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Paul White <paul.white.kernel@gmail.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>

 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


           reply	other threads:[~2026-11-29  1:55 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20261129005656.52865-1-ndokutovich@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261129015529.28AD51F00896@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=manfred@colorfullife.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=ndokutovich@gmail.com \
    --cc=paul.white.kernel@gmail.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox