On Tue, Oct 30, 2018 at 10:20:38PM +1100, Dave Chinner wrote: > From: Dave Chinner <dchinner@xxxxxxxxxx> > > I noticed phase 4 writing back lots of inode buffers during recent > testing. The recent rework of clear_inode() in commit 0724d0f4cb53 > ("xfs_repair: clear_dinode should simply clear, not check contents") > accidentally caught a call to clear_inode_unlinked() as well, > resulting in all inodes being marked dirty whether then needed > updating or not. > > Fix it by reverting the erroneous hunk and adding warnings so taht > this corruption is no longer silently fixed. > > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx> Oops... that explains a lot. :/ Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --D > --- > repair/dinode.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/repair/dinode.c b/repair/dinode.c > index 379f85cf1268..90400128d4bb 100644 > --- a/repair/dinode.c > +++ b/repair/dinode.c > @@ -2675,9 +2675,15 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"), > * we're going to find. check_dups is set to 1 only during > * phase 4. Ugly. > */ > - if (check_dups && !no_modify) { > - clear_dinode_unlinked(mp, dino); > - *dirty += 1; > + if (check_dups && clear_dinode_unlinked(mp, dino)) { > + if (no_modify) { > + do_warn( > + _("Would clear unlinked_next in inode %" PRIu64 "\n"), lino); > + } else { > + do_warn( > + _("Cleared unlinked_next in inode %" PRIu64 "\n"), lino); > + *dirty += 1; > + } > } > > /* set type and map type info */ > -- > 2.19.1 >