提交 5b5c2dbd 编写于 作者: D Darrick J. Wong 提交者: Dave Chinner

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: NDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 72227899
...@@ -4558,6 +4558,13 @@ xfs_btree_simple_query_range( ...@@ -4558,6 +4558,13 @@ xfs_btree_simple_query_range(
if (error) if (error)
goto out; 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) { while (stat) {
/* Find the record. */ /* Find the record. */
error = xfs_btree_get_rec(cur, &recp, &stat); error = xfs_btree_get_rec(cur, &recp, &stat);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册