GFS2: reserve more blocks for transactions

Some of the functions in GFS2 were not reserving space in the transaction for
the resource group header and the resource groups bitblocks that get added
when you do allocation. GFS2 now makes sure to reserve space for the
resource group header and either all the bitblocks in the resource group, or
one for each block that it may allocate, whichever is smaller using the new
gfs2_rg_blocks() inline function.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
Benjamin Marzinski
2010-09-27 16:00:04 -05:00
committed by Steven Whitehouse
parent d0795f9123
commit bf97b6734e
7 changed files with 20 additions and 7 deletions

View File

@@ -1151,7 +1151,7 @@ static int do_grow(struct inode *inode, u64 size)
goto do_grow_qunlock;
}
error = gfs2_trans_begin(sdp, RES_DINODE + 1, 0);
error = gfs2_trans_begin(sdp, RES_DINODE + RES_STATFS + RES_RG_BIT, 0);
if (error)
goto do_grow_release;