diff options
author | Christoph Hellwig <hch@lst.de> | 2017-11-09 12:11:41 -0500 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-11-09 17:08:53 -0500 |
commit | 43d193aa0212691254d574b8d207609ef22018b8 (patch) | |
tree | 4e1e44aa97d2f1934536fac260d238796cdef322 | |
parent | 478f8da0f7c95f847a02f8e3b808926c894e3830 (diff) |
xfs: fix number of records handling in xfs_iext_split_leaf
Fix to check the correct value, and remove a duplicate handling of the
uneven record number split algorith,
Reported-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r-- | fs/xfs/libxfs/xfs_iext_tree.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_iext_tree.c b/fs/xfs/libxfs/xfs_iext_tree.c index 00d660dcb05e..85d7f708eafc 100644 --- a/fs/xfs/libxfs/xfs_iext_tree.c +++ b/fs/xfs/libxfs/xfs_iext_tree.c | |||
@@ -555,16 +555,13 @@ xfs_iext_split_leaf( | |||
555 | int i; | 555 | int i; |
556 | 556 | ||
557 | /* for sequential append operations just spill over into the new node */ | 557 | /* for sequential append operations just spill over into the new node */ |
558 | if (cur->pos == KEYS_PER_NODE) { | 558 | if (cur->pos == RECS_PER_LEAF) { |
559 | cur->leaf = new; | 559 | cur->leaf = new; |
560 | cur->pos = 0; | 560 | cur->pos = 0; |
561 | *nr_entries = 0; | 561 | *nr_entries = 0; |
562 | goto done; | 562 | goto done; |
563 | } | 563 | } |
564 | 564 | ||
565 | if (nr_keep & 1) | ||
566 | nr_keep++; | ||
567 | |||
568 | for (i = 0; i < nr_move; i++) { | 565 | for (i = 0; i < nr_move; i++) { |
569 | new->recs[i] = leaf->recs[nr_keep + i]; | 566 | new->recs[i] = leaf->recs[nr_keep + i]; |
570 | xfs_iext_rec_clear(&leaf->recs[nr_keep + i]); | 567 | xfs_iext_rec_clear(&leaf->recs[nr_keep + i]); |