Bug 345501

Summary: GFS2: gfs2 utils uses non-canonicalized names
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: medium Docs Contact:
Priority: medium    
Version: 5.1CC: kanderso, swhiteho
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
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 17:20:16 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: 337961    
Bug Blocks:    
Attachments:
Description Flags
patch to fix the problem--try #1
none
patch to fix the problem (HEAD)
none
patch to fix the problem (RHEL5) none

Description Robert Peterson 2007-10-22 16:32:47 UTC
+++ This bug was initially created as a clone of Bug #337961 +++
The problem was reported for GFS1, but there are MANY places in the
gfs2 utils where it uses libgfs2 function check_for_gfs2 that has the
same problem.  The function can be tripped up by extra slashes and such.

Description of problem:
# gfs_grow /mountpoint/ does not work 

Version-Release number of selected component (if applicable):
gfs-utils-0.1.11-3.el5

How reproducible:
# gfs_grow -Tv /gfsdata/
GFS Filesystem /gfsdata/ not found

[root@node-1 ~]# gfs_grow -Tv /gfsdata
FS: Mount Point: /gfsdata
FS: Device: /dev/gfs_vg/gfslv
FS: Options: rw,hostdata=jid=0:id=65538:first=1,acl
...
  
Expected results:
# gfs_growfs should not care about the last slash!

-- Additional comment from rpeterso on 2007-10-22 11:54 EST --
Created an attachment (id=234211)
Patch to fix the problem

This patch takes care of not only trailing slashes but any extras.
For example, /mnt///roth_vg////roth_lv will be correctly interpreted
as /mnt/roth_vg/roth_lv


-- Additional comment from rpeterso on 2007-10-22 11:55 EST --
Requesting ACK flags so I can ship the fix for RHEL5.2.

Comment 1 Kiersten (Kerri) Anderson 2007-10-24 15:54:44 UTC
*** Bug 350561 has been marked as a duplicate of this bug. ***

Comment 2 Robert Peterson 2007-10-24 22:51:17 UTC
Created attachment 236761 [details]
patch to fix the problem--try #1

Special notes:
1. Most code paths have been tested.
2. Many of the changed lines of code won't affect anything because
   they're #IFDEFed out in gfs2_tool and therefore ignored by the
   compiler.  I changed the ignored code to make it easier to implement
   in the future.
3. There were several instances in the code where the mount path was
   being opened.  This was only done as a form of validation.
   Since this patch now uses canonical names, there is no longer a
   need to do this, since we'll find out anyway if the file system is
   mounted.  An open of "/mnt////gfs2/" will fail anyway.  So many of
   these opens were taken out.
4. I need to do a little more testing, but this patch seems to work.

Comment 3 Robert Peterson 2007-10-25 14:11:29 UTC
Created attachment 237361 [details]
patch to fix the problem (HEAD)

Slightly revised (forgot to take a declare out of gfs2_tool.h that
was there for the future fix to 349601.)

Comment 4 Robert Peterson 2007-10-25 14:13:10 UTC
Created attachment 237371 [details]
patch to fix the problem (RHEL5)

Here is the RHEL5 version of the patch.  The only difference is in the
Makefile.

Comment 5 Robert Peterson 2007-10-25 14:16:33 UTC
The above patches were both tested on system roth-01.
They were committed to CVS at the HEAD and RHEL5 branches for inclusion
in RHEL5.2.  Changing status to modified.


Comment 8 errata-xmlrpc 2008-05-21 17:20:16 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 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