From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795913821; b=hfjQrliIL1ZJGwzCLPF+erh38wjllnVj/gM+rbzR3YvvOJDNjUdfHSkrIMskaOdAZaKW zihikY/tnZ+iq/+/9toFMQMGB4t292ZX4Hr8v8ylAj7a1uxnbBwmb/Rb79wlhhY1UtkjG lHAAo3pz4+H+kQ0UlTAvCQ/Cjn89yd0nJU4DeR22z3lQA+UnLSgTMEobRZzjo+eBzaZxh bmbGTSXgTaR0Jb2fcDBmmQJNs45qFYQd2TP3CW8jSasCTOKp/VvLC96bWba1YJQQXFFZF ZHfG3mc3X+YwD8BXEop6yB3Ed8JAReRdYa5PULhBMcvpabUnaZG8+iqsDdLpAg9EFPQ== 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=bS/z9bWU4e9ytUmsAXp32anL9+Lla8IqJ2HBJ4e1+oIUzO343jzTHJzacYoE/PU6ssog 7aK02pXXGLlWy9c9Sd2LJAjZmedYujCm5HTDJhAiwvtSkv5m4UxHOMFVTY8Q9U6iUgjgx uJTlrQfj5N056Z6wKYva5sc39SLDLEA0aqsz0zmy45cQfGN2iMHls5Qscn3s1H9UFYSJV AoBwDwgDhLlOwPWoIm6MYidYqTAaVrxUtDNJ53Sf7fd3T5ASxZPJqy5lUJc5U+sjskdSS PKwslVG1QsgvjihHSePcUOxC6XBndFiaSmbKfTY/C8J5jaFBFY22wndujRlQRlcWX5A== 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.219.41 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (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 A85EA606A323 for ; Sun, 29 Nov 2026 00:57:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A85EA606A323 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-qv1-f41.google.com with SMTP id 6a1803df08f44-921342fae7eso94343256d6.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=ZgVE4+T0z0Pbd/aaetzhSDoiOzznwHeUs/BCWP+xjVDETvjpT+ZFBMCh5DVNTyMV74 FxcWxEmXU05GKX+e8YTYO6Df8CzKWEYn/VBdzMr3zhKqnZsgC2YAD5qSrTzOUvbWwwGR /S2AJ2TwVQmMNodm1a389PTAmUXLjzXYbg0F09vccdjk2lrSpdayhi3Md64pp2ZzrOKo zitIlt5O8XIm8lpyxYtGhZn00biqwJMxaeXpXFZTZ6XtWiHTWitW7Fs/KM7ehX6qErah urrLn/o+QacpG07y0y3889/sZH5EiAiXSzMJrg2/c7NKGpF8eEVuoWuSY2byUMDWFh2x qWqw== X-Forwarded-Encrypted: i=1; AL+hErFa4hCDUKEhEhIs6RmQ5pcsTSm0u72ueKMIuwo3TMjOatRhqLQqBjTCh/9P9I7Kph8X5O8OrKmm1x0VxpA=@vger.kernel.org X-Gm-Message-State: APuU4Z8g+bJnqj6bbu0OdXo0JGaBoJZ+DbzsOSqsgGjMsyqfETGHveBW AkKH+OkILEKUZJmZekJ/3SfVnjCvg9ck9143fa5m9PEARUjJGZ3UXPEk6IEeHybFB8Asyw== X-Gm-Gg: AZFdTZeUinQVxygzwb/Jil99y/wfjEPxMXaCdw5y1b8KS5oriayv95dKwOzIVziltcn Mo3JYce/jn+/52+En/bz44DBIB+QRybNdt8y/1/5OYPRB853ktb0W2vYPBcPL0sV2l+DeQznMAR DCMsQuC1Qo1d0KazF2eSd38Quz4vfvrE4c74yrJNfL07M+1k5TYm8a9c8F3vJogVjm2V2ke6MPK TpfKXy1qqYH7HlYVpETS3/Rp/jVczmIUGZq36nQzPP1jmZv+N/mHjfChqr89eCDANQvpHJEBIz7 83FFzB3Q71yRezpME+fYo817SwtbBtlixtIHyoAPyU0PViCSQP3CiRKJI0d2AsK8vLvGpP/r4bU h2AjUMFHd6N9t3E2+4wONpQ0oII/Y2CC3jP6mwbccDrm6x4amerKkhq3FTxFwARK5UXOlU60+oc C1TXj1dwofDxrO1G2nCgWonL51OMVNzhtCMSDsT8jY/kfERl5mw1szVr+CY0xnVDlgHcmDRTdLq v0TYg/QdgrXfXU6q6AKhiH4MN1NPRR2ulZqVjIFpb7Xgn5VmgL3F7vPuw6o1M97uRdXd402O6H+ 5n4gqnmVPlM/adRJaWyZ5ryEuze7wEOc9ybQNda+s6zUCOuXSvh9O5b0Xz75qdcm91RHzPab8Jf DahOj 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-kernel@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