From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: "Darrick J. Wong" <djwong@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3][next] xfs: Replace one-element arrays with flexible-array members
Date: Mon, 15 Mar 2021 13:31:17 -0500 [thread overview]
Message-ID: <96be7032-a95c-e8d2-a7f8-64b96686ea42@embeddedor.com> (raw)
In-Reply-To: <20210311044700.GU3419940@magnolia>
On 3/10/21 22:47, Darrick J. Wong wrote:
> On Wed, Mar 10, 2021 at 10:23:02PM -0600, Gustavo A. R. Silva wrote:
>> There is a regular need in the kernel to provide a way to declare having
>> a dynamically sized set of trailing elements in a structure. Kernel code
>> should always use “flexible array members”[1] for these cases. The older
>> style of one-element or zero-length arrays should no longer be used[2].
>>
>> Refactor the code according to the use of flexible-array members in
>> multiple structures, instead of one-element arrays. Also, make use of
>> the new struct_size() helper to properly calculate the size of multiple
>> structures that contain flexible-array members. Additionally, wrap
>> some calls to the struct_size() helper in multiple inline functions.
>>
>> Below are the results of running xfstests for groups shutdown and log
>> with the following configuration in local.config:
>>
>> export TEST_DEV=/dev/sda3
>> export TEST_DIR=/mnt/test
>> export SCRATCH_DEV=/dev/sda4
>> export SCRATCH_MNT=/mnt/scratch
>>
>> The size for both partitions /dev/sda3 and /dev/sda4 is 25GB.
>
> Looks good to me, will toss it at my fstests cloud and see if anything
> shakes out. Thanks for cleaning up this goofy thorn-pile!
Great. It's been fun to work on this. :p
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Thanks!
--
Gustavo
next prev parent reply other threads:[~2021-03-15 20:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 4:23 [PATCH v3][next] xfs: Replace one-element arrays with flexible-array members Gustavo A. R. Silva
2021-03-11 4:47 ` Darrick J. Wong
2021-03-15 18:31 ` Gustavo A. R. Silva [this message]
2021-03-20 20:17 ` Darrick J. Wong
2021-03-20 20:20 ` Gustavo A. R. Silva
2021-03-20 21:48 ` Darrick J. Wong
2021-04-09 6:54 ` Gustavo A. R. Silva
2021-04-10 0:08 ` Gustavo A. R. Silva
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=96be7032-a95c-e8d2-a7f8-64b96686ea42@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=gustavoars@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.