Bug 235033 - gfs_fsck: Bad programmer! You forgot to catch the ÿ flag
Summary: gfs_fsck: Bad programmer! You forgot to catch the ÿ flag
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Cluster Suite
Classification: Retired
Component: gfs   
(Show other bugs)
Version: 4
Hardware: ppc64 Linux
medium
medium
Target Milestone: ---
Assignee: Robert Peterson
QA Contact: GFS Bugs
URL:
Whiteboard:
Keywords: TestBlocker
Depends On:
Blocks: 235060 235061
TreeView+ depends on / blocked
 
Reported: 2007-04-03 14:30 UTC by Nate Straz
Modified: 2010-01-12 03:15 UTC (History)
0 users

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: ---


Attachments (Terms of Use)
patch to fix the problem (476 bytes, patch)
2007-04-03 16:53 UTC, Robert Peterson
no flags Details | Diff

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.


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