Skip to content

Commit

Permalink
btrfs: Remove BUG_ON from __finish_chunk_alloc()
Browse files Browse the repository at this point in the history
btrfs_alloc_chunk() unconditionally BUGs on any error returned from
__finish_chunk_alloc() so there's no need for two BUG_ON lines. Remove the
one from __finish_chunk_alloc().

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
  • Loading branch information
Mark Fasheh authored and David Sterba committed Mar 22, 2012
1 parent 1dd4602 commit 3acd395
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,8 @@ static int __finish_chunk_alloc(struct btrfs_trans_handle *trans,
device = map->stripes[index].dev;
device->bytes_used += stripe_size;
ret = btrfs_update_device(trans, device);
BUG_ON(ret);
if (ret)
goto out_free;
index++;
}

Expand Down Expand Up @@ -3430,6 +3431,7 @@ static int __finish_chunk_alloc(struct btrfs_trans_handle *trans,
item_size);
}

out_free:
kfree(chunk);
return ret;
}
Expand Down

0 comments on commit 3acd395

Please sign in to comment.