7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Darrick J. Wong commit 436ae68743a6974021fefa21fd3093d9bf8e66e4 upstream. LOLLM noticed that xrep_dinode_check_dfork doesn't require that the inode has the METADATA flag set in flags2. Add that check. Cc: stable@vger.kernel.org # v6.14 Fixes: 702c90f4516223 ("xfs: support file data forks containing metadata btrees") Signed-off-by: Darrick J. Wong Assisted-by: LOLLM # finding obvious bugs Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman --- fs/xfs/scrub/inode_repair.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/fs/xfs/scrub/inode_repair.c +++ b/fs/xfs/scrub/inode_repair.c @@ -1014,6 +1014,11 @@ xrep_dinode_bad_metabt_fork( if (whichfork != XFS_DATA_FORK) return true; + if (!xfs_has_metadir(sc->mp)) + return true; + if (!(dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_METADATA))) + return true; + switch (be16_to_cpu(dip->di_metatype)) { case XFS_METAFILE_RTRMAP: return xrep_dinode_bad_rtrmapbt_fork(sc, dip, dfork_size);