Bug 1427015 - Several 'mount' on filesystem needs also the same amount of 'umount' to get filesystem unmounted.
Summary: Several 'mount' on filesystem needs also the same amount of 'umount' to get f...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: util-linux
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-27 05:28 UTC by Muhammad Aizuddin Bin Zali
Modified: 2020-03-11 15:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-27 09:15:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


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