Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 435540 - sys-apps/util-linux-2.22 broke sys-fs/fuse - can not unmount fuse filesystems as regular user
Summary: sys-apps/util-linux-2.22 broke sys-fs/fuse - can not unmount fuse filesystems...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://git.kernel.org/?p=utils/util-l...
Whiteboard: WAS: sys-fs/fuse: non-root user canno...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-19 19:07 UTC by Nikos Chantziaras
Modified: 2012-10-10 20:20 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info,5.42 KB, text/plain)
2012-09-19 19:07 UTC, Nikos Chantziaras
Details
Output of "emerge --info" (emerge.info.txt,17.70 KB, text/plain)
2012-09-19 20:24 UTC, José Romildo Malaquias
Details
emerge --info (fuse-info,5.66 KB, text/plain)
2012-09-20 07:07 UTC, Helmut Jarausch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Chantziaras 2012-09-19 19:07:04 UTC
It is not possible to unmount FUSE filesystems as a normal user. I'm not sure when this broke. It used to work correctly in the past.

For example:

  $ sshfs my.server.hostname: $HOME/mnt

That works.  But unmounting:

  $ umount $HOME/mnt
  umount: /home/realnc/mnt: umount failed: Operation not permitted

Trying with fusermount gives this:

  $ fusermount -u $HOME/mnt
  fusermount: entry for /home/realnc/mnt not found in /etc/mtab

However, /etc/mtab does contain an appropriate entry:

  my.server.hostname: /home/realnc/mnt fuse.sshfs rw,nosuid,nodev 0 0

The same thing also happens with NTFS-3G (which is also a FUSE filesystem):

  $ mount /windows/D
  $ umount /windows/D
  umount: /windows/D: umount failed: Operation not permitted

This has repercussions on desktop environments as well. In KDE for example, when I plug in an NTFS USB disk, it gets mounted OK. But it's impossible to unmount it again from within KDE.
Comment 1 Nikos Chantziaras 2012-09-19 19:07:33 UTC
Created attachment 324318 [details]
emerge --info
Comment 2 Nikos Chantziaras 2012-09-19 19:29:00 UTC
Forgot to mention the versions I tried:

2.8.7
2.9.0
2.9.1
2.9.1-r1

I think it's safe to say that it's not a change in fuse itself that introduced this bug, but rather a change in some other package, since it was definitely working OK with 2.9.0 at the time that it was the most recent version.
Comment 3 José Romildo Malaquias 2012-09-19 20:24:54 UTC
Created attachment 324324 [details]
Output of "emerge --info"

I am having a similar problem on my ~amd64 system.
Comment 4 Helmut Jarausch 2012-09-20 07:07:20 UTC
Created attachment 324362 [details]
emerge --info
Comment 5 Helmut Jarausch 2012-09-20 07:09:22 UTC
Same here with several versions of sys-fs/fuse  up to 2.9.1-r1
openssh-6.1_p1

sshfs-fuse 2.4 and sshfs-fuse GIT

IHMO, the severity should be raised to 'major' since it breaks daily 
backup services here.

Helmut.
Comment 6 Göktürk Yüksek archtester gentoo-dev 2012-09-20 13:52:00 UTC
Does putting something like this in /etc/fstab help?
  sshfs#my.server.hostname:$HOME /mnt fuse rw,user,noauto,fsname=sshfs#my.server.hostname:$HOME,reconnect  0 0
Comment 7 Nikos Chantziaras 2012-09-20 14:41:28 UTC
(In reply to comment #6)
> Does putting something like this in /etc/fstab help?
>   sshfs#my.server.hostname:$HOME /mnt fuse
> rw,user,noauto,fsname=sshfs#my.server.hostname:$HOME,reconnect  0 0

mount: /etc/fstab: parse error: ignore entry at line 8.
Comment 8 Helmut Jarausch 2012-09-20 16:04:15 UTC
(In reply to comment #6)
> Does putting something like this in /etc/fstab help?
>   sshfs#my.server.hostname:$HOME /mnt fuse
> rw,user,noauto,fsname=sshfs#my.server.hostname:$HOME,reconnect  0 0

With an entry like

sshfs#jarausch@WWW_SV:/srv/www/htdocs	/usr/WWW  fuse noauto,users,uid=230,gid=100,umask=0  0 0   # ,allow_other

I just get the same error message, i.e.

fusermount: entry for /usr/WWW not found in /etc/mtab

cat /etc/mtab :
jarausch@WWW_SV:/srv/www/htdocs /usr/WWW fuse.sshfs rw,nosuid,nodev,noexec 0 0

Helmut.
Comment 9 Oliver Freyermuth 2012-09-20 16:18:51 UTC
I have a machine at hand that had a folder mounted BEFORE it broke, is still running and is now broken for new mounts. 

The mtab-entry looks different in both cases: 
Old entry (i.e. fusermount -u works): 
machine:/some/older/folder /home/myname/mnt2 fuse.sshfs rw,nosuid,nodev,user=myname 0 0

New entry (i.e. it breaks): 
machine:/some/other/folder /home/myname/mnt fuse.sshfs rw,nosuid,nodev 0 0

Note the missing "user=myname" parameter which (I guess) is added by some part of fuse / sshfs? It appears fusermount is looking for it to detect mounts done by the user "myname"...
Comment 10 Krzysztof Magusiak 2012-09-22 23:33:51 UTC
Adding ",user=..." to the entry mounted by sshfs directly to /etc/mtab makes `fusermount -u` work again.
Comment 11 Göktürk Yüksek archtester gentoo-dev 2012-09-23 23:02:34 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Does putting something like this in /etc/fstab help?
> >   sshfs#my.server.hostname:$HOME /mnt fuse
> > rw,user,noauto,fsname=sshfs#my.server.hostname:$HOME,reconnect  0 0
> 
> mount: /etc/fstab: parse error: ignore entry at line 8.

That was meant to be on a single line.
Comment 12 Nikos Chantziaras 2012-09-24 15:23:19 UTC
OK, a FUSE dev (Miklos Szeredi) finally tracked the problem down. The bug is in util-linux-2.22. Upstream was actually aware of it due to a similar bug report on Arch Linux. The fix is in upstream's Git already:

http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=commit;h=4be900c51d371a7a41495e4eca2d29fc77c20c7c

I applied that on top of util-linux-2.22 and it fixed the issue. "umount" works now as normal user with NTFS-3G, and "fusermount -u" for sshfs. /etc/mtab now contains the "user=" option.
Comment 13 Andreas Proteus 2012-09-29 00:46:03 UTC
(In reply to comment #12)

I confirm also that the abovementioned patch for util-linux-2.22
solves the problem and fusermount -u now works for my user mounted
iso images which previously failed to unmount.

Thank you.
Comment 14 Sergey Popov gentoo-dev 2012-10-08 10:27:17 UTC
Reassign bug to base-system team
Comment 15 Uros 2012-10-10 08:06:16 UTC
(In reply to comment #10)
> Adding ",user=..." to the entry mounted by sshfs directly to /etc/mtab makes
> `fusermount -u` work again.

That also fixed fusermount on my end (sys-fs/fuse-2.9.1-r1, sys-fs/sshfs-fuse-2.4, sys-apps/util-linux-2.22).

After patching libmount/src/context_mount.c in sys-apps/util-linux-2.22 user sshfs unmounting works again.
Comment 16 SpanKY gentoo-dev 2012-10-10 17:32:01 UTC
should be all set now in the tree; thanks for the report!

Commit message: Add fix from upstream for umount with user= options
http://sources.gentoo.org/sys-apps/util-linux/files/util-linux-2.22-umount-user.patch?rev=1.1
http://sources.gentoo.org/sys-apps/util-linux/util-linux-2.22-r1.ebuild?rev=1.1
Comment 17 Nikos Chantziaras 2012-10-10 18:21:41 UTC
I just found another bug where "umount" with NTFS-3G doesn't work as non-root if /etc/mtab is a symlink to /proc/mounts.

But I guess that's material for a different bug.
Comment 18 SpanKY gentoo-dev 2012-10-10 20:20:47 UTC
(In reply to comment #17)

that is a known issue in the kernel that can't really be resolved by userland at this time