Bug 234844 - Need to add a "gfs2_grow" command
Need to add a "gfs2_grow" command
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gfs2-utils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Robert Peterson
GFS Bugs
Depends On: 235430
Blocks: 239773
  Show dependency treegraph
Reported: 2007-04-02 11:29 EDT by Robert Peterson
Modified: 2010-01-11 22:37 EST (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2007-0579
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-11-07 13:04:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
First go at a patch (38.52 KB, patch)
2007-04-05 15:30 EDT, Robert Peterson
no flags Details | Diff
Patch for gfs2_quota (15.71 KB, patch)
2007-04-19 11:48 EDT, Robert Peterson
no flags Details | Diff
Better patch for HEAD (44.11 KB, patch)
2007-05-01 16:12 EDT, Robert Peterson
no flags Details | Diff
RHEL5 patch to fix the problem (45.32 KB, patch)
2007-05-11 12:40 EDT, Robert Peterson
no flags Details | Diff

  None (edit)
Description Robert Peterson 2007-04-02 11:29:24 EDT
Description of problem:
When we did rhel5, we forgot to do the gfs2_grow function.
We need to add this.  Some things should be easy because we can
use the same rg calculations that mkfs.gfs2 uses.  The rgindex
should be updated via the metafs.  The rg's can be written as
raw data with libgfs2, because the gfs2 kernel won't know about
them until gfs2_grow is done.  The rindex update should be done after
the rgs are initialized, because according to Steve Whitehouse,
writing to the rindex through the metafs should cause gfs2 to
reread the index.

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

How reproducible:

Steps to Reproduce:
Actual results:
-bash: gfs2_grow: command not found

Expected results:
A gfs2 file system should be extended as it does for gfs v1.

Additional info:
Comment 1 Robert Peterson 2007-04-05 15:30:08 EDT
Created attachment 151803 [details]
First go at a patch

This is a big patch with several changes:

1. First of all, I moved a bunch of metafs-related code from main_jadd.c
   to misc.c in libgfs2 so that the new gfs2_grow program could use them.
2. There's a new gfs2_grow.c program to extend the file system.
   This was basically written from scratch and the old one thrown away.
3. I simplified the code and data structures by getting rid of
   this whole idea of a "subdevice" for the mkfs-related programs.
4. I figured out a clever way I could simplify my life for bugzilla:
   where gfs2_fsck has to repair broken RGs and rindex files.
   Basically, the biggest pain regarding the repair of RGs is that
   the "grow" code would change the RG size for the new portion added
   to the file system.	My solution is: Always have gfs2_grow figure
   out the existing RG sizes and just keeping adding them in those
   increments.	That way, the RG distance will always be consistent
   and gfs2_fsck can be more intelligent about its assumptions.
   The down side of that is that if your original RG size was 2G, then
   your lvresize needs to be at least that big so that the same RG size
   may be used.  You can't just lvresize a small amount of space, like
   150MB and expect it to work.  Some people may be unhappy about that,
   but I think it's an acceptable limitation in order to allow fsck to
   repair damaged RGs properly.  This is more so an issue with gfs2 than
   gfs1, because with gfs1, the journals were outside the file system 
   and predictable, so fsck could deduce extended pieces based on that.
   With gfs2, the journals are inside the file system, so gfs2_fsck can't
   make the same assumptions that gfs_fsck does.
5. I changed the libgfs2 function "compute_rgrp_layout" so that it
   can work properly for both mkfs and grow.  In other words, it can
   now handle existing RGs when figuring out its calculations.
Comment 2 RHEL Product and Program Management 2007-04-13 14:26:26 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 3 Robert Peterson 2007-04-19 11:41:14 EDT
Because I moved a bunch of functions to gfs2_jadd to libgfs2, I discovered
yesterday that it also affected gfs2_quota as well, which had extremely 
similar functions.  So yesterday, I changed gfs2_quota to use the new 
functions in libgfs2.  Since I'm affecting all this code that Abhi Das
wrote, I'm adding him to the cc list to keep him informed.
I'll have to amend my patch to include those changes.  I haven't tested
the new version of gfs2_quota yet, but it compiles.
Comment 4 Robert Peterson 2007-04-19 11:48:49 EDT
Created attachment 153018 [details]
Patch for gfs2_quota

Here's the untested gfs2_quota patch that uses the functions
I ported from gfs2_jadd to libgfs2.
Comment 5 Robert Peterson 2007-05-01 16:12:08 EDT
Created attachment 153888 [details]
Better patch for HEAD

This patch is the one tested with the gfs2_fsck_hellfire test case.
Comment 6 Robert Peterson 2007-05-11 12:40:40 EDT
Created attachment 154555 [details]
RHEL5 patch to fix the problem

This is the RHEL5 equivalent patch.  I needed to wait for gfs2_quota
to be resolved in the RHEL5 branch of cvs.  It has been tested on trin-10.
Comment 7 Robert Peterson 2007-05-11 12:58:29 EDT
Fix committed to CVS at HEAD and RHEL5 branches.  Tested on trin-10.
Changing status to modified.
Comment 10 errata-xmlrpc 2007-11-07 13:04:47 EST
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.