From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: use memset to initialize xfs_scrub_agfl_info
Date: Wed, 7 Feb 2018 15:23:45 -0800 [thread overview]
Message-ID: <20180207232345.GB5433@magnolia> (raw)
In-Reply-To: <c6ed0221-31ef-0241-f0d0-418aaf6431c2@redhat.com>
On Wed, Feb 07, 2018 at 04:23:38PM -0600, Eric Sandeen wrote:
> Apparently different gcc versions have competing and
> incompatible notions of how to initialize at declaration,
> so just give up and fall back to the time-tested memset().
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>
> diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
> index fd97552..05c66e0 100644
> --- a/fs/xfs/scrub/agheader.c
> +++ b/fs/xfs/scrub/agheader.c
> @@ -767,7 +767,7 @@ struct xfs_scrub_agfl_info {
> xfs_scrub_agfl(
> struct xfs_scrub_context *sc)
> {
> - struct xfs_scrub_agfl_info sai = { 0 };
> + struct xfs_scrub_agfl_info sai;
> struct xfs_agf *agf;
> xfs_agnumber_t agno;
> unsigned int agflcount;
> @@ -795,6 +795,7 @@ struct xfs_scrub_agfl_info {
> xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> goto out;
> }
> + memset(&sai, 0, sizeof(sai));
> sai.sz_entries = agflcount;
> sai.entries = kmem_zalloc(sizeof(xfs_agblock_t) * agflcount, KM_NOFS);
> if (!sai.entries) {
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2018-02-07 23:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-07 22:23 [PATCH] xfs: use memset to initialize xfs_scrub_agfl_info Eric Sandeen
2018-02-07 23:23 ` Darrick J. Wong [this message]
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=20180207232345.GB5433@magnolia \
--to=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).