* [PATCH] Btrfs: don't add extent 0 to the free space cache
@ 2009-11-25 8:55 Yan, Zheng
0 siblings, 0 replies; only message in thread
From: Yan, Zheng @ 2009-11-25 8:55 UTC (permalink / raw)
To: linux-btrfs, chris Mason
If block group 0 is completely free, btrfs_read_block_groups will
add extent [0, BTRFS_SUPER_INFO_OFFSET) to the free space cache.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
---
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,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-11-25 8:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 8:55 [PATCH] Btrfs: don't add extent 0 to the free space cache Yan, Zheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox