diff options
author | Tao Ma <tao.ma@oracle.com> | 2010-03-22 02:20:18 -0400 |
---|---|---|
committer | Tao Ma <tao.ma@oracle.com> | 2010-03-22 02:20:18 -0400 |
commit | 74380c479ad83addeff8a172ab95f59557b5b0c3 (patch) | |
tree | 49b94f3ff48cd2ca6b53977a5e3070380ccecd6b /fs/ocfs2/refcounttree.c | |
parent | af2bf0d86019e0b0306965321096f8380b7ca830 (diff) |
ocfs2: Free block to the right block group.
In case the block we are going to free is allocated from
a discontiguous block group, we have to use suballoc_loc
to be the right group.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'fs/ocfs2/refcounttree.c')
-rw-r--r-- | fs/ocfs2/refcounttree.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 275920e8a40d..b34702984225 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
@@ -792,7 +792,10 @@ int ocfs2_remove_refcount_tree(struct inode *inode, struct buffer_head *di_bh) | |||
792 | if (le32_to_cpu(rb->rf_count) == 1) { | 792 | if (le32_to_cpu(rb->rf_count) == 1) { |
793 | blk = le64_to_cpu(rb->rf_blkno); | 793 | blk = le64_to_cpu(rb->rf_blkno); |
794 | bit = le16_to_cpu(rb->rf_suballoc_bit); | 794 | bit = le16_to_cpu(rb->rf_suballoc_bit); |
795 | bg_blkno = ocfs2_which_suballoc_group(blk, bit); | 795 | if (rb->rf_suballoc_loc) |
796 | bg_blkno = le64_to_cpu(rb->rf_suballoc_loc); | ||
797 | else | ||
798 | bg_blkno = ocfs2_which_suballoc_group(blk, bit); | ||
796 | 799 | ||
797 | alloc_inode = ocfs2_get_system_file_inode(osb, | 800 | alloc_inode = ocfs2_get_system_file_inode(osb, |
798 | EXTENT_ALLOC_SYSTEM_INODE, | 801 | EXTENT_ALLOC_SYSTEM_INODE, |
@@ -2108,6 +2111,7 @@ static int ocfs2_remove_refcount_extent(handle_t *handle, | |||
2108 | */ | 2111 | */ |
2109 | ret = ocfs2_cache_block_dealloc(dealloc, EXTENT_ALLOC_SYSTEM_INODE, | 2112 | ret = ocfs2_cache_block_dealloc(dealloc, EXTENT_ALLOC_SYSTEM_INODE, |
2110 | le16_to_cpu(rb->rf_suballoc_slot), | 2113 | le16_to_cpu(rb->rf_suballoc_slot), |
2114 | le64_to_cpu(rb->rf_suballoc_loc), | ||
2111 | le64_to_cpu(rb->rf_blkno), | 2115 | le64_to_cpu(rb->rf_blkno), |
2112 | le16_to_cpu(rb->rf_suballoc_bit)); | 2116 | le16_to_cpu(rb->rf_suballoc_bit)); |
2113 | if (ret) { | 2117 | if (ret) { |