mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
xfs: simple btree query range should look right if LE lookup fails
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@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
722278997b
commit
5b5c2dbd3c
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue