public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org,
	bfoster@redhat.com, hch@infradead.org
Subject: Re: [PATCH 1/2] xfs_repair: validate alignment of inherited rt extent hints
Date: Sun, 4 Jul 2021 09:51:43 +0100	[thread overview]
Message-ID: <YOF2n+aIKG/cqhyX@infradead.org> (raw)
In-Reply-To: <162528107024.36302.9037961042426880362.stgit@locust>

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.

Oterwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2021-07-04  8:53 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 [this message]
2021-07-08  7:11     ` Carlos Maiolino
2021-07-08 22:31       ` Darrick J. Wong
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=YOF2n+aIKG/cqhyX@infradead.org \
    --to=hch@infradead.org \
    --cc=bfoster@redhat.com \
    --cc=djwong@kernel.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