diff options
| author | Dave Chinner <david@fromorbit.com> | 2023-04-14 07:10:32 +1000 |
|---|---|---|
| committer | Dave Chinner <dchinner@redhat.com> | 2023-04-14 07:10:32 +1000 |
| commit | a44667226d32a168a0953f9382cd8503ec947d7d (patch) | |
| tree | dad002cffdfb602ca06bb6c52a24d9d151f2fffe /fs/xfs/scrub/common.c | |
| parent | f697c2cc15bd42e9e0c7c33dea9e9b7b507877d0 (diff) | |
| parent | 0916056eba4fd816f8042a3960597c316ea10256 (diff) | |
Merge tag 'scrub-parent-fixes-6.4_2023-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into guilt/xfs-for-next
xfs: fix bugs in parent pointer checking [v24.5]
Jan Kara pointed out that the VFS doesn't take i_rwsem of a child
subdirectory that is being moved from one parent to another. Upon
deeper analysis, I realized that this was the source of a very hard to
trigger false corruption report in the parent pointer checking code.
Now that we've refactored how directory walks work in scrub, we can also
get rid of all the unnecessary and broken locking to make parent pointer
scrubbing work properly.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/scrub/common.c')
| -rw-r--r-- | fs/xfs/scrub/common.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c index dcfe66044d4a..813ded91661b 100644 --- a/fs/xfs/scrub/common.c +++ b/fs/xfs/scrub/common.c @@ -962,28 +962,6 @@ xchk_metadata_inode_forks( return 0; } -/* - * Try to lock an inode in violation of the usual locking order rules. For - * example, trying to get the IOLOCK while in transaction context, or just - * plain breaking AG-order or inode-order inode locking rules. Either way, - * the only way to avoid an ABBA deadlock is to use trylock and back off if - * we can't. - */ -int -xchk_ilock_inverted( - struct xfs_inode *ip, - uint lock_mode) -{ - int i; - - for (i = 0; i < 20; i++) { - if (xfs_ilock_nowait(ip, lock_mode)) - return 0; - delay(1); - } - return -EDEADLOCK; -} - /* Pause background reaping of resources. */ void xchk_stop_reaping( |
