public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Pavel Begunkov <asml.silence@gmail.com>, Jens Axboe <axboe@kernel.dk>
Cc: Stefan Metzmacher <metze@samba.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	io-uring Mailing List <io-uring@vger.kernel.org>,
	GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Subject: Re: [PATCH v1 2/2] io_uring: uapi: Don't use a zero-size array
Date: Wed, 16 Nov 2022 17:28:58 +0700	[thread overview]
Message-ID: <cd9642a2-3f09-46c8-51bc-2c359b8b3f0b@gnuweeb.org> (raw)
In-Reply-To: <63a47e31-6d30-6dad-7b8d-1f14a7bd8fd5@gmail.com>

On 11/16/22 5:14 PM, Pavel Begunkov wrote:
> On 11/15/22 21:29, Ammar Faizi wrote:
>> From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
>>
>> Don't use a zero-size array because it doesn't allow the user to
>> compile an app that uses liburing with the `-pedantic-errors` flag:
> 
> Ammar, I'd strongly encourage you to at least compile your
> patches or even better actually test them. There is an explicit
> BUILD_BUG_ON() violated by this change.

Oh yeah, I didn't realize that. This patch breaks this assertion:

   BUILD_BUG_ON failed: sizeof_field(struct io_uring_sqe, cmd) != 0

This assertion wants the size of cmd[] to be zero. Which is obviously
violated in this patch.

I only tested a liburing app that uses this header and validated
that the struct size is the same, but not its field. That's my
mistake.

I'm *not* going to send a v2 per Jens' comment.

-- 
Ammar Faizi


  reply	other threads:[~2022-11-16 10:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 21:29 [PATCH v1 0/2] io_uring uapi updates Ammar Faizi
2022-11-15 21:29 ` [PATCH v1 1/2] io_uring: uapi: Don't force linux/time_types.h for userspace Ammar Faizi
2022-11-15 21:29 ` [PATCH v1 2/2] io_uring: uapi: Don't use a zero-size array Ammar Faizi
2022-11-15 23:09   ` Jens Axboe
2022-11-16 10:14   ` Pavel Begunkov
2022-11-16 10:28     ` Ammar Faizi [this message]
2022-11-15 23:14 ` (subset) [PATCH v1 0/2] io_uring uapi updates Jens Axboe
2022-11-16  6:34   ` Ammar Faizi
2022-11-16  6:49     ` Ammar Faizi
2022-11-16 13:50     ` Jens Axboe
2022-11-16 14:22       ` Stefan Metzmacher
2022-11-16 19:46         ` Jens Axboe
2022-11-16 20:03           ` Stefan Metzmacher
2022-11-16 20:31             ` Pavel Begunkov
2022-11-16 20:18           ` Stefan Metzmacher

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=cd9642a2-3f09-46c8-51bc-2c359b8b3f0b@gnuweeb.org \
    --to=ammarfaizi2@gnuweeb.org \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=gwml@vger.gnuweeb.org \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=metze@samba.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