[PATCH] Btrfs: make sure we call recalculate_thresholds() in btrfs_remove_free_space()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



we should recalculate the thresholds everytime when we add/free a bitmap,
make sure we do this in btrfs_remove_free_space() by calling free_bitmap(),Thanks

Signed-off-by: Li Dongyang <lidongyang@xxxxxxxxxx>
---
 fs/btrfs/free-space-cache.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index a039065..f631817 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1515,12 +1515,12 @@ again:
 	}
 
 	if (info->bytes == bytes) {
-		unlink_free_space(block_group, info);
-		if (info->bitmap) {
-			kfree(info->bitmap);
-			block_group->total_bitmaps--;
+		if (info->bitmap)
+			free_bitmap(block_group, info);
+		else {
+			unlink_free_space(block_group, info);
+			kfree(info);
 		}
-		kfree(info);
 		goto out_lock;
 	}
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux