summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-08-26 15:59:50 +1000
committerDave Chinner <david@fromorbit.com>2016-08-26 15:59:50 +1000
commit722278997bc964349e23e7061d541f8df3133a04 (patch)
tree0efa953e0bf26f58c248dd5babe68a5f19004d56 /fs/xfs
parentda1f039d6947b1a49f13b39a6de0df2a3e9e1ed1 (diff)
downloadlinux-stable-722278997bc964349e23e7061d541f8df3133a04.tar.gz
linux-stable-722278997bc964349e23e7061d541f8df3133a04.tar.bz2
linux-stable-722278997bc964349e23e7061d541f8df3133a04.zip
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>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/libxfs/xfs_btree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 33f14067c320..b70d9f918156 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/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;