From e00e3099a6c5adc6d334e14424e9d936f4b9c3c3 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 14 Jul 2022 11:06:20 -0700 Subject: xfs: teach repair to fix file nlinks Fix the nlinks now too. Signed-off-by: Darrick J. Wong --- fs/xfs/scrub/nlinks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/xfs/scrub/nlinks.c') diff --git a/fs/xfs/scrub/nlinks.c b/fs/xfs/scrub/nlinks.c index 9b15687386d8..2d75095a365a 100644 --- a/fs/xfs/scrub/nlinks.c +++ b/fs/xfs/scrub/nlinks.c @@ -60,7 +60,9 @@ xchk_setup_nlinks( * set the INCOMPLETE flag even when a negative errno is returned. This care * must be taken with certain errno values (i.e. EFSBADCRC, EFSCORRUPTED, * ECANCELED) that are absorbed into a scrub state flag update by - * xchk_*_process_error. + * xchk_*_process_error. Scrub and repair share the same incore data + * structures, so the INCOMPLETE flag is critical to prevent a repair based on + * insufficient information. * * Because we are scanning a live filesystem, it's possible that another thread * will try to update the link counts for an inode that we've already scanned. -- cgit v1.2.3