| .. | .. |
|---|
| 794 | 794 | } |
|---|
| 795 | 795 | spin_lock(&ctl->tree_lock); |
|---|
| 796 | 796 | ret = link_free_space(ctl, e); |
|---|
| 797 | | - ctl->total_bitmaps++; |
|---|
| 798 | | - ctl->op->recalc_thresholds(ctl); |
|---|
| 799 | | - spin_unlock(&ctl->tree_lock); |
|---|
| 800 | 797 | if (ret) { |
|---|
| 798 | + spin_unlock(&ctl->tree_lock); |
|---|
| 801 | 799 | btrfs_err(fs_info, |
|---|
| 802 | 800 | "Duplicate entries in free space cache, dumping"); |
|---|
| 803 | 801 | kmem_cache_free(btrfs_free_space_cachep, e); |
|---|
| 804 | 802 | goto free_cache; |
|---|
| 805 | 803 | } |
|---|
| 804 | + ctl->total_bitmaps++; |
|---|
| 805 | + ctl->op->recalc_thresholds(ctl); |
|---|
| 806 | + spin_unlock(&ctl->tree_lock); |
|---|
| 806 | 807 | list_add_tail(&e->list, &bitmaps); |
|---|
| 807 | 808 | } |
|---|
| 808 | 809 | |
|---|