]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xfs: add missing nrext64 inode flag check to scrub
authorDarrick J. Wong <djwong@kernel.org>
Wed, 27 Mar 2024 00:12:25 +0000 (17:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:28:48 +0000 (15:28 +0200)
commit 576d30ecb620ae3bc156dfb2a4e91143e7f3256d upstream.

Add this missing check that the superblock nrext64 flag is set if the
inode flag is set.

Fixes: 9b7d16e34bbeb ("xfs: Introduce XFS_DIFLAG2_NREXT64 and associated helpers")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/scrub/inode.c

index 74b1ebb40a4c0fcb34199e5fd440a6c55f5d1edf..d03de74fd76f34bf4cf9481ffc45efdc94f5162d 100644 (file)
@@ -337,6 +337,10 @@ xchk_inode_flags2(
        if (xfs_dinode_has_bigtime(dip) && !xfs_has_bigtime(mp))
                goto bad;
 
+       /* no large extent counts without the filesystem feature */
+       if ((flags2 & XFS_DIFLAG2_NREXT64) && !xfs_has_large_extent_counts(mp))
+               goto bad;
+
        return;
 bad:
        xchk_ino_set_corrupt(sc, ino);