Patch "xfs: fix maxlevels comparisons in the btree staging code" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    xfs: fix maxlevels comparisons in the btree staging code

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xfs-fix-maxlevels-comparisons-in-the-btree-staging-code.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From foo@baz Sat Jul 23 05:23:15 PM CEST 2022
From: Leah Rumancik <leah.rumancik@xxxxxxxxx>
Date: Thu, 21 Jul 2022 14:36:05 -0700
Subject: xfs: fix maxlevels comparisons in the btree staging code
To: stable@xxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxxxxxx
Cc: amir73il@xxxxxxxxx, "Darrick J. Wong" <djwong@xxxxxxxxxx>, Chandan Babu R <chandan.babu@xxxxxxxxxx>, Christoph Hellwig <hch@xxxxxx>, Leah Rumancik <leah.rumancik@xxxxxxxxx>
Message-ID: <20220721213610.2794134-2-leah.rumancik@xxxxxxxxx>

From: "Darrick J. Wong" <djwong@xxxxxxxxxx>

[ Upstream 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@xxxxxxxxxx>
Reviewed-by: Chandan Babu R <chandan.babu@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Leah Rumancik <leah.rumancik@xxxxxxxxx>
Acked-by: Darrick J. Wong <djwong@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/xfs/libxfs/xfs_btree_staging.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/xfs/libxfs/xfs_btree_staging.c
+++ b/fs/xfs/libxfs/xfs_btree_staging.c
@@ -662,7 +662,7 @@ xfs_btree_bload_compute_geometry(
 	xfs_btree_bload_ensure_slack(cur, &bbl->node_slack, 1);
 
 	bbl->nr_records = nr_this_level = nr_records;
-	for (cur->bc_nlevels = 1; cur->bc_nlevels < XFS_BTREE_MAXLEVELS;) {
+	for (cur->bc_nlevels = 1; cur->bc_nlevels <= XFS_BTREE_MAXLEVELS;) {
 		uint64_t	level_blocks;
 		uint64_t	dontcare64;
 		unsigned int	level = cur->bc_nlevels - 1;
@@ -724,7 +724,7 @@ xfs_btree_bload_compute_geometry(
 		nr_this_level = level_blocks;
 	}
 
-	if (cur->bc_nlevels == XFS_BTREE_MAXLEVELS)
+	if (cur->bc_nlevels > XFS_BTREE_MAXLEVELS)
 		return -EOVERFLOW;
 
 	bbl->btree_height = cur->bc_nlevels;


Patches currently in stable-queue which might be from leah.rumancik@xxxxxxxxx are

queue-5.15/xfs-prevent-a-warn_once-in-xfs_ioc_attr_list.patch
queue-5.15/xfs-rename-the-next_agno-perag-iteration-variable.patch
queue-5.15/xfs-fix-perag-reference-leak-on-iteration-race-with-growfs.patch
queue-5.15/xfs-terminate-perag-iteration-reliably-on-agcount.patch
queue-5.15/xfs-fold-perag-loop-iteration-logic-into-helper-function.patch
queue-5.15/xfs-fix-maxlevels-comparisons-in-the-btree-staging-code.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux