From: Christoph Hellwig Date: Fri, 17 Nov 2017 04:11:35 +0000 (-0600) Subject: xfs: fix number of records handling in xfs_iext_split_leaf X-Git-Tag: v4.15.0-rc1~143^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd4c3ba5ec7e7f10db7b87fd5292483886dad213;p=thirdparty%2Fxfsprogs-dev.git xfs: fix number of records handling in xfs_iext_split_leaf Source kernel commit: 43d193aa0212691254d574b8d207609ef22018b8 Fix to check the correct value, and remove a duplicate handling of the uneven record number split algorith, Reported-by: Brian Foster Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_iext_tree.c b/libxfs/xfs_iext_tree.c index 395cbfe1d..7f99d76ce 100644 --- a/libxfs/xfs_iext_tree.c +++ b/libxfs/xfs_iext_tree.c @@ -555,16 +555,13 @@ xfs_iext_split_leaf( int i; /* for sequential append operations just spill over into the new node */ - if (cur->pos == KEYS_PER_NODE) { + if (cur->pos == RECS_PER_LEAF) { cur->leaf = new; cur->pos = 0; *nr_entries = 0; goto done; } - if (nr_keep & 1) - nr_keep++; - for (i = 0; i < nr_move; i++) { new->recs[i] = leaf->recs[nr_keep + i]; xfs_iext_rec_clear(&leaf->recs[nr_keep + i]);