Bug 575968 - gfs2_fsck segfault when statfs system file is missing
Summary: gfs2_fsck segfault when statfs system file is missing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gfs2-utils
Version: 5.4
Hardware: All
OS: Linux
low
high
Target Milestone: rc
: ---
Assignee: Robert Peterson
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 576330 620384 622576 624689 624691
TreeView+ depends on / blocked
 
Reported: 2010-03-22 20:25 UTC by alexanderhampel
Modified: 2011-01-13 23:20 UTC (History)
1 user (show)

Fixed In Version: gfs2-utils-0.1.62-25.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 576330 (view as bug list)
Environment:
Last Closed: 2011-01-13 23:20:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Preliminary patch (4.36 KB, patch)
2010-03-23 19:09 UTC, Robert Peterson
no flags Details | Diff
Patch from 09 Aug 2010 (68.87 KB, patch)
2010-08-09 18:46 UTC, Robert Peterson
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0135 0 normal SHIPPED_LIVE gfs2-utils bug fix update 2011-01-12 19:26:41 UTC

Description alexanderhampel 2010-03-22 20:25:45 UTC
Description of problem:  When the statfs system file is missing due to a GFS2 file system corruption, gfs2_fsck segfaults.


Version-Release number of selected component (if applicable):
gfs2-utils-0.1.62-1.el5

How reproducible:
Executing gfs2_fsck/fsck.gfs2 on a corrupt gfs2 file system with missing statfs system file

Steps to Reproduce:
1.  gfs2_fsck /dev/path-to-gfs2-filesystem
2.
3.
  
Actual results:
Initializing fsck
Recovering journals (this may take a while)..
Journal recovery complete.
Segmentation fault

Expected results:
gfs2_fsck should rebuild/reconstruct the missing statfs file, and continue fixing the corrupted file system

Additional info:  log entry looks like:
Mar 11 08:30:54 server-name kernel: GFS2: fsid=share:directory.1: can't read in statfs inode: -2

Comment 1 Robert Peterson 2010-03-23 19:09:01 UTC
Created attachment 402119 [details]
Preliminary patch

This patch fixed the problem and recreated their statfs file.
I do not consider it ready to ship because this version cannot
recreate a damaged rindex file, root file system or master
system directory.  Those are much more complex issues that will
need some forethought and design work.

Comment 2 Robert Peterson 2010-03-23 19:10:44 UTC
Requesting ack flags to get this into a release.

Comment 3 Robert Peterson 2010-08-09 18:46:15 UTC
Created attachment 437675 [details]
Patch from 09 Aug 2010

The fix to repair and/or recreate missing system files was greatly
enhanced upstream.  This patch is a RHEL5 back-port of those
enhancements, which includes statfs.  It still needs some testing.
It should also be noted that I'm not done with this effort in general.
Because of deadlines I had to push out the upstream patch into
RHEL6 for bug #576330.  This is basically a crosswrite of that
effort.  But after that bug went out, another one came in for RHEL5,
bug #620384, in which it was discovered that missing journals cause
a problem.  So I think it's prudent to ship this one as is and
continue the work under bug #620384 so I don't have too many patches
outstanding.  I'll push it as soon as I get it properly tested.

Comment 4 Robert Peterson 2010-08-11 16:57:16 UTC
This patch is now properly tested on roth-01.  I ran fsck.gfs2
against all the metadata sets I have that fit on roth-01's 775GB
SAN.  I pushed the patch to the RHEL56 branch of the cluster.git
repository for inclusion into 5.6.  SHA1 is c5311da.
The patch is already upstream by virtue of the aforementioned
bug records.  Changing status to POST until this gets built into
a formal package.

Comment 5 Robert Peterson 2010-09-17 16:00:52 UTC
Build 2768496 successful.  Changing status to Modified.
This fix is in gfs2-utils-0.1.62-25.el5.

Comment 8 errata-xmlrpc 2011-01-13 23:20:13 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 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/RHBA-2011-0135.html


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