Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 502056 - GFS2: gfs2_edit savemeta needs to save freemeta blocks
GFS2: gfs2_edit savemeta needs to save freemeta blocks
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gfs2-utils (Show other bugs)
5.3
All Linux
medium Severity medium
: rc
: ---
Assigned To: Robert Peterson
Martin Banas
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-21 12:54 EDT by Robert Peterson
Modified: 2010-01-11 22:43 EST (History)
7 users (show)

See Also:
Fixed In Version: gfs2-utils-0.1.58-1.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 07:02:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix the problem (2.82 KB, patch)
2009-05-21 15:48 EDT, Robert Peterson
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1337 normal SHIPPED_LIVE Low: gfs2-utils security and bug fix update 2009-09-01 06:41:56 EDT

  None (edit)
Description Robert Peterson 2009-05-21 12:54:13 EDT
Description of problem:
The gfs2_edit savemeta function currently does not save off
blocks of type 2, which correspond to "free metadata" in gfs and
"unlinked dinodes" in gfs2.  This turns out to be a problem because
if that metadata is restored and gfs is tested against it, it will
result in metadata allocation problems.  For example, gfs_grow may
make the decision to allocate a metadata block, and try to re-use a
block that's marked as "free metadata" in the gfs bitmap.  But
since the block wasn't saved at "savemeta" time, the block was
never restored as metadata and therefore the metadata header may
be missing, so gfs-kernel will throw a file system error.

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

How reproducible:
Always

Steps to Reproduce:
I haven't actually tried this, but this should theoretically do it:

lvcreate -L 95G -n data roth_vg
mkfs -t gfs -j 1 -t "bobs_roth:data" -p lock_nolock -O /dev/roth_vg/data
mount -tgfs /dev/roth_vg/data /mnt/gfs
for i in `seq 1 1000` ; do cp /etc/fstab /mnt/gfs/f$i ; done
sync
rm /mnt/gfs/f*
umount /mnt/gfs
gfs2_edit savemeta /dev/roth_vg/data /tmp/bob.metasave
dd if=/dev/zero of=/dev/roth_vg/data
gfs2_edit restoremeta /tmp/bob.metasave /dev/roth_vg/data
mount -tgfs /dev/roth_vg/data /mnt/gfs
lvresize -L +200G /dev/roth_vg/data
gfs_grow /mnt/gfs
  
Actual results:

GFS: fsid=bobs_roth:data.0: fatal: invalid metadata block
GFS: fsid=bobs_roth:data.0:   bh = 62327 (magic)
GFS: fsid=bobs_roth:data.0:   function = gfs_trans_add_bh
GFS: fsid=bobs_roth:data.0:   file = /home/bob/cluster/gfs-kernel/src/gfs/trans.c, line = 290
GFS: fsid=bobs_roth:data.0:   time = 1242916713
GFS: fsid=bobs_roth:data.0: about to withdraw from the cluster
GFS: fsid=bobs_roth:data.0: telling LM to withdraw
GFS: fsid=bobs_roth:data.0: withdrawn

Expected results:
gfs_grow should work just fine.

Additional info:
I have a working patch to fix the problem.
Very low risk because gfs2_edit is only used for debugging file system
problems.
Comment 1 Robert Peterson 2009-05-21 15:48:24 EDT
Created attachment 345017 [details]
Patch to fix the problem
Comment 2 Robert Peterson 2009-05-21 15:50:26 EDT
The patch has been pushed to the master branch of the gfs2-utils
repository and the STABLE2, STABLE3 and RHEL5 branches of the
cluster git repository for inclusion into RHEL5.  It was tested on
system roth-01.  Changing status to Modified.
Comment 5 Martin Banas 2009-07-24 05:30:42 EDT
Retested with RHEL5.4-Server-20090722.0 and gfs2-utils-0.1.61-1.el5.

gfs_grow worked OK, no error displayed, successfull grow of filesystem.

Moving the bug to VERIFIED state.
Comment 7 errata-xmlrpc 2009-09-02 07:02:25 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 therefore 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/RHSA-2009-1337.html

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