]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: avoid buffer deadlocks when walking fs inodes
authorDarrick J. Wong <djwong@kernel.org>
Fri, 6 Aug 2021 18:05:43 +0000 (11:05 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 9 Aug 2021 18:13:16 +0000 (11:13 -0700)
commitab6de9d3a832c45534fb680832c5bf46848f9137
tree63ab7374508a4d1580f3251821b2d0f8dc932300
parenta3bcafc00d640aa2833ffb7b25d0d5e7d1dbe65d
xfs: avoid buffer deadlocks when walking fs inodes

When we're servicing an INUMBERS or BULKSTAT request or running
quotacheck, grab an empty transaction so that we can use its inherent
recursive buffer locking abilities to detect inode btree cycles without
hitting ABBA buffer deadlocks.  This patch requires the deferred inode
inactivation patchset because xfs_irele cannot directly call
xfs_inactive when the iwalk itself has an (empty) transaction.

Found by fuzzing an inode btree pointer to introduce a cycle into the
tree (xfs/365).

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_itable.c
fs/xfs/xfs_iwalk.c