mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 14:40:53 +07:00
xfs: fix some key handling problems in _btree_simple_query_range
We only need the record's high key for the first record that we look at; for all records, we /definitely/ need the regular record key. Therefore, fix how the simple range query function gets its keys. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
da1f039d69
commit
722278997b
@ -4563,10 +4563,10 @@ xfs_btree_simple_query_range(
|
||||
error = xfs_btree_get_rec(cur, &recp, &stat);
|
||||
if (error || !stat)
|
||||
break;
|
||||
cur->bc_ops->init_high_key_from_rec(&rec_key, recp);
|
||||
|
||||
/* Skip if high_key(rec) < low_key. */
|
||||
if (firstrec) {
|
||||
cur->bc_ops->init_high_key_from_rec(&rec_key, recp);
|
||||
firstrec = false;
|
||||
diff = cur->bc_ops->diff_two_keys(cur, low_key,
|
||||
&rec_key);
|
||||
@ -4575,6 +4575,7 @@ xfs_btree_simple_query_range(
|
||||
}
|
||||
|
||||
/* Stop if high_key < low_key(rec). */
|
||||
cur->bc_ops->init_key_from_rec(&rec_key, recp);
|
||||
diff = cur->bc_ops->diff_two_keys(cur, &rec_key, high_key);
|
||||
if (diff > 0)
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user