diff mbox

Btrfs: don't add extent 0 to the free space cache

Message ID 4B0CF0F7.7070206@oracle.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Yan, Zheng Nov. 25, 2009, 8:55 a.m. UTC
None
diff mbox

Patch

diff -urp 1/fs/btrfs/extent-tree.c 2/fs/btrfs/extent-tree.c
--- 1/fs/btrfs/extent-tree.c	2009-11-23 13:59:11.415598041 +0800
+++ 2/fs/btrfs/extent-tree.c	2009-11-25 16:20:52.865565692 +0800
@@ -195,6 +195,14 @@  static int exclude_super_stripes(struct 
 	int stripe_len;
 	int i, nr, ret;
 
+	if (cache->key.objectid < BTRFS_SUPER_INFO_OFFSET) {
+		stripe_len = BTRFS_SUPER_INFO_OFFSET - cache->key.objectid;
+		cache->bytes_super += stripe_len;
+		ret = add_excluded_extent(root, cache->key.objectid,
+					  stripe_len);
+		BUG_ON(ret);
+	}
+
 	for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
 		bytenr = btrfs_sb_offset(i);
 		ret = btrfs_rmap_block(&root->fs_info->mapping_tree,