Skip to content

Commit 498fe26

Browse files
committed
xfs: strengthen rmap record flags checking
We always know the correct state of the rmap record flags (attr, bmbt, unwritten) so check them by direct comparison. Fixes: d852657 ("xfs: cross-reference reverse-mapping btree") Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
1 parent e95b6c3 commit 498fe26

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/xfs/scrub/bmap.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,13 @@ xchk_bmap_xref_rmap(
218218
* which doesn't track unwritten state.
219219
*/
220220
if (owner != XFS_RMAP_OWN_COW &&
221-
irec->br_state == XFS_EXT_UNWRITTEN &&
222-
!(rmap.rm_flags & XFS_RMAP_UNWRITTEN))
221+
!!(irec->br_state == XFS_EXT_UNWRITTEN) !=
222+
!!(rmap.rm_flags & XFS_RMAP_UNWRITTEN))
223223
xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
224224
irec->br_startoff);
225225

226-
if (info->whichfork == XFS_ATTR_FORK &&
227-
!(rmap.rm_flags & XFS_RMAP_ATTR_FORK))
226+
if (!!(info->whichfork == XFS_ATTR_FORK) !=
227+
!!(rmap.rm_flags & XFS_RMAP_ATTR_FORK))
228228
xchk_fblock_xref_set_corrupt(info->sc, info->whichfork,
229229
irec->br_startoff);
230230
if (rmap.rm_flags & XFS_RMAP_BMBT_BLOCK)

0 commit comments

Comments
 (0)