aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-09-27 14:57:43 -0400
committerChris Mason <chris.mason@fusionio.com>2013-11-11 21:53:36 -0500
commitb6d08f0630d51ec09d67f16f6d7839699bbc0402 (patch)
treebd5ce42326af0959a1839f9582c76df68bf3e6d0 /fs/btrfs/inode.c
parente0228285a8cad70e4b7b4833cc650e36ecd8de89 (diff)
Btrfs: do not release metadata for space cache inodes
I've been testing our error paths and I was tripping the BUG_ON() in drop_outstanding_extent because our outstanding_extents is 0 for space cache inodes. This is because we don't reserve metadata space for these inodes since we depend on the global block reserve for our space. To fix this we need to make sure the DO_ACCOUNTING stuff doesn't actually call release_metadata for space cache inodes. With this patch I'm no longer panicing. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 939dd1ff34a7..c0dcb4c3d72d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1551,7 +1551,13 @@ static void btrfs_clear_bit_hook(struct inode *inode,
1551 spin_unlock(&BTRFS_I(inode)->lock); 1551 spin_unlock(&BTRFS_I(inode)->lock);
1552 } 1552 }
1553 1553
1554 if (*bits & EXTENT_DO_ACCOUNTING) 1554 /*
1555 * We don't reserve metadata space for space cache inodes so we
1556 * don't need to call dellalloc_release_metadata if there is an
1557 * error.
1558 */
1559 if (*bits & EXTENT_DO_ACCOUNTING &&
1560 root != root->fs_info->tree_root)
1555 btrfs_delalloc_release_metadata(inode, len); 1561 btrfs_delalloc_release_metadata(inode, len);
1556 1562
1557 if (root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID 1563 if (root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID