cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Carlos Maiolino <cmaiolino@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/2] libgfs2: fix compute_rgrp_layout
Date: Fri,  2 Sep 2011 17:42:48 -0300	[thread overview]
Message-ID: <1314996168-4369-2-git-send-email-cmaiolino@redhat.com> (raw)
In-Reply-To: <1314996168-4369-1-git-send-email-cmaiolino@redhat.com>

The function uses the same buggy trick as
gfs2_grow to calculate rgsize, which cause
a segmentation fault if there is only one
RG into the filesystem.
This patch makes compute_rgrp_layout() to
use figure_out_rgsize() function.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 gfs2/libgfs2/fs_geometry.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index 2b70f11..bdc8225 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -80,8 +80,8 @@ void compute_rgrp_layout(struct gfs2_sbd *sdp, struct osi_root *rgtree,
 	struct device *dev;
 	struct rgrp_tree *rl, *rlast = NULL, *rlast2 = NULL;
 	struct osi_node *n, *next = NULL;
-	unsigned int rgrp = 0, nrgrp;
-	uint64_t rglength, rgaddr;
+	unsigned int rgrp = 0, nrgrp, rglength;
+	uint64_t rgaddr;
 
 	sdp->new_rgrps = 0;
 	dev = &sdp->device;
@@ -113,7 +113,7 @@ void compute_rgrp_layout(struct gfs2_sbd *sdp, struct osi_root *rgtree,
 			rlast = rl;
 		}
 		rlast->start = rlast->ri.ri_addr;
-		rglength = rlast->ri.ri_addr - rlast2->ri.ri_addr;
+		rglength = figure_out_rgsize(sdp);
 		rlast->length = rglength;
 		old_length = rlast->ri.ri_addr + rglength;
 		new_chunk = dev->length - old_length;
-- 
1.7.6



      reply	other threads:[~2011-09-02 20:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 20:42 [Cluster-devel] [PATCH 1/2] gfs2_grow: fix and move figure_out_rgsize() to libgfs2 Carlos Maiolino
2011-09-02 20:42 ` Carlos Maiolino [this message]

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=1314996168-4369-2-git-send-email-cmaiolino@redhat.com \
    --to=cmaiolino@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 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 NNTP newsgroup(s).