]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: don't dirty inodes unconditionally when testing unlinked state
authorDave Chinner <dchinner@redhat.com>
Tue, 30 Oct 2018 23:24:08 +0000 (18:24 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 30 Oct 2018 23:24:08 +0000 (18:24 -0500)
commit119383bf67fae3cda3cfb81eee0122f97c2fc938
treeb8d90c31415459333f694afd089908e8940edfaa
parent71a6af8568127a546b282267e20653631a486cd6
xfs_repair: don't dirty inodes unconditionally when testing unlinked state

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 making clear_inode_unlinked unconditionally do the clear
(as was done for clear_inode), and move the test to the caller.
Add warnings as well so that this corruption is no longer silently
fixed.

Fixes: 0724d0f ("xfs_repair: clear_dinode should simply clear, ...")
Signed-off-by: Dave Chinner <dchinner@redhat.com>
[sandeen: rework so clear_inode_unlinked is unconditional]
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/dinode.c