]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: fix maxlevels comparisons in the btree staging code
authorDarrick J. Wong <djwong@kernel.org>
Thu, 21 Jul 2022 21:36:05 +0000 (14:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:25:08 +0000 (17:25 +0200)
commitaacbcc03a6ea939901318f55a9e57a24998df2b5
tree6119c505f07ecf648ca68630253d38e2d2d19bac
parent343c456954589ade44e474aeb87780ccb089739f
xfs: fix maxlevels comparisons in the btree staging code

[ Upstream commit 26c0e13cbccd4a26364758f528b89366673ed3d8 ]

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: Leah Rumancik <leah.rumancik@gmail.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/libxfs/xfs_btree_staging.c