Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 234844 - Need to add a "gfs2_grow" command
Summary: Need to add a "gfs2_grow" command
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gfs2-utils
Version: 5.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Robert Peterson
QA Contact: GFS Bugs
URL:
Whiteboard:
Depends On:
Blocks: 239773
TreeView+ depends on / blocked
 
Reported: 2007-04-02 15:29 UTC by Robert Peterson
Modified: 2010-01-12 03:37 UTC (History)
4 users (show)

Fixed In Version: RHBA-2007-0579
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-07 18:04:47 UTC


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


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0579 normal SHIPPED_LIVE gfs2-utils bug fix update 2007-11-08 14:13:05 UTC

Description Robert Peterson 2007-04-02 15:29:24 UTC
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):
RHEL5

How reproducible:
Always

Steps to Reproduce:
1.gfs2_grow
  
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 19:30:08 UTC
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:
   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=223893
   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 18:26:26 UTC
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
release.

Comment 3 Robert Peterson 2007-04-19 15:41:14 UTC
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 15:48:49 UTC
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 20:12:08 UTC
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 16:40:40 UTC
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 16:58:29 UTC
Fix committed to CVS at HEAD and RHEL5 branches.  Tested on trin-10.
Changing status to modified.


Comment 10 errata-xmlrpc 2007-11-07 18:04:47 UTC
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.

http://rhn.redhat.com/errata/RHBA-2007-0579.html



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