public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>,
	sandeen@sandeen.net, linux-xfs@vger.kernel.org,
	bfoster@redhat.com
Subject: Re: [PATCH 1/2] xfs_repair: validate alignment of inherited rt extent hints
Date: Thu, 8 Jul 2021 15:31:57 -0700	[thread overview]
Message-ID: <20210708223157.GJ11588@locust> (raw)
In-Reply-To: <20210708071116.njicib4zsxkdny3k@omega.lan>

On Thu, Jul 08, 2021 at 09:11:16AM +0200, Carlos Maiolino wrote:
> On Sun, Jul 04, 2021 at 09:51:43AM +0100, Christoph Hellwig wrote:
> > On Fri, Jul 02, 2021 at 07:57:50PM -0700, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <djwong@kernel.org>
> > > 
> > > If we encounter a directory that has been configured to pass on an
> > > extent size hint to a new realtime file and the hint isn't an integer
> > > multiple of the rt extent size, we should turn off the hint because that
> > > is a misconfiguration.
> > > 
> > > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > > ---
> > >  repair/dinode.c |   28 +++++++++++++++++++++++++++-
> > >  1 file changed, 27 insertions(+), 1 deletion(-)
> > > 
> > > 
> > > diff --git a/repair/dinode.c b/repair/dinode.c
> > > index 291c5807..1275c90b 100644
> > > --- a/repair/dinode.c
> > > +++ b/repair/dinode.c
> > > @@ -2178,6 +2178,31 @@ _("Bad %s nsec %u on inode %" PRIu64 ", "), name, be32_to_cpu(t->t_nsec), lino);
> > >  		*dirty = 1;
> > >  	}
> > >  }
> > > +/*
> > > + * Inode verifiers on older kernels don't check that the extent size hint is an
> > > + * integer multiple of the rt extent size on a directory with both rtinherit
> > > + * and extszinherit flags set.  If we encounter a directory that is
> > > + * misconfigured in this way, or a regular file that inherited a bad hint from
> > > + * a directory, clear the hint.
> > > + */
> > > +static bool
> > > +zap_bad_rt_extsize_hint(
> > 
> > The name suggests this function does the zapping itself, while it
> > actually leaves that to the caller.
> 
> +1 here, I also led me to believe this was actually zeroing the extsize, but the
> patch's logic is fine.
> 
> Maybe something like
> 
> {is,has}_bad_rt_extsize_hint()?

Renamed to is_misaligned_extsize_hint().

--D

> 
> > 
> > Oterwise looks good:
> > 
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> > 
> 
> -- 
> Carlos
> 

  reply	other threads:[~2021-07-08 22:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03  2:57 [PATCHSET 0/2] xfsprogs: strengthen validation of extent size hints Darrick J. Wong
2021-07-03  2:57 ` [PATCH 1/2] xfs_repair: validate alignment of inherited rt extent hints Darrick J. Wong
2021-07-04  8:51   ` Christoph Hellwig
2021-07-08  7:11     ` Carlos Maiolino
2021-07-08 22:31       ` Darrick J. Wong [this message]
2021-07-09  7:41         ` Carlos Maiolino
2021-07-03  2:57 ` [PATCH 2/2] mkfs: validate rt extent size hint when rtinherit is set Darrick J. Wong
2021-07-04  8:54   ` Christoph Hellwig
2021-07-08  7:19   ` Carlos Maiolino
  -- strict thread matches above, loose matches on Subject: below --
2021-07-28 21:15 [PATCHSET v3 0/2] xfsprogs: strengthen validation of extent size hints Darrick J. Wong
2021-07-28 21:15 ` [PATCH 1/2] xfs_repair: validate alignment of inherited rt extent hints Darrick J. Wong
2021-07-28 22:11   ` Eric Sandeen

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=20210708223157.GJ11588@locust \
    --to=djwong@kernel.org \
    --cc=bfoster@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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