mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Geert Uytterhoeven" <geert@linux-m68k.org>,
	Mathura_Kumar <academic1mathura@gmail.com>
Cc: "Christian Brauner" <brauner@kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	"Alexander Viro" <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] [PATCH V5] mqueue: introduce new do_mq_timedreceive2() [ mq_peek syscall] for non-destructive receive and inspection,fix minor issue,prepared doc.
Date: Fri, 06 Mar 2026 11:30:52 +0100	[thread overview]
Message-ID: <b0398b22-e964-4f7e-b29e-612386730dae@app.fastmail.com> (raw)
In-Reply-To: <CAMuHMdXDeeeJH3x09YuZ-86=FPfwZg0mD5Gwnqvk7U_QT1eOhw@mail.gmail.com>

On Fri, Mar 6, 2026, at 10:38, Geert Uytterhoeven wrote:
> CC Arnd

Thanks!

> On Fri, 6 Mar 2026 at 08:50, Mathura_Kumar <academic1mathura@gmail.com> wrote:
>
>> +1) Overview
>> +-----------
>> +
>> +POSIX message queues on Linux provide mq_receive() and mq_timedreceive()
>> +for consuming messages from a queue. Both interfaces require the caller
>> +to pass the message buffer, length, and priority pointer as individual
>> +arguments to the system call. This imposes a fixed calling convention
>> +that cannot be extended without breaking the ABI.
>> +
>> +mq_timedreceive2() introduces a new system call entry point that accepts
>> +message buffer parameters via a struct argument rather than as individual
>> +syscall arguments. This frees the remaining syscall argument slots for
>> +new functionality flags and a message index, enabling non-destructive
>> +peek and indexed access semantics that are not possible with the
>> +original interface.
>> +
>> +Two variants are provided:
>> +
>> +  mq_timedreceive2()         - primary variant, 64-bit time (Y2038-safe)
>> +  mq_timedreceive2_time32()  - 32-bit time variant for legacy and compat
>
> What is the rationale behind adding a new syscall that is not Y2038-safe?

Indeed, that would need a very strong reason. New userspace already has to
support old kernels without the syscalls, and it would seem easy enough
to just not support it on time32 libc implementations.

>> index 4fcc7c58a105..fd90a2f500b6 100644
>> --- a/arch/powerpc/kernel/syscalls/syscall.tbl
>> +++ b/arch/powerpc/kernel/syscalls/syscall.tbl
>> @@ -562,3 +562,6 @@
>>  469    common  file_setattr                    sys_file_setattr
>>  470    common  listns                          sys_listns
>>  471    nospu   rseq_slice_yield                sys_rseq_slice_yield
>> +472    32      mq_timedreceive2                sys_mq_timedreceive2_time32
>> +473    64      mq_timedreceive2                sys_mq_timedreceive2
>> +474    32      mq_timedreceive2_time64     sys_mq_timedreceive2          sys_mq_timedreceive2
>
> PowerPC receives three variants?
> Oh, the first two are for 32-bit vs. 64-bit, so they should use the
> same syscall number.

Probably just a typo there (same on sparc), I assume the intention was
to use the same number as the generic scripts/syscall.tbl version.

> Furthermore, this breaks the "new syscalls use the same number on
> most architectures"-rule. Next free slot is now 472, 473, or 474,
> depending on architecture.

Right. I also noticed a few more mistakes with the numbers:

- parisc is missing the syscall entirely
- arm32 compat mode has the numbers reversed compared to native mode
- x86 only gets a version in the 'x32' range, but is missing the
  native x86-64 version.
- The testcase hardcodes the x32 syscall number for all architectures
  other than a couple of hardcoded ones

Also, I would point out few more general issues:

- compat handling is is busted for the normal syscalls, and only
  seems to work by accident on the time32 one.
- the time32 syscall passes a kernel structure through a __user
  pointer
- this is the first patch (or public email) ever sent by the "author"
- the changelog text and subject line make no sense whatsoever
- four submissions of the series in three days, with the latest
  one labeled 'V5'.

I don't normally dismiss new submissions easily, but I think it's
safe to ignore this one.

  Arnd 

  reply	other threads:[~2026-03-06 10:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06  7:50 Mathura_Kumar
2026-03-06  9:38 ` Geert Uytterhoeven
2026-03-06 10:30   ` Arnd Bergmann [this message]
2026-03-06 21:56 ` Randy Dunlap
2026-03-06 22:11 ` kernel test robot
2026-03-07 12:43 ` kernel test robot

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=b0398b22-e964-4f7e-b29e-612386730dae@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=academic1mathura@gmail.com \
    --cc=brauner@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®