Red Hat Bugzilla – Bug 337961
gfs_grow /mountpoint/ does not work
Last modified: 2010-01-11 22:33:28 EST
Description of problem:
# gfs_grow /mountpoint/ does not work
Version-Release number of selected component (if applicable):
# 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
# gfs_growfs should not care about the last slash!
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
Requesting ACK flags so I can ship the fix for RHEL5.2.
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
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.
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.
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.
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.
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.