[GFS2] fix gfs2 block allocation (cleaned up)
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 24 Jun 2008 17:53:38 +0000 (12:53 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 24 Jun 2008 18:02:28 +0000 (19:02 +0100)
commit5af4e7a0bea715f2dd7190859a43eb2258b1f388
tree3b2ab96e295ba9036fd5de6ccf45f95c8229c6e5
parent17c15da00c0e7289375ad57e8fea0c7892b74aa0
[GFS2] fix gfs2 block allocation (cleaned up)

This patch fixes bz 450641.

This patch changes the computation for zero_metapath_length(), which it
renames to metapath_branch_start(). When you are extending the metadata
tree, The indirect blocks that point to the new data block must either
diverge from the existing tree either at the inode, or at the first
indirect block. They can diverge at the first indirect block because the
inode has room for 483 pointers while the indirect blocks have room for
509 pointers, so when the tree is grown, there is some free space in the
first indirect block. What metapath_branch_start() now computes is the
height where the first indirect block for the new data block is located.
It can either be 1 (if the indirect block diverges from the inode) or 2
(if it diverges from the first indirect block).

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/bmap.c