Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 235033

Summary: gfs_fsck: Bad programmer! You forgot to catch the ÿ flag
Product: [Retired] Red Hat Cluster Suite Reporter: Nate Straz <nstraz>
Component: gfsAssignee: Robert Peterson <rpeterso>
Status: CLOSED CURRENTRELEASE QA Contact: GFS Bugs <gfs-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 4Keywords: TestBlocker
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: 4.5.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-18 21:36:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 235060, 235061    
Attachments:
Description Flags
patch to fix the problem none

Description Nate Straz 2007-04-03 14:30:25 UTC
Description of problem:

While running gfs_fsck_stress on ppc, I started hitting this error.

I checked the source for gfs_fsck and found that it's using getopts wrong.

gfs_fsck/main.c:

int read_cmdline(int argc, char **argv, struct options *opts)
{
        char c;

        while((c = getopt(argc, argv, "hnqvyV")) != -1) {

prototype from man page:
       int getopt(int argc, char * const argv[],
                  const char *optstring);


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

How reproducible:
100%

Steps to Reproduce:
1. gfs_fsck /dev/foo
  
Actual results:
See above

Expected results:
gfs_fsck should be able to parse command line arguments.

Additional info:

Comment 2 Robert Peterson 2007-04-03 16:53:38 UTC
Created attachment 151587 [details]
patch to fix the problem

The problem is that gfs_fsck's main.c was coded by AJ Lewis to set
a char value from getopt().  That's fine for little endian architectures,
but on PPC, which is big endian, it gets it wrong.

I need to make this fix to at least 7 branches of CVS:

1. RHEL4
2. RHEL45
3. RHEL5
4. HEAD
5. STABLE
6. HEAD-GFS2
7. RHEL5-GFS2

Comment 3 Robert Peterson 2007-04-03 16:56:53 UTC
The fix was tested on system roth-01 to make sure nothing broke.  
I don't have a big-endian box to test it on, so I'll let the QE 
group do that.


Comment 4 Robert Peterson 2007-04-03 17:08:23 UTC
Fix committed to CVS at RHEL4, RHEL45 and STABLE branches.
Setting status to modified.

Bugzilla records were opened up for crosswrites:
RHEL5, HEAD: 
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=235060

GFS2 RHEL5, HEAD: 
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=235061


Comment 6 Nate Straz 2008-02-18 21:36:22 UTC
Looks like this wasn't added to the errata, but it was released and does work.