Bug 337961 - gfs_grow /mountpoint/ does not work
gfs_grow /mountpoint/ does not work
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gfs-utils (Show other bugs)
5.0
i386 Linux
low Severity low
: ---
: ---
Assigned To: Chris Feist
GFS Bugs
:
Depends On:
Blocks: 345501
  Show dependency treegraph
 
Reported: 2007-10-18 09:54 EDT by Lutz Lange
Modified: 2010-01-11 22:33 EST (History)
0 users

See Also:
Fixed In Version: RHBA-2008-0349
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 10:36:32 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 (1.29 KB, patch)
2007-10-22 11:54 EDT, Robert Peterson
no flags Details | Diff

  None (edit)
Description Lutz Lange 2007-10-18 09:54:28 EDT
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!
Comment 1 Robert Peterson 2007-10-22 11:54:01 EDT
Created attachment 234211 [details]
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
Comment 2 Robert Peterson 2007-10-22 11:55:11 EDT
Requesting ACK flags so I can ship the fix for RHEL5.2.
Comment 3 RHEL Product and Program Management 2007-10-22 12:07:51 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 4 Robert Peterson 2007-10-23 10:31:31 EDT
My patch above uses function realpath(), as the gfs/gfs2 mount helper
mount.gfs2 already does.  However, the man page for realpath() says:
"Avoid  using  this function. It is broken by design...".
I also found web pages alluding to the use of realpath() being a
potential security risk.

Based on that, I started researching what other file systems do and
what alternatives exist.

I didn't find any viable alternative, which is surprising.

The nfs-utils package use realpath() as well as a few others.  Shocked,
I asked Steve Dickson about it, but as usual, he answered my ping but
ignored my question.

The util-linux package has coded their own myrealpath() function that's
not usable elsewhere.

File systems like ext3 and xfs don't use realpath().  Without spending
a lot of time on them, it looked like they broke paths down into
constituent tokens and used them in search tables.

Other file systems like msdos, hfs, and jfs don't seem to care.
They'll apparently let you shoot yourself in the foot if you specify
/dev////device in one place and /dev/device in another.  This is, for
example, when checking /etc/mtab to see if you're trying to do a mkfs
while the file system is mounted.

So catch-22:
I don't want to reinvent the wheel here and write my own, yet
I'm reluctant to use the original because of the warnings.
Still, we need something.
Comment 5 Lutz Lange 2007-10-24 03:22:41 EDT
I dont think we really need /dev///device to work. That counts as a typo where
i'm standing. What needs to work is /mountpoint/ where we have a / as last char.
I extensively use bash auto-completion so i get a slash as last char if i
specify the mountpoint. This mountpoint is not found in /etc/fstab ... 
Proposed fix : remove the last slash from the string it there is one. 
Comment 6 Robert Peterson 2007-10-25 17:32:57 EDT
Given the discussion on tech-list, and given that we already use
realpath() in other places, I'm going ahead with this patch as posted.
I committed the fix to the HEAD and RHEL5 branches for inclusion into
RHEL5.2.  Both HEAD and RHEL5 versions were tested on system roth-01.
Changing the status to modified.
Comment 9 errata-xmlrpc 2008-05-21 10:36:32 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-0349.html

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