Bug 345501 - GFS2: gfs2 utils uses non-canonicalized names
Summary: GFS2: gfs2 utils uses non-canonicalized names
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gfs2-utils
Version: 5.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Chris Feist
QA Contact: GFS Bugs
URL:
Whiteboard:
: 350561 (view as bug list)
Depends On: 337961
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-22 16:32 UTC by Robert Peterson
Modified: 2010-01-12 03:40 UTC (History)
2 users (show)

Fixed In Version: RHBA-2008-0350
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 17:20:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch to fix the problem--try #1 (19.41 KB, patch)
2007-10-24 22:51 UTC, Robert Peterson
no flags Details | Diff
patch to fix the problem (HEAD) (19.46 KB, patch)
2007-10-25 14:11 UTC, Robert Peterson
no flags Details | Diff
patch to fix the problem (RHEL5) (19.50 KB, patch)
2007-10-25 14:13 UTC, Robert Peterson
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0350 0 normal SHIPPED_LIVE gfs2-utils bug fix update 2008-05-20 12:44:56 UTC

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



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