FS#27948 - [cifs-utils] Update to mtab in 'filesystem' breaks mounting/unmounting of SMB shares

Attached to Project: Arch Linux
Opened by Curtis (foxcm2000) - Sunday, 15 January 2012, 17:26 GMT
Last edited by Tom Gundersen (tomegun) - Tuesday, 13 November 2012, 17:54 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tom Gundersen (tomegun)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

For a long time I've been using openVPN and SAMBA to mount shares from a SAMBA server for work. I went through the process of putting entries into fstab so that I could just mount/unmount as a regular user dynamically, since I only wanted to mount the shares for short periods of time.

This setup worked fine for over a year up until the newest round of updates to the filesystem package that nuked /etc/mtab and replaced it with a symlink to /proc/self/mounts. Now, I am able to mount the directory as a regular user just fine, but if I try to unmount the share, I get this error:

umount /mnt/public
umount: only root can unmount //192.168.XXX.XXX/public from /mnt/public

I've read of multiple people online who have had similar issues. I've tried adding/removing trailing '/' characters from the directory paths, but nothing seems to help. Then I ran across some posts stating that if the '/etc/mtab' file is a symlink and not an actual file, the mount program will get confused and think there is an error in the entries and refuse to unmount the share. I have to unmount as the superuser, which is not a very good solution.

So my question is, now that mtab is not supposed to be a real file, how do we fix this problem? Not being able to mount/unmount shares that are clearly part of the fstab is a real bug that should be addressed. Is there a better command to use than mount/unmount that knows how to use the new /proc/self/shares configuration?


Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:
This task depends upon

Closed by  Tom Gundersen (tomegun)
Tuesday, 13 November 2012, 17:54 GMT
Reason for closing:  Fixed
Comment by Jan de Groot (JGC) - Sunday, 15 January 2012, 18:19 GMT
I guess this is a bug in libmount that has surfaced in other reports also. After mounting, look in /etc/mtab (/proc/mounts) and check how the paths are listed. Make sure they're exactly the same as /etc/fstab by modifying that one. It seems umount doesn't see the "user" option in /etc/fstab if the trailing / is missing on the mountpoint line.
Comment by Dave Reisner (falconindy) - Sunday, 15 January 2012, 20:26 GMT
Not a bug in libmount -- the problem is that mounts.cifs isn't linked against libmount and therefore doesn't know that it needs to write options that the kernel doesn't recognize to /run/mount/utab.
Comment by Tobias Powalowski (tpowa) - Thursday, 19 January 2012, 07:52 GMT
Please try latest cifs-utils.
Comment by Curtis (foxcm2000) - Friday, 20 January 2012, 00:32 GMT
I upgraded to the latest CIFS-utils package (5.2-1). The disagreement with fstab is gone, but here's a new error:

umount: only root can unmount //192.168.XXX.XXX/public from /mnt/public

Notes:
1. I have the 'user' option specified in fstab, and the mount command still works fine, just the unmount fails.
2. I have tried adding/removing a trailing '/' from the network path in fstab, but the results are the same either way.
Comment by Curtis (foxcm2000) - Thursday, 02 February 2012, 02:34 GMT
FYI: I just upgraded to cifs-utils 5.3 and the problem is still present. Could the version of my CIFS kernel module affect this operation? I am using the Arch stock kernel 3.2.2-1 under x86_64.
Comment by Curtis (foxcm2000) - Friday, 03 February 2012, 13:21 GMT
OK: New Bug: The exact same fstab entry that worked fine before using the "user" and "uid=<username>" arguments now refuses to let my regular user account write to the Samba share! I *can* still write if I use 'sudo' instead of just performing the command. This latest regression cropped up after the upgrade to cifs-utils 5.3.

I just noticed that if I mount the share manually from the command line with the uid=<username> option, then it does set the ownership correctly. However, the exact same arguments in fstab get ignored and it doesn't work when I just mount the share directly.
Comment by Dave Reisner (falconindy) - Saturday, 04 February 2012, 20:00 GMT
One bug report, one bug. Regressions in cifs-utils are unrelated to the problems being caused by a lack of libmount linkage.
Comment by Tom Gundersen (tomegun) - Tuesday, 13 November 2012, 13:10 GMT
Still a problem?
Comment by Curtis (foxcm2000) - Tuesday, 13 November 2012, 17:49 GMT
Actually, this bug as originally reported is still open. I can mount SMB shares as a regular user just fine with the correct fstab entries, but I still can't unmount the network filesystem without sudo. There is some discussion of unrelated bugs above, but those have been fixed. The one remaining bug is that I can't unmount the share as a regular user even with the "user" and "uid" options set in fstab.

Loading...