7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Darrick J. Wong commit f5b4d8c8ce16675f77c25a4ff06caaa9a2739f31 upstream. LOLLM pointed out that we should zero di_metatype (fka di_onlink) when we're clearing the METADIR inode flag because the file is no longer a metadata file. Cc: stable@vger.kernel.org # v6.13 Fixes: 7297fd0bebbd70 ("xfs: enforce metadata inode flag") 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/xfs/scrub/inode_repair.c +++ b/fs/xfs/scrub/inode_repair.c @@ -579,8 +579,10 @@ xrep_dinode_flags( fa = xfs_dinode_verify_metadir(sc->mp, dip, mode, flags, flags2); - if (fa) + if (fa) { flags2 &= ~XFS_DIFLAG2_METADATA; + dip->di_metatype = cpu_to_be16(XFS_METAFILE_UNKNOWN); + } } dip->di_flags = cpu_to_be16(flags);