aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/disk-io.c15
-rw-r--r--fs/btrfs/disk-io.h4
2 files changed, 12 insertions, 7 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 534266fe505f..d52ec1155204 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1109,8 +1109,8 @@ struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr,
1109 1109
1110} 1110}
1111 1111
1112int clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root, 1112void clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root,
1113 struct extent_buffer *buf) 1113 struct extent_buffer *buf)
1114{ 1114{
1115 struct inode *btree_inode = root->fs_info->btree_inode; 1115 struct inode *btree_inode = root->fs_info->btree_inode;
1116 if (btrfs_header_generation(buf) == 1116 if (btrfs_header_generation(buf) ==
@@ -1121,8 +1121,14 @@ int clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root,
1121 spin_lock(&root->fs_info->delalloc_lock); 1121 spin_lock(&root->fs_info->delalloc_lock);
1122 if (root->fs_info->dirty_metadata_bytes >= buf->len) 1122 if (root->fs_info->dirty_metadata_bytes >= buf->len)
1123 root->fs_info->dirty_metadata_bytes -= buf->len; 1123 root->fs_info->dirty_metadata_bytes -= buf->len;
1124 else 1124 else {
1125 WARN_ON(1); 1125 spin_unlock(&root->fs_info->delalloc_lock);
1126 btrfs_panic(root->fs_info, -EOVERFLOW,
1127 "Can't clear %lu bytes from "
1128 " dirty_mdatadata_bytes (%lu)",
1129 buf->len,
1130 root->fs_info->dirty_metadata_bytes);
1131 }
1126 spin_unlock(&root->fs_info->delalloc_lock); 1132 spin_unlock(&root->fs_info->delalloc_lock);
1127 } 1133 }
1128 1134
@@ -1131,7 +1137,6 @@ int clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root,
1131 clear_extent_buffer_dirty(&BTRFS_I(btree_inode)->io_tree, 1137 clear_extent_buffer_dirty(&BTRFS_I(btree_inode)->io_tree,
1132 buf); 1138 buf);
1133 } 1139 }
1134 return 0;
1135} 1140}
1136 1141
1137static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize, 1142static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
index e4bc4741319b..ca34237ae384 100644
--- a/fs/btrfs/disk-io.h
+++ b/fs/btrfs/disk-io.h
@@ -44,8 +44,8 @@ int reada_tree_block_flagged(struct btrfs_root *root, u64 bytenr, u32 blocksize,
44 int mirror_num, struct extent_buffer **eb); 44 int mirror_num, struct extent_buffer **eb);
45struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root, 45struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
46 u64 bytenr, u32 blocksize); 46 u64 bytenr, u32 blocksize);
47int clean_tree_block(struct btrfs_trans_handle *trans, 47void clean_tree_block(struct btrfs_trans_handle *trans,
48 struct btrfs_root *root, struct extent_buffer *buf); 48 struct btrfs_root *root, struct extent_buffer *buf);
49int open_ctree(struct super_block *sb, 49int open_ctree(struct super_block *sb,
50 struct btrfs_fs_devices *fs_devices, 50 struct btrfs_fs_devices *fs_devices,
51 char *options); 51 char *options);