Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6f7... Commit: 6f711c7174cdf863bc5a5c9f497270114dab7413 Parent: 3e89cfb766711d210e23284206b791eee71273f7 Author: Bob Peterson bob@ganesha.peterson AuthorDate: Thu Jan 21 17:35:33 2010 -0600 Committer: Bob Peterson rpeterso@redhat.com CommitterDate: Tue Jan 26 14:39:29 2010 -0600
libgfs2: Set block range based on rgrps, not device size
The functions that read in the rindex need to set the block range properly, rather than basing it on the device size. If not, bad block pointers might reference blocks beyond the end of the file system (as can happen if a device is extended before gfs2_grow is run), or if a different metadata set is restored with gfs2_edit restoremeta.
rhbz#455300 --- gfs2/libgfs2/gfs1.c | 1 + gfs2/libgfs2/super.c | 4 ++++ 2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c index 5cced66..5018334 100644 --- a/gfs2/libgfs2/gfs1.c +++ b/gfs2/libgfs2/gfs1.c @@ -315,6 +315,7 @@ int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int quiet) rmax = ri->ri_data0 + ri->ri_data - 1; }
+ sdp->fssize = rmax; *rgcount = count1; if (count1 != count2) goto fail; diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c index ca7bf09..1fa18ce 100644 --- a/gfs2/libgfs2/super.c +++ b/gfs2/libgfs2/super.c @@ -229,6 +229,7 @@ int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount) osi_list_t *tmp; int count1 = 0, count2 = 0; uint64_t errblock = 0; + uint64_t rmax = 0;
if (rindex_read(sdp, fd, &count1)) goto fail; @@ -238,9 +239,12 @@ int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount) if (errblock) return errblock; ri = &rgd->ri; + if (ri->ri_data0 + ri->ri_data - 1 > rmax) + rmax = ri->ri_data0 + ri->ri_data - 1; count2++; }
+ sdp->fssize = rmax; *rgcount = count1; if (count1 != count2) goto fail;
cluster-commits@lists.stg.fedorahosted.org