Btrfs: fix double increment of path->slots[0] in btrfs_next_leaf
if 1 is returned by btrfs_search_slot, the path already points to the first item with 'key > searching key'. So increasing path->slots[0] by one is superfluous in that case. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
bf1fb512a5
commit
e457afec60
1 changed files with 2 additions and 1 deletions
|
@ -4146,7 +4146,8 @@ again:
|
|||
* advance the path if there are now more items available.
|
||||
*/
|
||||
if (nritems > 0 && path->slots[0] < nritems - 1) {
|
||||
path->slots[0]++;
|
||||
if (ret == 0)
|
||||
path->slots[0]++;
|
||||
ret = 0;
|
||||
goto done;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue