]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: fix maxlevels comparisons in the btree staging code
authorDarrick J. Wong <djwong@kernel.org>
Thu, 6 Jan 2022 22:13:18 +0000 (14:13 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 20 Jan 2022 00:02:51 +0000 (16:02 -0800)
commit93c430f5694d3d42d6423542a3b54c5f50391f40
tree1c3f643d526dcb718ec79846882ec24b8af37e91
parenta213df931b156ee55e29de87d84d5bf24d486a2d
xfs: fix maxlevels comparisons in the btree staging code

Source kernel commit: 78e8ec83a404d63dcc86b251f42e4ee8aff27465

The btree geometry computation function has an off-by-one error in that
it does not allow maximally tall btrees (nlevels == XFS_BTREE_MAXLEVELS).
This can result in repairs failing unnecessarily on very fragmented
filesystems.  Subsequent patches to remove MAXLEVELS usage in favor of
the per-btree type computations will make this a much more likely
occurrence.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_btree_staging.c