Bug 219512 - umount.cifs fails to adjust mtab when using relative pathnames
umount.cifs fails to adjust mtab when using relative pathnames
Product: Fedora
Classification: Fedora
Component: samba (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Jeff Layton
David Lawrence
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2006-12-13 12:22 EST by Need Real Name
Modified: 2014-06-18 03:35 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-02-05 14:22:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Samba Project 4370 None None None Never

  None (edit)
Description Need Real Name 2006-12-13 12:22:40 EST
Description of problem:

When giving umount.cifs a relative (rather than full) path name, the filesystem
is unmounted and properly reflected in /proc/mounts but the mtab is not,
resulting in 'stale' entries in mtab. umount works fine.

Case 1:
   mount.cifs remote /path_to/mount_point
   umount.cifs -v /path_to/mount_point

   SUCCESS: unmounted and removed from both /proc/mounts and mtab
       ioctl returned 0 with errno 0 Success
       umount2 succeeded
       attempting to remove from mtab
       1 matching entries in mount table
       entry not copied (ie entry is removed)
       done updating tmp file

Case 2:
   mount.cifs remote /path_to/mount_point
   cd mount_point; cd ..
   umount -v mount_point

   SUCCESS: unmounted and removed from both /proc/mounts and mtab
        optind 2 unmount dir /home/kosowsky/tempcrap/crap12
        umount2 succeeded
        attempting to remove from mtab
        1 matching entries in mount table
        entry not copied (ie entry is removed)
        done updating tmp file

Case 3:
   mount.cifs remote /path_to/mount_point
   cd mount_point; cd ..
   umount.cifs -v mount_point

   FAILURE: unmounted and removed from both /proc/mounts and mtab
        optind 2 unmount dir crap12
        umount2 succeeded
        attempting to remove from mtab
        0 matching entries in mount table
        done updating tmp file

Subsequently running ANY of the following:
   umount.cifs mount_point
   umount.cifs /path-to/mount_point
   umount mount_point
   umount /path-to/mount_point
Gives the following error message (repeated twice if using 'umount')
    This utility only unmounts cifs filesystems.
Comment 1 Need Real Name 2006-12-13 12:25:47 EST
If you look at the verbose output, it seems apparent that the problem is that
while umount expands the relative path to the full path (and presumably passes
that on to umount.cifs). umount.cifs does not.

So presumably umount.cifs needs to be fixed to first expand to a full pathname.
Comment 6 Need Real Name 2006-12-24 04:13:09 EST
Comment 7 Jose Plans 2006-12-24 05:49:17 EST
  The bug report you provided is correct and reflect this mtab problem where
umount.cifs cannot update it if the path sent is relative, we are investigating
in the best way to cover this and we will post a fix that will match upstream as
soon as possible. 
Comment 8 Jose Plans 2006-12-24 05:50:46 EST
As a workaround (until we get this fixed according to upstream) you can always
hand edit /etc/mtab and remove the cifs mount line. This is safe as the kernel
already removed the hook from /proc/mounts.
Comment 9 Need Real Name 2006-12-24 18:29:05 EST
Alternative workarounds include:
1. Not using relative paths :) [this is the easiest, as long as I remember]
2. Using a shell wrapper that converts relative to absolute paths...
Comment 10 Jose Plans 2006-12-28 06:09:09 EST
Or cleaner, if you won't use umount.cifs on setuid to allow users to unmount the
CIFS filesystem, then you could just do :
      % umount -i mount_point

This will tell umount not to use the external umount utility.
Comment 11 Need Real Name 2007-03-27 20:15:31 EDT
Is this fixed upstream yet?
Comment 12 Need Real Name 2007-04-11 13:10:30 EDT
Any ETA on a fix?
Comment 13 Need Real Name 2007-11-17 21:34:07 EST
This still seems to be broken in F8 -- two releases and almost a year after
first reporting the bug.

Comment 14 Simo Sorce 2007-11-21 19:42:39 EST
I am but honestly this is a low priority bug as there are simple workarounds.

Btw looking at the release notes I see that a fix for something similar went in
in 3.0.27a which I am about to release for Fedora. Not sure it covers this case tho.
Comment 15 Bug Zapper 2008-11-26 02:07:20 EST
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 16 Bug Zapper 2009-01-09 02:02:19 EST
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 17 Jeff Layton 2009-02-05 14:22:49 EST
Patch for this has now been committed to upstream samba test branches and should make its way into fedora in the near future. Closing with a resolution of UPSTREAM.

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