Bug 222748 - gfs_grow gets the rgindex out of order
gfs_grow gets the rgindex out of order
Product: Red Hat Cluster Suite
Classification: Red Hat
Component: gfs (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Robert Peterson
GFS Bugs
Depends On: 222743
  Show dependency treegraph
Reported: 2007-01-15 18:13 EST by Robert Peterson
Modified: 2010-01-11 22:14 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2007-0139
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-10 17:00:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Robert Peterson 2007-01-15 18:13:05 EST
+++ This bug was initially created as a clone of Bug #222743 +++
Bug cloned from RHEL5 to RHEL4 so I can fix RHEL4's gfs_grow as well.

Description of problem:
When gfs_grow is run to extend a GFS file system, it adds entries
to the rgindex.  The problem is, it writes them in reverse block order.
That has the side-effect that gfs_fsck will report the wrong percentage
complete in pass 5.  For example, if you double the size of a GFS
file system, pass 5 will report 1% complete, then 2%, etc.  But when it
gets to the new rgs, it will report 99%, then 98%, then 97% until it
processes them all when it returns to 50%.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a small GFS file system
2. Use gfs_grow to grow it
3. Run gfs_fsck on it
Actual results:
Percentage complete can run backward.

Expected results:
Percentage complete should be forward.

Additional info:

-- Additional comment from rpeterso@redhat.com on 2007-01-15 17:49 EST --
The problem is easily fixed.  Back in March 2006 when I was testing
changes to gfs_fsck rg repair, I noticed this problem and created 
this patch to fix it in RHEL4:

--- main.c.~1~  2005-01-04 04:07:07.000000000 -0600
+++ main.c      2006-03-30 11:18:34.000000000 -0600
@@ -669,7 +669,7 @@ make_rgrp(uint64_t offset, uint64_t size
        rgl->rg.rg_header.mh_format = GFS_FORMAT_RG;
        rgl->rg.rg_free = rgl->ri.ri_data;
-       osi_list_add(&rgl->list, &rglist_new);
+       osi_list_add_prev(&rgl->list, &rglist_new);
        return offset + size;

The patch unfortunately never made it to RHEL5 or anywhere.  
This should be fixed so customers aren't confused by it.
Comment 1 Robert Peterson 2007-01-17 18:02:26 EST
I unit tested this on system roth-01. I verified with gfs_tool rindex
that gfs_grow caused the rgindex to get out of order without my fix.  
Then I applied my fix, deleted the lv, redid the test and verified it
was in the correct order.  I committed the fix to CVS in the RHEL4 
branch for 4.5's sake.  Changing bz status to modified.
Comment 5 Red Hat Bugzilla 2007-05-10 17:00:46 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.