xfs: attr forks require attr, not attr2

commit 73c34b0b85d46bf9c2c0b367aeaffa1e2481b136 upstream.

It turns out that I misunderstood the difference between the attr and
attr2 feature bits.  "attr" means that at some point an attr fork was
created somewhere in the filesystem.  "attr2" means that inodes have
variable-sized forks, but says nothing about whether or not there
actually /are/ attr forks in the system.

If we have an attr fork, we only need to check that attr is set.

Fixes: 99d9d8d05d ("xfs: scrub inode block mappings")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Darrick J. Wong
2024-12-18 11:17:20 -08:00
committed by Greg Kroah-Hartman
parent 27336a327b
commit b2dcbd8a92

View File

@@ -857,7 +857,13 @@ xchk_bmap(
}
break;
case XFS_ATTR_FORK:
if (!xfs_has_attr(mp) && !xfs_has_attr2(mp))
/*
* "attr" means that an attr fork was created at some point in
* the life of this filesystem. "attr2" means that inodes have
* variable-sized data/attr fork areas. Hence we only check
* attr here.
*/
if (!xfs_has_attr(mp))
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
break;
default: