Bug 503266 - mountpoint named tmpfs confuses the mount command
mountpoint named tmpfs confuses the mount command
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: util-linux-ng (Show other bugs)
10
All Linux
low Severity low
: ---
: ---
Assigned To: Karel Zak
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-30 04:54 EDT by Vlado Potisk
Modified: 2009-06-19 09:38 EDT (History)
1 user (show)

See Also:
Fixed In Version: 2.14.1-3.3.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-19 09:38:50 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)

  None (edit)
Description Vlado Potisk 2009-05-30 04:54:25 EDT
Description of problem:
Under some circumstances "mount DIR" command ignores /etc/fstab and does not fail

Version-Release number of selected component (if applicable):
util-linux-ng-2.14.1-3.2.fc10.x86_64

How reproducible:
always

Steps to Reproduce:
1 optional: add a line to /etc/fstab for /mnt/tmpfs
2.cd /mnt
3.mkdir tmpfs
4.mount tmpfs  or  mount ./tmpfs  or  mount /mnt/tmpfs
  
Actual results:
Command successfull, but nothing is mounted on /mnt/tmpfs

Expected results:
A filesystem specified in /etc/fstab should be mounted on /mnt/tmpfs or an error should occur

Additional info:
The name tmpfs in the mountpoint path name obviously confuses the mount. There is the standard tmpfs filesystem line in /etc/fstab:
  tmpfs /dev/shm tmpfs defaults 0 0

/proc/mounts and /etc/mtab are updated, but the entries look bogus, because the first field is the mountpoint, not a device:
/mnt/tmpfs /dev/shm tmpfs rw 0 0
Comment 1 Fedora Update System 2009-06-01 08:08:15 EDT
util-linux-ng-2.14.1-3.3.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/util-linux-ng-2.14.1-3.3.fc10
Comment 2 Fedora Update System 2009-06-02 10:29:39 EDT
util-linux-ng-2.14.1-3.3.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update util-linux-ng'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-5775
Comment 3 Vlado Potisk 2009-06-05 17:35:44 EDT
I have tested the update today.

There is an entry for tmpfs on /dev/shm and another tmpfs on /mnt/tmpfs in my fstab.

Both   mount ./tmpfs   and   mount /mnt/tmpfs   work fine, also umount is OK, but
   mount tmpfs    is ambiguous, it can be understood as   mount DEVICE   or   mount DIR. There is an inconsistency between mount and umount: the mount command chooses the first form (tmpfs as pseudo device name) and mounts a new filesystem on /dev/shm on the top of the already mounted filesystem. On the other hand   umount tmpfs   chooses the latter (tmpfs as mountpoint) and fails with "not mounted" error.

In my opinion, the first field of a fstab entry for a virtual filesystem should be distinguishable from a real device name or a mountpoint name. It would prevent the described ambiguity. For example:
  /dev/virtual/tmpfs /dev/shm tmpfs defaults 0 0
instead of:
  tmpfs /dev/shm tmpfs defaults 0 0
However this is not a problem of util-linux-ng.
Comment 4 Karel Zak 2009-06-08 04:13:31 EDT
(In reply to comment #3)
> prevent the described ambiguity. For example:
>   /dev/virtual/tmpfs /dev/shm tmpfs defaults 0 0
> instead of:
>   tmpfs /dev/shm tmpfs defaults 0 0
> However this is not a problem of util-linux-ng.  

The first fstab field (= source argument for mount(2) syscall) is not important for pseudo-filesystems. You can use:

  foo /dev/shm tmpfs defaults 0 0

or so. It's user's responsibility to use non-ambivalent fstab.

Thanks for your tests Vlado.
Comment 5 Fedora Update System 2009-06-19 09:38:37 EDT
util-linux-ng-2.14.1-3.3.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

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