All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: linux-xfs@vger.kernel.org, cem@kernel.org
Subject: Re: [PATCH] xfs: fix inverted clearance of inode junk flags
Date: Wed, 22 Jul 2026 08:31:25 -0700	[thread overview]
Message-ID: <20260722153125.GA7380@frogsfrogsfrogs> (raw)
In-Reply-To: <20260722091801.503245-1-aalbersh@kernel.org>

On Wed, Jul 22, 2026 at 11:17:59AM +0200, Andrey Albershteyn wrote:
> sashiko.dev noticed that these checks clear all the valid flags instead
> of invalid. This probably was never hit as it only executed on invalid
> flag presence.
> 
> Fixes: 2d295fe65776 ("xfs: repair inode records")
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>

Heh, I have an identical patch in my pending fixes branch.  That makes
things easy:
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/xfs/scrub/inode_repair.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/scrub/inode_repair.c b/fs/xfs/scrub/inode_repair.c
> index 3ec41c198351..3fc9a12b494a 100644
> --- a/fs/xfs/scrub/inode_repair.c
> +++ b/fs/xfs/scrub/inode_repair.c
> @@ -1797,7 +1797,7 @@ xrep_inode_flags(
>  
>  	/* Clear junk flags */
>  	if (sc->ip->i_diflags & ~XFS_DIFLAG_ANY)
> -		sc->ip->i_diflags &= ~XFS_DIFLAG_ANY;
> +		sc->ip->i_diflags &= XFS_DIFLAG_ANY;
>  
>  	/* NEWRTBM only applies to realtime bitmaps */
>  	if (I_INO(sc->ip) == sc->mp->m_sb.sb_rbmino)
> @@ -1828,7 +1828,7 @@ xrep_inode_flags(
>  
>  	/* Clear junk flags. */
>  	if (sc->ip->i_diflags2 & ~XFS_DIFLAG2_ANY)
> -		sc->ip->i_diflags2 &= ~XFS_DIFLAG2_ANY;
> +		sc->ip->i_diflags2 &= XFS_DIFLAG2_ANY;
>  
>  	/* No reflink flag unless we support it and it's a file. */
>  	if (!xfs_has_reflink(sc->mp) || !S_ISREG(mode))
> -- 
> 2.54.0
> 
> 

      reply	other threads:[~2026-07-22 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  9:17 [PATCH] xfs: fix inverted clearance of inode junk flags Andrey Albershteyn
2026-07-22 15:31 ` 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=20260722153125.GA7380@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=cem@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.