[Btrfs-devel] two tiny fix for extent-tree.c
Yan Zheng
yanzheng at 21cn.com
Sat Aug 25 02:32:14 PDT 2007
hello
I do a few test to what happen in disk full conditions and encounter
a null pointer dereference bugs several time. After do the change
attached below, I never met that bug again.
Regards
YZ
diff -r 6125224d77d0 extent-tree.c
--- a/extent-tree.c Fri Aug 10 16:22:09 2007 -0400
+++ b/extent-tree.c Sat Aug 25 16:23:53 2007 +0800
@@ -246,7 +246,7 @@ struct btrfs_block_group_cache *btrfs_fi
if (search_start) {
struct btrfs_block_group_cache *shint;
shint = btrfs_lookup_block_group(info, search_start);
- if (shint->data == data) {
+ if (shint && shint->data == data) {
used = btrfs_block_group_used(&shint->item);
if (used + shint->pinned <
div_factor(shint->key.offset, factor)) {
@@ -1251,8 +1251,7 @@ struct buffer_head *btrfs_alloc_free_blo
struct buffer_head *buf;
ret = btrfs_alloc_extent(trans, root, root->root_key.objectid,
- 1, empty_size, hint,
- (unsigned long)-1, &ins, 0);
+ 1, empty_size, hint, (u64)-1, &ins, 0);
if (ret) {
BUG_ON(ret > 0);
return ERR_PTR(ret);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extent-tree.patch
Type: text/x-patch
Size: 838 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/btrfs-devel/attachments/20070825/dccbbbf1/extent-tree.bin
More information about the Btrfs-devel
mailing list