Bug 484190

Summary: mount: tmpfs to reject mounts of the same mountpoint
Product: [Fedora] Fedora Reporter: Ondrej Valousek <ondrejv>
Component: util-linux-ngAssignee: Karel Zak <kzak>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 10CC: kzak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-05 12:18:24 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:

Description Ondrej Valousek 2009-02-05 10:11:50 UTC
Description of problem:
mount should reject attempts to mount already mounted filesystem. Example: 
[root@dorado_v1 /]# mount dorado:/exports/ext1/tmp /tmp2 
[root@dorado_v1 /]# mount dorado:/exports/ext1/tmp /tmp2 
mount.nfs: /tmp2 is already mounted or busy 
-- correct behavior. However if I try the same using tmpfs, it does not reject it: 
[root@dorado_v1 /]# mount -t tmpfs none /tmp2 
[root@dorado_v1 /]# mount -t tmpfs none /tmp2 
So /tmp2 is mounted twice now. This should not be possible.

Version-Release number of selected component (if applicable):
All versions of Fedora and RHEL are affected by this bug.

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:
/tmp2 is mounted twice using tmpfs

Expected results:
Once /tmp2 is mounted, any consequential mounts to this mountpoint should be refused (as it already work for NFS, for example).

Additional info:

Comment 1 Karel Zak 2009-02-05 12:18:24 UTC
That's correct.

You cannot mount the same filesystem on the same mountpoint more than once (e.g your NFS), BUT linux supports overlaying -- it means you can mount more (different) filesystems on the same mountpoint, e.g:

  mount /dev/foo /mnt
  mount /dev/bar /mnt

and you can also mount the same device on more places, e.g:

 mount /dev/foo /mnt
 mount /dev/foo /mnt2

Note that the "tmpfs" is always unique filesystem.