Commit 309dc9cb authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: check shortform attr entry flags specifically

While reviewing flag checking in the attr scrub functions, we noticed
that the shortform attr scanner didn't catch entries that have the LOCAL
or INCOMPLETE bits set.  Neither of these flags can ever be set on a
shortform attr, so we need to check this narrower set of valid flags.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent f660ec8e
...@@ -579,6 +579,15 @@ xchk_xattr_check_sf( ...@@ -579,6 +579,15 @@ xchk_xattr_check_sf(
break; break;
} }
/*
* Shortform entries do not set LOCAL or INCOMPLETE, so the
* only valid flag bits here are for namespaces.
*/
if (sfe->flags & ~XFS_ATTR_NSP_ONDISK_MASK) {
xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0);
break;
}
if (!xchk_xattr_set_map(sc, ab->usedmap, if (!xchk_xattr_set_map(sc, ab->usedmap,
(char *)sfe - (char *)sf, (char *)sfe - (char *)sf,
sizeof(struct xfs_attr_sf_entry))) { sizeof(struct xfs_attr_sf_entry))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment