| To: | david@xxxxxxxxxxxxx, darrick.wong@xxxxxxxxxx |
|---|---|
| Subject: | [PATCH 4/5] xfs: simple btree query range should look right if LE lookup fails |
| From: | "Darrick J. Wong" <darrick.wong@xxxxxxxxxx> |
| Date: | Tue, 23 Aug 2016 19:20:53 -0700 |
| Cc: | linux-xfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <147200522764.14738.15186015137934319456.stgit@xxxxxxxxxxxxxxxx> |
| References: | <147200522764.14738.15186015137934319456.stgit@xxxxxxxxxxxxxxxx> |
| User-agent: | StGit/0.17.1-dirty |
If the initial LOOKUP_LE in the simple query range fails to find
anything, we should attempt to increment the btree cursor to see
if there actually /are/ records for what we're trying to find.
Without this patch, a bnobt range query of (0, $agsize) returns
no results because the leftmost record never has a startblock
of zero.
Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
fs/xfs/libxfs/xfs_btree.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index b70d9f9..0856979 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -4558,6 +4558,13 @@ xfs_btree_simple_query_range(
if (error)
goto out;
+ /* Nothing? See if there's anything to the right. */
+ if (!stat) {
+ error = xfs_btree_increment(cur, 0, &stat);
+ if (error)
+ goto out;
+ }
+
while (stat) {
/* Find the record. */
error = xfs_btree_get_rec(cur, &recp, &stat);
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 3/5] xfs: fix some key handling problems in _btree_simple_query_range, Darrick J. Wong |
|---|---|
| Next by Date: | [PATCH 5/5] xfs: disallow mounting of realtime + rmap filesystems, Darrick J. Wong |
| Previous by Thread: | Re: [PATCH 3/5] xfs: fix some key handling problems in _btree_simple_query_range, Christoph Hellwig |
| Next by Thread: | Re: [PATCH 4/5] xfs: simple btree query range should look right if LE lookup fails, Christoph Hellwig |
| Indexes: | [Date] [Thread] [Top] [All Lists] |