提交 e457afec 编写于 作者: Y Yan Zheng 提交者: Chris Mason

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: NYan Zheng <zheng.yan@oracle.com>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 bf1fb512
......@@ -4146,7 +4146,8 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
* 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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册