]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: drop all altpath buffers at the end of the sibling check
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 25 Mar 2020 03:10:55 +0000 (20:10 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 26 Mar 2020 15:19:24 +0000 (08:19 -0700)
commit64d4cc8d6c8e735fbaa4cab114c02ccd05adcd0c
tree208289f79f1b1e429c574af86275ed37c39823b4
parent69f3ea28d03a3b505f94c10c3c5c50a958a819f4
xfs: drop all altpath buffers at the end of the sibling check

The dirattr btree checking code uses the altpath substructure of the
dirattr state structure to check the sibling pointers of dir/attr tree
blocks.  At the end of sibling checks, xfs_da3_path_shift could have
changed multiple levels of buffer pointers in the altpath structure.
Although we release the leaf level buffer, this isn't enough -- we also
need to release the node buffers that are unique to the altpath.

Not releasing all of the altpath buffers leaves them locked to the
transaction.  This is suboptimal because we should release resources
when we don't need them anymore.  Fix the function to loop all levels of
the altpath, and fix the return logic so that we always run the loop.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/scrub/dabtree.c