Bug 436316

Summary: mount -o remount leaves artefacts in /etc/mtab
Product: [Fedora] Fedora Reporter: David Juran <djuran>
Component: cifs-utilsAssignee: Jeff Layton <jlayton>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: gdeschner, jlayton, sprabhu, ssorce, steved
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: 2012-01-28 09:11:24 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description David Juran 2008-03-06 09:40:37 EST
Description of problem:
I've noticed that after running mount -o remount on a CIFS file system,
subsequent mount commands will show both the old and the new mount. Also, both
mounts are present in /etc/mtab

Version-Release number of selected component (if applicable):
samba-3.0.28-0.fc8
kernel-2.6.23.15-137.fc8

How reproducible:
Every time

Steps to Reproduce:
1.  mount -t cifs -ouser=djuran,passwd=redhat,ro //localhost/share /tmp/mount
2.  mount -t cifs -ouser=djuran,passwd=redhat,rw,remount //localhost/share
/tmp/mount
3. [root@F8 ~]# mount |grep localhost
//localhost/share on /tmp/mount type cifs (ro,mand)
//localhost/share on /tmp/mount type cifs (rw,mand)
4. [root@F8 ~]# grep localhost /etc/mtab 
//localhost/share /tmp/mount cifs ro,mand 0 0
//localhost/share /tmp/mount cifs rw,mand 0 0

Additional info:
The kernel seems to have done the right thing though so for all I know, this is
purely a cosmetic issue.
[root@F8 ~]# grep localhost /proc/mounts 
//localhost/share /tmp/mount cifs
rw,mand,relatime,unc=\\localhost\share,username=djuran,posixpaths,rsize=16384,wsize=57344
0 0
Comment 1 Bug Zapper 2008-11-26 05:02:38 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: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 2 Jeff Layton 2008-12-02 17:56:27 EST
Confirmed. mount.cifs adds a new mtab entry even though the mount isn't actually affected. Shouldn't be too hard to prevent that...

I don't think we actually do remounts properly in CIFS, so we probably ought to return an error rather than attempting to remount anyway. I'll look into it...
Comment 3 Bug Zapper 2009-06-09 05:28:31 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 Bug Zapper 2010-04-27 07:56:07 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  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 '11'.

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 11'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 11 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: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Bug Zapper 2010-07-30 06:31:27 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Fedora Admin XMLRPC Client 2010-10-08 10:42:45 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 7 Guenther Deschner 2011-04-04 12:21:28 EDT
Jeff, is this still a problem ?
Comment 8 Jeff Layton 2011-04-04 13:56:59 EDT
Yep. It's a 2 part problem...

1) mount.cifs needs to remove the old entry and then replace it with a new one on remount rather than just adding the new one

2) the kernel doesn't do remounts properly -- it just unconditionally returns 0 without actually changing anything

...both need fixing.
Comment 9 Jeff Layton 2012-01-28 09:11:24 EST
Ok, I believe this is no longer an issue, at least in recent fedora releases. This has been fixed in mainline cifs-utils and should show up in rawhide soon, thanks to a patch by Carlos Maolino. Also, fedora kernels now ship with /etc/mtab as a symlink to /proc/mounts, which obviously obviates the problem.

In point of fact, cifs does not do remounts properly -- it still just returns 0 without doing anything, but that's really a separate problem and needs a separate bug.