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/xattr.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/xattr.c')
-rw-r--r-- | fs/ocfs2/xattr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 805167e226c1..a1cf195935cf 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -2466,7 +2466,10 @@ static int ocfs2_xattr_free_block(struct inode *inode, | |||
2466 | xb = (struct ocfs2_xattr_block *)blk_bh->b_data; | 2466 | xb = (struct ocfs2_xattr_block *)blk_bh->b_data; |
2467 | blk = le64_to_cpu(xb->xb_blkno); | 2467 | blk = le64_to_cpu(xb->xb_blkno); |
2468 | bit = le16_to_cpu(xb->xb_suballoc_bit); | 2468 | bit = le16_to_cpu(xb->xb_suballoc_bit); |
2469 | bg_blkno = ocfs2_which_suballoc_group(blk, bit); | 2469 | if (xb->xb_suballoc_loc) |
2470 | bg_blkno = le64_to_cpu(xb->xb_suballoc_loc); | ||
2471 | else | ||
2472 | bg_blkno = ocfs2_which_suballoc_group(blk, bit); | ||
2470 | 2473 | ||
2471 | xb_alloc_inode = ocfs2_get_system_file_inode(osb, | 2474 | xb_alloc_inode = ocfs2_get_system_file_inode(osb, |
2472 | EXTENT_ALLOC_SYSTEM_INODE, | 2475 | EXTENT_ALLOC_SYSTEM_INODE, |