Bug 337961
Summary: | gfs_grow /mountpoint/ does not work | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Lutz Lange <llange> | ||||
Component: | gfs-utils | Assignee: | Chris Feist <cfeist> | ||||
Status: | CLOSED ERRATA | QA Contact: | GFS Bugs <gfs-bugs> | ||||
Severity: | low | Docs Contact: | |||||
Priority: | low | ||||||
Version: | 5.0 | ||||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i386 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | RHBA-2008-0349 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2008-05-21 14:36:32 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: | |||||||
Bug Blocks: | 345501 | ||||||
Attachments: |
|
Description
Lutz Lange
2007-10-18 13:54:28 UTC
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
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 release. 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. 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. http://rhn.redhat.com/errata/RHBA-2008-0349.html |