* [PATCH] xfs: fix inverted clearance of inode junk flags
@ 2026-07-22 9:17 Andrey Albershteyn
2026-07-22 15:31 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Albershteyn @ 2026-07-22 9:17 UTC (permalink / raw)
To: linux-xfs, cem; +Cc: Andrey Albershteyn, djwong
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xfs: fix inverted clearance of inode junk flags
2026-07-22 9:17 [PATCH] xfs: fix inverted clearance of inode junk flags Andrey Albershteyn
@ 2026-07-22 15:31 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2026-07-22 15:31 UTC (permalink / raw)
To: Andrey Albershteyn; +Cc: linux-xfs, cem
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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-22 15:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox