Bug 235033 - gfs_fsck: Bad programmer! You forgot to catch the ÿ flag
gfs_fsck: Bad programmer! You forgot to catch the ÿ flag
Status: CLOSED CURRENTRELEASE
Product: Red Hat Cluster Suite
Classification: Red Hat
Component: gfs (Show other bugs)
4
ppc64 Linux
medium Severity medium
: ---
: ---
Assigned To: Robert Peterson
GFS Bugs
: TestBlocker
Depends On:
Blocks: 235060 235061
  Show dependency treegraph
 
Reported: 2007-04-03 10:30 EDT by Nate Straz
Modified: 2010-01-11 22:15 EST (History)
0 users

See Also:
Fixed In Version: 4.5.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-18 16:36:22 EST
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 (476 bytes, patch)
2007-04-03 12:53 EDT, Robert Peterson
no flags Details | Diff

  None (edit)
Description Nate Straz 2007-04-03 10:30:25 EDT
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 12:53:38 EDT
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 12:56:53 EDT
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 13:08:23 EDT
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 16:36:22 EST
Looks like this wasn't added to the errata, but it was released and does work.

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