diff options
-rw-r--r-- | fs/btrfs/tree-log.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 31b46a9e94cc..179fda964601 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -2901,6 +2901,7 @@ static int drop_objectid_items(struct btrfs_trans_handle *trans, | |||
2901 | int ret; | 2901 | int ret; |
2902 | struct btrfs_key key; | 2902 | struct btrfs_key key; |
2903 | struct btrfs_key found_key; | 2903 | struct btrfs_key found_key; |
2904 | int start_slot; | ||
2904 | 2905 | ||
2905 | key.objectid = objectid; | 2906 | key.objectid = objectid; |
2906 | key.type = max_key_type; | 2907 | key.type = max_key_type; |
@@ -2922,8 +2923,18 @@ static int drop_objectid_items(struct btrfs_trans_handle *trans, | |||
2922 | if (found_key.objectid != objectid) | 2923 | if (found_key.objectid != objectid) |
2923 | break; | 2924 | break; |
2924 | 2925 | ||
2925 | ret = btrfs_del_item(trans, log, path); | 2926 | found_key.offset = 0; |
2926 | if (ret) | 2927 | found_key.type = 0; |
2928 | ret = btrfs_bin_search(path->nodes[0], &found_key, 0, | ||
2929 | &start_slot); | ||
2930 | |||
2931 | ret = btrfs_del_items(trans, log, path, start_slot, | ||
2932 | path->slots[0] - start_slot + 1); | ||
2933 | /* | ||
2934 | * If start slot isn't 0 then we don't need to re-search, we've | ||
2935 | * found the last guy with the objectid in this tree. | ||
2936 | */ | ||
2937 | if (ret || start_slot != 0) | ||
2927 | break; | 2938 | break; |
2928 | btrfs_release_path(path); | 2939 | btrfs_release_path(path); |
2929 | } | 2940 | } |