Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1427015

Summary: Several 'mount' on filesystem needs also the same amount of 'umount' to get filesystem unmounted.
Product: Red Hat Enterprise Linux 7 Reporter: Muhammad Aizuddin Bin Zali <muhammad.zali>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: muhammad.zali, rvdwees
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-27 09:15:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Muhammad Aizuddin Bin Zali 2017-02-27 05:28:23 UTC
Description of problem:
Unmount need several umount command to get nfs unmounted when the nfs mounted is remounted on top of the mounted mount.

Version-Release number of selected component (if applicable):
util-linux-2.23.2-33.el7.x86_64

How reproducible:
mount the nfs several time

mount nfs:/path /mnt <-- do this several times and then try to umount the mount point. It will also needs several umount command to get it unmounted. 

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
Only takes one umount command to get the mounted filesystem unmounted despite how many mount command being ran on the mount point.

Additional info:

Comment 2 Karel Zak 2017-02-27 09:15:28 UTC
It works as expected and it's wanted behaviour.

Comment 3 Muhammad Aizuddin Bin Zali 2017-02-27 11:09:34 UTC
(In reply to Karel Zak from comment #2)
> It works as expected and it's wanted behaviour.

Hi Karel,

Any reference on why this is expected and wanted behaviour?

Regards

Comment 4 Karel Zak 2017-02-27 11:47:02 UTC
You can create multiple mount nodes on the same place (same mountpoint).

For example imagine situation when you have running process (web server, DB, ...) that uses something from /foo and you don't want to kill the process, but you want to force a new instances of the process to use new version of the /foo. In this case you can mount new content over the old. The old running process will still use the old (now by path invisible data), but new process will use new version. 

We use this for example during system boot where original system root is from initramfs, but later replaced by a real device ... and so on.

The umount has to work the same but in opposite way.


Note that mount the same source to the same target (mountpoint) is not always possible (mount(2) syscall returns EBUSY). It depends on the used kernel filesystem driver.

Not sure, but if I good remember network filesystems (e.g. cifs) has no problem to use the same source more than one for the same target, for example cifs:

# mount /mnt/sounds
# mount /mnt/sounds
# findmnt -o TARGET,SOURCE
...
└─/mnt/sounds                         //sr.net.home/sounds
  └─/mnt/sounds                       //sr.net.home/sounds

# umount /mnt/sounds 
# findmnt -o TARGET,SOURCE
...
└─/mnt/sounds                         //sr.net.home/sounds
# umount /mnt/sounds


Anyway, umount works correctly in this case -- one umount(2) call foe each node.

Comment 5 Karel Zak 2017-02-27 11:51:26 UTC
All I want to say is that for system all the mounts are independent, so it's necessary to use separate umount calls.

Comment 6 Muhammad Aizuddin Bin Zali 2017-02-28 05:36:44 UTC
Hi Karel,

Thanks! Understood!

Regards