Bug 688734

Summary: gfs2_convert exits with success without doing anything
Product: Red Hat Enterprise Linux 6 Reporter: Nate Straz <nstraz>
Component: clusterAssignee: Abhijith Das <adas>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: low Docs Contact:
Priority: medium    
Version: 6.1CC: bmarzins, ccaulfie, cluster-maint, fdinitto, lhh, rpeterso, ssaha, swhiteho, teigland
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cluster-3.0.12-41.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 12:54:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 630005    
Attachments:
Description Flags
RHEL6.1 patch to fix this issue
none
corrected patch none

Description Nate Straz 2011-03-17 21:10:14 UTC
Description of problem:

Running GFS2 regression tests shows that gfs2_convert is not working at all.

[root@west-02 ~]# gfs2_convert -vy /dev/wic/bigdir
gfs2_convert version 3.0.12 (built Feb 28 2011 07:00:42)
Copyright (C) Red Hat, Inc.  2004-2010  All rights reserved.

Unable to fill in resource group information.
Examining file system[root@west-02 ~]# echo $?
0
[root@west-02 ~]# ls



Version-Release number of selected component (if applicable):
gfs2-utils-3.0.12-35.el6.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. Try to convert ANY GFS file system
2.
3.
  
Actual results:

GFS remains as GFS

Expected results:

GFS converted to GFS2


Additional info:

Comment 1 Abhijith Das 2011-03-17 22:15:53 UTC
Seems like bob's patch to 576640: "fsck.gfs2: can't repair rgrps resulting from gfs_grow->gfs2_convert" has changed something in libgfs2 that has broken gfs2_convert. I removed that patch from the build and convert seems to be working fine. I haven't figured out a solution yet, but it should be easily fixable

Comment 2 Abhijith Das 2011-03-21 16:21:24 UTC
Created attachment 486636 [details]
RHEL6.1 patch to fix this issue

The patch to bug 576640 mentioned earlier added a sanity check (gfs2_check_range()) to the codepath of gfs1_ri_update() that's used by gfs2_convert. This new check requires the value of sbp->fssize to be initialized to a valid non-zero size, which gfs2_convert does not do. The check fails and gfs2_convert bails out. This patch initializes sbp->fssize to the device size and the check is successful and gfs2_convert runs to completion as expected.

Comment 3 Abhijith Das 2011-03-21 16:44:08 UTC
Pushed above patch to upstream gfs2-utils.git tree:
ae17f725f37fccaf59087994b54ffdcdb782fa81

and to RHEL6 cluster.git tree:
508b868e8c22a4dc454a406d9a1c0a32af94c21e

Comment 4 Nate Straz 2011-03-21 21:36:31 UTC
I tried out gfs2-utils-3.0.12-40.el6.x86_64 and found it did work for 4k block sizes, but when I tried 512 byte block size for our large directory test case, it would exit with a zero exit status and do nothing.

[root@west-02 ~]# gfs2_convert /dev/wic/bigdir; echo $?
gfs2_convert version 3.0.12 (built Mar 21 2011 13:28:41)
Copyright (C) Red Hat, Inc.  2004-2010  All rights reserved.

Unable to fill in resource group information.
Examining file system0

Comment 5 Abhijith Das 2011-03-21 22:21:23 UTC
Created attachment 486700 [details]
corrected patch

The placement of the one-liner in the previous patch was incorrect. Block size was still the default 4K instead of the actual blocksize read from the gfs1 superblock. This is the corrected patch that works for all supported block sizes.

Comment 6 Steve Whitehouse 2011-03-22 09:35:45 UTC
Abhi, the patch should have been posted to cluster-devel for review before pushing to the upstream tree. It looks ok to me though.

Comment 8 Nate Straz 2011-03-22 20:45:34 UTC
Verified -41.el6 rpm is making it through gfs2_convert regression tests.

Comment 9 Nate Straz 2011-03-23 16:05:45 UTC
I found another instance where I can evoke this behavior.  If I grow a file system with gfs_grow before I convert, I get the same result.

Can I get two parts to fixing this?  

1) Make sure gfs2_convert returns non-zero if it hits an error from libgfs
2) fix the new failure with grown file systems.

Thanks,

Nate

Comment 10 Nate Straz 2011-03-23 18:39:10 UTC
Comment #9 was caused by a bug in my test case.  I'm not using clustered lvm so I need to reactivate the LV on the second host so it sees the extended size.

Moving back to verified.

Comment 11 errata-xmlrpc 2011-05-19 12:54:55 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-0537.html