Bug 352841

Summary: GFS2: Evaluate and implement missing gfs2_tool features
Product: Red Hat Enterprise Linux 5 Reporter: Robert Peterson <rpeterso>
Component: gfs2-utilsAssignee: Chris Feist <cfeist>
Status: CLOSED ERRATA QA Contact: GFS Bugs <gfs-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 5.1CC: teigland
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0350 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 13:20:22 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
Patch to add the "df" functionality
none
Better patch none

Description Robert Peterson 2007-10-25 13:35:25 EDT
Description of problem:
This is an offshoot of bug #349601 comment #3:
The gfs2_tool command has a bunch of commands that were commented out
for RHEL5.  That was done mostly because there were numerous ioctls
pulled out of GFS2 in order to satisfy the upstream community.
Most of these, however, have commands in gfs2_edit that do nearly
the same thing.  For example, gfs2_edit -p rindex can be said to replace
gfs2_tool rindex and gfs2_edit -p jindex can be said to replace
gfs2_tool jindex.  However, I won't say that the gfs2_edit command prints
the exact same format as the gfs2_tool.

We should probably go through all those gfs2_tool commands, evaluate
which ones are adequately covered by gfs2_edit and re-implement the
ones that aren't.  That is, if they can be done without
re-implementing new ioctl code in gfs2 kernel code.
Case in point: gfs2_tool df.

Version-Release number of selected component (if applicable):
RHEL5.1

How reproducible:
Always

Steps to Reproduce:
gfs2_tool df
 
Actual results:
gfs2_tool: unknown action: df

Expected results:
Should work

Additional info:
Comment 2 Robert Peterson 2007-11-08 15:10:08 EST
I've gone through the options that are missing from gfs2_tool and
here is my analysis.  The following is a list of "missing" options
and where we stand:

1. Option: flush
   Description: Sync out dirty data for a file and drop its glock.
   Status: There's no good way to implement this today, except open
           and fsync.

2. Option: stat
   Description: Print gfs2_dinode for a file.
   Status: There's no good way to implement this today.  The gfs2_edit
           command can do this, give the inode address.  Right now
           you can't give it a path.

3. Option: getsb
   Description: Print out the gfs2 superblock
   Status: There is a command equivalent in gfs2_edit: gfs2_tool -p sb
           so I don't see the need to implement this.

4. Option: jindex
   Description: Print out the journal index
   Status: There is a command equivalent in gfs2_edit: gfs2_tool -p jindex
           so I don't see the need to implement this.

5. Option: rindex
   Description: Print out the resource group index file
   Status: There is a command equivalent in gfs2_edit: gfs2_tool -p rindex
           so I don't see the need to implement this.

6. Option: quota
   Description: Print out the quota file details
   Status: There is a command equivalent in gfs2_edit: gfs2_tool -p quota
           so I don't see the need to implement this.

7. Option: layout
   Description: Print out the layout of a file
   Status: There is a separate bugzilla record to implement this feature.

8. Option: df
   Description: Print out a bunch of information about the file system
   Status: Some customer might be using this.  It might be nice to
           implement this.

Conclusion:

IMHO, the only missing option we should consider implementing at this
time is the "df" command.
Comment 3 Robert Peterson 2007-11-13 17:22:11 EST
Created attachment 257481 [details]
Patch to add the "df" functionality

This is my initial attempt to add the "df" function back to gfs2_tool.
Comment 4 Robert Peterson 2007-11-14 12:16:04 EST
Created attachment 258441 [details]
Better patch

This version of the patch is the one I'm planning to commit.
It has a few small improvements, such as the "df" help printing
in the alphabetically correct section of the gfs2_tool -h output.
I also eliminated some cruft from the previous patch.
Comment 5 Robert Peterson 2007-11-14 12:22:06 EST
The code was tested on system roth-01 including the man page, -h option,
and new df options for both single and multiple file systems (both HEAD
and RHEL5 versions).  The code was committed to the HEAD and RHEL5 branches
of CVS.  I'm therefore changing the status to modified.
Comment 8 errata-xmlrpc 2008-05-21 13:20:22 EDT
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 the 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-2008-0350.html