| To: | david@xxxxxxxxxxxxx, darrick.wong@xxxxxxxxxx |
|---|---|
| Subject: | [PATCH 2/7] xfs: fix some key handling problems in _btree_simple_query_range |
| From: | "Darrick J. Wong" <darrick.wong@xxxxxxxxxx> |
| Date: | Tue, 23 Aug 2016 19:24:37 -0700 |
| Cc: | linux-xfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <147200546481.15538.12724000421579716885.stgit@xxxxxxxxxxxxxxxx> |
| References: | <147200546481.15538.12724000421579716885.stgit@xxxxxxxxxxxxxxxx> |
| User-agent: | StGit/0.17.1-dirty |
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@xxxxxxxxxx>
---
libxfs/xfs_btree.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
index cb671f6..b69c8d2 100644
--- a/libxfs/xfs_btree.c
+++ b/libxfs/xfs_btree.c
@@ -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;
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 1/7] xfs: don't perform lookups on zero-height btrees, Darrick J. Wong |
|---|---|
| Next by Date: | [PATCH 3/7] xfs: simple btree query range should look right if LE lookup fails, Darrick J. Wong |
| Previous by Thread: | Re: [PATCH 1/7] xfs: don't perform lookups on zero-height btrees, Christoph Hellwig |
| Next by Thread: | Re: [PATCH 2/7] xfs: fix some key handling problems in _btree_simple_query_range, Christoph Hellwig |
| Indexes: | [Date] [Thread] [Top] [All Lists] |