From: Benjamin Marzinski <bmarzins@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 Patch] bz 450641 - fix gfs2 block allocation
Date: Tue, 17 Jun 2008 17:06:05 -0500 [thread overview]
Message-ID: <20080617220605.GA18264@ether.msp.redhat.com> (raw)
This patch fixes bz 450641.
This patch changes the computation for zero_metapath_length(). 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 zero_metapath_length 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).
The previous computation for this was incorrect.
-Ben
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
bmap.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
-------------- next part --------------
Index: gfs2-2.6-nmw/fs/gfs2/bmap.c
===================================================================
--- gfs2-2.6-nmw.orig/fs/gfs2/bmap.c
+++ gfs2-2.6-nmw/fs/gfs2/bmap.c
@@ -249,12 +249,9 @@ static void find_metapath(const struct g
static inline unsigned int zero_metapath_length(const struct metapath *mp,
unsigned height)
{
- unsigned int i;
- for (i = 0; i < height - 1; i++) {
- if (mp->mp_list[i] != 0)
- return i;
- }
- return height;
+ if (mp->mp_list[0] == 0)
+ return 2;
+ return 1;
}
/**
next reply other threads:[~2008-06-17 22:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-17 22:06 Benjamin Marzinski [this message]
2008-06-24 10:34 ` [Cluster-devel] [GFS2 Patch] bz 450641 - fix gfs2 block allocation Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080617220605.GA18264@ether.msp.redhat.com \
--to=bmarzins@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.