public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL53 - Use jbsize for height computations on journaled files.
@ 2008-12-10 20:45 Bob Peterson
  0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2008-12-10 20:45 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=86bd22ba38127c3903fe70d6ba548bf475cc5922
Commit:        86bd22ba38127c3903fe70d6ba548bf475cc5922
Parent:        19193c063c6c1831d9ce84aff2987dd706152023
Author:        Bob Peterson <rpeterso@redhat.com>
AuthorDate:    Tue Dec 9 17:12:57 2008 -0600
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Wed Dec 10 14:43:57 2008 -0600

Use jbsize for height computations on journaled files.

bz 475488

This is an addendum patch for bug #471618.
Without this patch, users may encounter an infinite loop
in mkfs.gfs2 if the number of journals causes the block
size to be exceeded for the per_inode system directory.
For a block size of 1K, specifying five journals on
mkfs.gfs2 will cause this problem.  For a default 4K block
size, you would likely need 17 journals to get the hang.
---
 gfs2/convert/gfs2_convert.c |    9 ++++++---
 gfs2/libgfs2/libgfs2.h      |    2 +-
 gfs2/libgfs2/misc.c         |   11 ++++++-----
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 2dbe2ba..1bd4351 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1114,11 +1114,12 @@ static int init(struct gfs2_sbd *sbp)
 	sbp->sd_jbsize = sbp->bsize - sizeof(struct gfs2_meta_header);
 	brelse(bh, not_updated);
 	sbp->sd_max_height = compute_heightsize(sbp, sbp->sd_heightsize,
-						sbp->sd_diptrs,
+						sbp->bsize, sbp->sd_diptrs,
 						sbp->sd_inptrs);
 	sbp->sd_max_jheight = compute_heightsize(sbp, sbp->sd_jheightsize,
-						sbp->sd_diptrs,
-						sbp->sd_inptrs);
+						 sbp->sd_jbsize,
+						 sbp->sd_diptrs,
+						 sbp->sd_inptrs);
 	/* -------------------------------------------------------- */
 	/* Our constants are for gfs1.  Need some for gfs2 as well. */
 	/* -------------------------------------------------------- */
@@ -1126,9 +1127,11 @@ static int init(struct gfs2_sbd *sbp)
                 sizeof(uint64_t); /* How many ptrs can we fit on a block? */
 	memset(gfs2_heightsize, 0, sizeof(gfs2_heightsize));
 	gfs2_max_height = compute_heightsize(sbp, gfs2_heightsize,
+					     sbp->bsize,
 					     sbp->sd_diptrs, gfs2_inptrs);
 	memset(gfs2_jheightsize, 0, sizeof(gfs2_jheightsize));
 	gfs2_max_jheight = compute_heightsize(sbp, gfs2_jheightsize,
+					      sbp->sd_jbsize,
 					      sbp->sd_diptrs, gfs2_inptrs);
 
 	/* ---------------------------------------------- */
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index a18e49b..853c969 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -647,7 +647,7 @@ int gfs2_query(int *setonabort, struct gfs2_options *opts,
 #define SYS_BASE "/sys/fs/gfs2"
 
 uint32_t compute_heightsize(struct gfs2_sbd *sdp, uint64_t *heightsize,
-			    int diptrs, int inptrs);
+			    uint32_t bsize1, int diptrs, int inptrs);
 void compute_constants(struct gfs2_sbd *sdp);
 int find_gfs2_meta(struct gfs2_sbd *sdp);
 int dir_exists(const char *dir);
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 4c7cc5b..1bdbc0f 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -35,12 +35,12 @@
 static char sysfs_buf[PAGE_SIZE];
 
 uint32_t compute_heightsize(struct gfs2_sbd *sdp, uint64_t *heightsize,
-			    int diptrs, int inptrs)
+			    uint32_t bsize1, int diptrs, int inptrs)
 {
 	int x;
 
 	heightsize[0] = sdp->bsize - sizeof(struct gfs2_dinode);
-	heightsize[1] = sdp->bsize * diptrs;
+	heightsize[1] = bsize1 * diptrs;
 	for (x = 2;; x++) {
 		uint64_t space, d;
 		uint32_t m;
@@ -97,11 +97,12 @@ compute_constants(struct gfs2_sbd *sdp)
 	sdp->sd_max_dirres = hash_blocks + ind_blocks + leaf_blocks;
 
 	sdp->sd_max_height = compute_heightsize(sdp, sdp->sd_heightsize,
-						sdp->sd_diptrs,
+						sdp->bsize, sdp->sd_diptrs,
 						sdp->sd_inptrs);
 	sdp->sd_max_jheight = compute_heightsize(sdp, sdp->sd_jheightsize,
-						sdp->sd_diptrs,
-						sdp->sd_inptrs);
+						 sdp->sd_jbsize,
+						 sdp->sd_diptrs,
+						 sdp->sd_inptrs);
 }
 
 int 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-10 20:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-10 20:45 cluster: RHEL53 - Use jbsize for height computations on journaled files Bob Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).