The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Yousef Alhouseen <alhouseenyousef@gmail.com>,
	cem@kernel.org, linux-xfs@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] xfs: zero newly allocated btree root space
Date: Wed, 1 Jul 2026 08:52:34 -0700	[thread overview]
Message-ID: <20260701155234.GF6526@frogsfrogsfrogs> (raw)
In-Reply-To: <akTyUXMN4_I1fOaM@infradead.org>

On Wed, Jul 01, 2026 at 03:56:17AM -0700, Christoph Hellwig wrote:
> On Tue, Jun 30, 2026 at 01:39:35PM -0700, Yousef Alhouseen wrote:
> > Yes. The KMSAN report traces the allocation through
> > xfs_bmap_extents_to_btree(), which calls xfs_bmap_broot_realloc(...,
> > 1). With no existing root, that reaches krealloc(NULL, new_size). The
> > conversion initializes the block header, first key, and end-anchored
> > pointer, but does not initialize the layout/alignment gap within the
> > full if_broot_bytes allocation. XFS_ILOG_DBROOT later copies that
> > complete byte count into the log.
> > 
> > So the observed bytes are root-layout slack from the extents-to-btree
> > conversion, rather than record storage that a later insertion should
> > have filled.
> 
> This almost sounds like we should explicitly zero this case just for that
> particular case.  Although Darrick was kinda heading in a different
> direction and I don't want to start a fight here.

I'm fine with either solution; I simply prefer the one that fixes all
the current and future "oops we forgot to zero a hidden padding" bugs in
one action.

Carlos? :D

--D

  reply	other threads:[~2026-07-01 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 10:06 [PATCH v2] xfs: zero newly allocated btree root space Yousef Alhouseen
2026-06-30 16:11 ` Darrick J. Wong
2026-06-30 20:39   ` Yousef Alhouseen
2026-07-01 10:56     ` Christoph Hellwig
2026-07-01 15:52       ` Darrick J. Wong [this message]
2026-07-02 11:05         ` Christoph Hellwig
2026-07-02 15:31           ` Darrick J. Wong

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=20260701155234.GF6526@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=alhouseenyousef@gmail.com \
    --cc=cem@kernel.org \
    --cc=hch@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox