Bug 345501 - GFS2: gfs2 utils uses non-canonicalized names
GFS2: gfs2 utils uses non-canonicalized names
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gfs2-utils (Show other bugs)
5.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Feist
GFS Bugs
:
: 350561 (view as bug list)
Depends On: 337961
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-22 12:32 EDT by Robert Peterson
Modified: 2010-01-11 22:40 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2008-0350
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 13:20:16 EDT
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--try #1 (19.41 KB, patch)
2007-10-24 18:51 EDT, Robert Peterson
no flags Details | Diff
patch to fix the problem (HEAD) (19.46 KB, patch)
2007-10-25 10:11 EDT, Robert Peterson
no flags Details | Diff
patch to fix the problem (RHEL5) (19.50 KB, patch)
2007-10-25 10:13 EDT, Robert Peterson
no flags Details | Diff

  None (edit)
Description Robert Peterson 2007-10-22 12:32:47 EDT
+++ 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@redhat.com 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@redhat.com 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 11:54:44 EDT
*** Bug 350561 has been marked as a duplicate of this bug. ***
Comment 2 Robert Peterson 2007-10-24 18:51:17 EDT
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 10:11:29 EDT
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 10:13:10 EDT
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 10:16:33 EDT
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 13:20:16 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

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