aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dir.c
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2010-03-22 02:20:18 -0400
committerTao Ma <tao.ma@oracle.com>2010-03-22 02:20:18 -0400
commit74380c479ad83addeff8a172ab95f59557b5b0c3 (patch)
tree49b94f3ff48cd2ca6b53977a5e3070380ccecd6b /fs/ocfs2/dir.c
parentaf2bf0d86019e0b0306965321096f8380b7ca830 (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/dir.c')
-rw-r--r--fs/ocfs2/dir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 341bb8f811e9..3fea52d0efd3 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -4466,7 +4466,10 @@ static int ocfs2_dx_dir_remove_index(struct inode *dir,
4466 4466
4467 blk = le64_to_cpu(dx_root->dr_blkno); 4467 blk = le64_to_cpu(dx_root->dr_blkno);
4468 bit = le16_to_cpu(dx_root->dr_suballoc_bit); 4468 bit = le16_to_cpu(dx_root->dr_suballoc_bit);
4469 bg_blkno = ocfs2_which_suballoc_group(blk, bit); 4469 if (dx_root->dr_suballoc_loc)
4470 bg_blkno = le64_to_cpu(dx_root->dr_suballoc_loc);
4471 else
4472 bg_blkno = ocfs2_which_suballoc_group(blk, bit);
4470 ret = ocfs2_free_suballoc_bits(handle, dx_alloc_inode, dx_alloc_bh, 4473 ret = ocfs2_free_suballoc_bits(handle, dx_alloc_inode, dx_alloc_bh,
4471 bit, bg_blkno, 1); 4474 bit, bg_blkno, 1);
4472 if (ret) 4475 if (ret)