public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH 1/8][next] block: blk_types.h: Use struct_group_tagged() in flex struct bio
Date: Mon, 24 Feb 2025 08:39:01 -0800	[thread overview]
Message-ID: <Z7ygpff-kUHPtEQp@infradead.org> (raw)
In-Reply-To: <ccf673b997e771430b7570fb8a6dfc11d07a2bde.1739957534.git.gustavoars@kernel.org>

On Mon, Feb 24, 2025 at 08:25:08PM +1030, Gustavo A. R. Silva wrote:
> Use the `struct_group_tagged()` helper to create a new tagged
> `struct bio_hdr`. This structure groups together all the members of
> the flexible `struct bio` except the flexible array `bi_inline_vecs`.
> As a result, the array is effectively separated from the rest of the
> members without modifying the memory layout of the flexible structure.
> 
> This new tagged struct will be used to fix problematic declarations
> of middle-flex-arrays in composite structs, like these[1][2][3], for
> instance.

Well, I guess this goes with the context-less nvme patch.  I think
you're much better off just removing the bi_inline_vecs array entirely,
and just add a new structure for bio + inline vecs for the few callers
that dynamically allocate the bio and actually have inline vecs.

Similar to what I did here for the bio integrity payload:

https://lore.kernel.org/linux-block/20250131122436.1317268-4-hch@lst.de/

  reply	other threads:[~2025-02-24 16:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24  9:53 [PATCH 0/8][next] Avoid a couple hundred -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2025-02-24  9:55 ` [PATCH 1/8][next] block: blk_types.h: Use struct_group_tagged() in flex struct bio Gustavo A. R. Silva
2025-02-24 16:39   ` Christoph Hellwig [this message]
2025-02-24  9:56 ` [PATCH 2/8][next] md/raid5-ppl: Avoid -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
2025-02-24  9:57 ` [PATCH 3/8][next] xfs: Avoid -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2025-02-24 19:12   ` Darrick J. Wong
2025-02-24 21:45   ` Dave Chinner
2025-02-24  9:58 ` [PATCH 4/8][next] erofs: " Gustavo A. R. Silva
2025-02-24  9:59 ` [PATCH 5/8][next] btrfs: " Gustavo A. R. Silva
2025-02-24 10:00 ` [PATCH 6/8][next] nvme: target: " Gustavo A. R. Silva
2025-02-24 14:19   ` Christoph Hellwig
2025-02-25  1:51     ` Gustavo A. R. Silva
2025-02-24 10:00 ` [PATCH 7/8][next] md/raid5: " Gustavo A. R. Silva
2025-02-24 10:01 ` [PATCH 8/8][next] bcache: " Gustavo A. R. Silva
2025-02-24 14:04   ` Coly Li

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=Z7ygpff-kUHPtEQp@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=gustavoars@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.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