diff options
| author | Yan Zheng <zheng.yan@oracle.com> | 2009-07-22 09:59:00 -0400 |
|---|---|---|
| committer | Chris Mason <chris.mason@oracle.com> | 2009-07-22 09:59:00 -0400 |
| commit | e457afec60fdbd86b963d36f4a8a9285088c6043 (patch) | |
| tree | e3d0add1584cd9edae3dfd24405a13294a2a2280 /fs | |
| parent | bf1fb512a58d7aeb41aaa40d6d2d2d29e08e506a (diff) | |
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>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/btrfs/ctree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 60a45f3a4e91..7bb66c65ddfd 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
| @@ -4146,7 +4146,8 @@ again: | |||
| 4146 | * advance the path if there are now more items available. | 4146 | * advance the path if there are now more items available. |
| 4147 | */ | 4147 | */ |
| 4148 | if (nritems > 0 && path->slots[0] < nritems - 1) { | 4148 | if (nritems > 0 && path->slots[0] < nritems - 1) { |
| 4149 | path->slots[0]++; | 4149 | if (ret == 0) |
| 4150 | path->slots[0]++; | ||
| 4150 | ret = 0; | 4151 | ret = 0; |
| 4151 | goto done; | 4152 | goto done; |
| 4152 | } | 4153 | } |
