diff options
author | Josef Bacik <josef@redhat.com> | 2009-07-31 11:03:58 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-07-31 11:03:58 -0400 |
commit | 6606bb97e146a387932efee263745b7240a11193 (patch) | |
tree | 76652e563a889cc03d7d179074bb1aab9ef3a3f4 /usr | |
parent | f36f3042eae238bdaefe7c79310afe573bfc3622 (diff) |
Btrfs: fix btrfs_remove_from_free_space corner case
Yan Zheng hit a problem where we tried to remove some free space but failed
because we couldn't find the free space entry. This is because the free space
was held within a bitmap that had a starting offset well before the actual
offset of the free space, and there were free space extents that were in the
same range as that offset, so tree_search_offset returned with NULL because we
couldn't find a free space extent that had that offset. This is fixed by
making sure that if we fail to find the entry, we re-search again with
bitmap_only set to 1 and do an offset_to_bitmap so we can get the appropriate
bitmap. A similar problem happens in btrfs_alloc_from_bitmap for the
clustering code, but that is not as bad since we will just go and redo our
cluster allocation.
Also this adds some debugging checks to make sure that the free space we are
trying to remove from the bitmap is in fact there. This can probably go away
after a while, but since this code is only used by the tree-logging stuff it
would be nice to run with it for a while to make sure there are no problems.
Signed-off-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions