FS#41628 - [util-linux] umount cannot unmount davfs

Attached to Project: Arch Linux
Opened by Janis Beckert (SuperFluffy) - Tuesday, 19 August 2014, 09:39 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 13 September 2014, 15:12 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
Running umount on a folder/mountpoint mounted through davfs2 does not work. It produces an error message about too many arguments.

Calling umount.davfs manually (i.e. not through umount) unmounts the mountpoint as expected.

I have tested this behaviour with two different webdav interfaces (box.com, and my university's).

It looks like umount is trying to pass the “-t” argument to umount.davfs. This one however is not among the valid or ignored parameters of umount.davfs, triggering the following lines in umount_davfs.c:
if (optind < (argc - 1))
error(EXIT_FAILURE, 0, _("too many arguments"));

Additional info:
* package version(s)
util-linux 2.25-3
davfs2 1.5.0-1

* config and/or log files etc.

Error as produced from umount:
% umount ./box.com
/sbin/umount.davfs: invalid option -- 't'
/sbin/umount.davfs: too many arguments
zsh: exit 1 sudo umount -v -t davfs box.com

Expected result (i.e. running through umount.davfs):
% umount.davfs box.com
umount.davfs: waiting while mount.davfs (pid 6327) synchronizes the cache .. OK


Steps to reproduce:
Mount webdav filesystem. Unmount using $ umount /path/to/mountpoint, observe error.
This task depends upon

Closed by  Dave Reisner (falconindy)
Saturday, 13 September 2014, 15:12 GMT
Reason for closing:  Fixed
Additional comments about closing:  util-linux 2.25.1
Comment by Dave Reisner (falconindy) - Tuesday, 19 August 2014, 21:40 GMT
Why does running "umount" result in:
> zsh: exit 1 sudo umount -v -t davfs box.com

Where does the sudo come from? What about the -v? Have you aliased/wrapped umount somehow?
Comment by Janis Beckert (SuperFluffy) - Tuesday, 19 August 2014, 22:42 GMT
Sorry, my bad: I ran umount with verbose settings and tried to see what happens if I explicitly pass it -t davfs (I should have made that explicit in the report above). Either way, the result is the same:

% unalias umount # just to make sure
% umout box.com
/sbin/umount.davfs: invalid option -- 't'
/sbin/umount.davfs: too many arguments
zsh: exit 1 umount box.com
Comment by Dave Reisner (falconindy) - Tuesday, 19 August 2014, 23:32 GMT
Could you repeat the umount command with LIBMOUNT_DEBUG=0xffff exported, and capture the output?
Comment by Janis Beckert (SuperFluffy) - Wednesday, 20 August 2014, 09:34 GMT
Here it is:
% env LIBMOUNT_DEBUG=0xffff umount box.com
6133: libmount: INIT: library debug mask: 0xffff
6133: libmount: INIT: library version: 2.25.0
6133: libmount: INIT: feature: assert
6133: libmount: INIT: feature: debug
6133: libmount: CXT: [0xd02110]: ----> allocate [RESTRICTED]
6133: libmount: CXT: [0xd02110]: umount: /home/janis/box.com
6133: libmount: CXT: [0xd02110]: umount: lookup FS for '/home/janis/box.com'
6133: libmount: CXT: [0xd02110]: checking for writable tab files
6133: libmount: UTILS: mtab: /etc/mtab
6133: libmount: UTILS: /etc/mtab: irregular/non-writable
6133: libmount: UTILS: utab: /run/mount/utab
6133: libmount: CACHE: [0xd03320]: alloc
6133: libmount: CACHE: [0xd03320]: canonicalize path /home/janis/box.com
6133: libmount: CACHE: [0xd03320]: add entry [ 1] (path): /home/janis/box.com: /home/janis/box.com
6133: libmount: CXT: [0xd02110]: tabfilter ENABLED!
6133: libmount: TAB: [0xd04f80]: alloc
6133: libmount: TAB: [0xd04f80]: set table parser filter
6133: libmount: UTILS: mtab: /etc/mtab
6133: libmount: UTILS: /etc/mtab: irregular/non-writable
6133: libmount: TAB: [0xd04f80]: /proc/self/mountinfo: start parsing [entries=0, filter=yes]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: TAB: [0xd04f80]: add entry: https://dav.box.com/dav /home/janis/box.com
6133: libmount: CACHE: canonicalize path /proc/self/mountinfo
6133: libmount: TAB: TID for /proc/self/mountinfo is 6133
6133: libmount: FS: [0xd05300]: free [refcount=0]
6133: libmount: TAB: [0xd04f80]: /proc/self/mountinfo: stop parsing (1 entries)
6133: libmount: TAB: [0xd05300]: alloc
6133: libmount: TAB: [0xd05300]: set table parser filter
6133: libmount: TAB: [0xd05300]: /run/mount/utab: start parsing [entries=0, filter=yes]
6133: libmount: TAB: [0xd05300]: add entry: https://dav.box.com/dav /home/janis/box.com
6133: libmount: FS: [0xd05470]: free [refcount=0]
6133: libmount: TAB: [0xd05300]: /run/mount/utab: stop parsing (1 entries)
6133: libmount: TAB: [0xd04f80]: merging user fs
6133: libmount: TAB: [0xd04f80]: found fs -- appending user optstr
6133: libmount: TAB: [0xd04f80]: found fs:
6133: libmount: TAB: ------ fs: 0xd05220
source: https://dav.box.com/dav
target: /home/janis/box.com
fstype: fuse
optstr: rw,nosuid,nodev,noexec,relatime,user_id=1000,group_id=100,allow_other,max_read=16384,uid=1000,gid=100,user=janis,helper=davfs
VFS-optstr: rw,nosuid,nodev,noexec,relatime
FS-opstr: rw,user_id=1000,group_id=100,allow_other,max_read=16384,uid=1000,gid=100
user-optstr: user=janis,helper=davfs
optional-fields: 'shared:65'
root: /
id: 114
parent: 70
devno: 0:37
tid: 6133
6133: libmount: TAB: [0xd05300]: reset
6133: libmount: FS: [0xd05360]: free [refcount=0]
6133: libmount: TAB: [0xd05300]: free [refcount=0]
6133: libmount: CXT: [0xd02110]: mtab requested [nents=1]
6133: libmount: TAB: [0xd04f80]: unset table parser filter
6133: libmount: CXT: [0xd02110]: tabfilter disabled
6133: libmount: TAB: [0xd04f80]: lookup TARGET: '/home/janis/box.com'
6133: libmount: CXT: [0xd02110]: umount fs: /home/janis/box.com
6133: libmount: CXT: [0xd02110]: umount: mtab applied
6133: libmount: CXT: [0xd02110]: merging mount flags
6133: libmount: CXT: [0xd02110]: final flags: VFS=0020000e user=00001008
6133: libmount: CXT: [0xd02110]: umount: evaluating permissions
6133: libmount: TAB: [0xd05060]: alloc
6133: libmount: TAB: [0xd05060]: /etc/fstab: start parsing [entries=0, filter=not]
6133: libmount: TAB: [0xd05060]: add entry: tmpfs /tmp
6133: libmount: TAB: [0xd05060]: add entry: /dev/sda2 /
6133: libmount: TAB: [0xd05060]: add entry: /dev/sda1 /boot
6133: libmount: TAB: [0xd05060]: add entry: /dev/sda3 /var
6133: libmount: TAB: [0xd05060]: add entry: /dev/sda4 /home
6133: libmount: TAB: [0xd05060]: add entry: https://dav.box.com/dav /home/janis/box.com
6133: libmount: FS: [0xd050c0]: free [refcount=0]
6133: libmount: TAB: [0xd05060]: /etc/fstab: stop parsing (6 entries)
6133: libmount: TAB: [0xd05060]: lookup SOURCE: https://dav.box.com/dav TARGET: /home/janis/box.com
6133: libmount: CACHE: [0xd03320]: canonicalize path /tmp
6133: libmount: CACHE: [0xd03320]: add entry [ 2] (path): /tmp: /tmp
6133: libmount: CACHE: [0xd03320]: canonicalize path /
6133: libmount: CACHE: [0xd03320]: add entry [ 3] (path): /: /
6133: libmount: CACHE: [0xd03320]: canonicalize path /boot
6133: libmount: CACHE: [0xd03320]: add entry [ 4] (path): /boot: /boot
6133: libmount: CACHE: [0xd03320]: canonicalize path /var
6133: libmount: CACHE: [0xd03320]: add entry [ 5] (path): /var: /var
6133: libmount: CACHE: [0xd03320]: canonicalize path /home
6133: libmount: CACHE: [0xd03320]: add entry [ 6] (path): /home: /home
6133: libmount: CXT: [0xd02110]: umount: checking user=<username> from mtab
6133: libmount: CXT: [0xd02110]: umount /home/janis/box.com is allowed
6133: libmount: CXT: [0xd02110]: umount: umount.davfs helper requested
6133: libmount: CXT: [0xd02110]: /sbin/umount.davfs ... found
6133: libmount: CXT: [0xd02110]: prepare update
6133: libmount: UPDATE: [0xd05890]: allocate
6133: libmount: UPDATE: [0xd05890]: resetting FS [fs=0x(nil), target=/home/janis/box.com, flags=0x0020000e]
6133: libmount: UPDATE: [0xd05890]: ready
6134: libmount: CXT: [0xd02110]: argv[0] = "/sbin/umount.davfs"
6134: libmount: CXT: [0xd02110]: argv[1] = "/home/janis/box.com"
6134: libmount: CXT: [0xd02110]: argv[2] = "-t"
6134: libmount: CXT: [0xd02110]: argv[3] = "fuse"
/sbin/umount.davfs: invalid option -- 't'
/sbin/umount.davfs: too many arguments
6133: libmount: CXT: [0xd02110]: /sbin/umount.davfs executed [status=1]
6133: libmount: CXT: [0xd02110]: don't update: external helper
6133: libmount: CXT: [0xd02110]: <---- reset [status=1] ---->
6133: libmount: FS: [0xd03220]: free [refcount=0]
6133: libmount: TAB: [0xd04f80]: reset
6133: libmount: FS: [0xd05220]: free [refcount=0]
6133: libmount: TAB: [0xd04f80]: free [refcount=0]
6133: libmount: CXT: [0xd02110]: <---- reset [status=0] ---->
6133: libmount: TAB: [0xd05060]: reset
6133: libmount: FS: [0xd056b0]: free [refcount=0]
6133: libmount: FS: [0xd059b0]: free [refcount=0]
6133: libmount: FS: [0xd05c90]: free [refcount=0]
6133: libmount: FS: [0xd05f50]: free [refcount=0]
6133: libmount: FS: [0xd06230]: free [refcount=0]
6133: libmount: FS: [0xd06510]: free [refcount=0]
6133: libmount: TAB: [0xd05060]: free [refcount=0]
6133: libmount: CACHE: [0xd03320]: free [refcount=0]
6133: libmount: UPDATE: [0xd05890]: free
6133: libmount: CXT: [0xd02110]: <---- free
zsh: exit 1 env LIBMOUNT_DEBUG=0xffff umount box.com
Comment by Janis Beckert (SuperFluffy) - Wednesday, 20 August 2014, 09:36 GMT
I guess these lines are interesting:
6134: libmount: CXT: [0xd02110]: argv[2] = "-t"
6134: libmount: CXT: [0xd02110]: argv[3] = "fuse"

umount.davfs chokes on -t (as it should, looking at its source). I wonder why umount passes it that flag?
Comment by Dave Reisner (falconindy) - Wednesday, 20 August 2014, 11:23 GMT
The logic says to append the -t flag and fstype when the helper doesn't match the fstype. In this case, it's detected as fuse, so -t davfs is appended.

Could you report this upstream?
Comment by Janis Beckert (SuperFluffy) - Wednesday, 20 August 2014, 13:56 GMT
I have reported this on the davfs2 bugtracker. You can see the report here:
https://savannah.nongnu.org/support/?108638

I thought it would be most appropriate to have the davfs2 maintainer add -t to the list of ignored flags.
Comment by Dave Reisner (falconindy) - Wednesday, 20 August 2014, 14:06 GMT
Uh, sorry, I meant to report this to util-linux. That flag shouldn't be added in this case.
Comment by Janis Beckert (SuperFluffy) - Wednesday, 20 August 2014, 15:00 GMT
And another report:
https://github.com/karelzak/util-linux/issues/116

I really hope, that Github repository is the right place to report this. But I found some comments from you, Dave, and it seems like somebody there is paying attention.
Comment by Dave Reisner (falconindy) - Wednesday, 20 August 2014, 15:07 GMT
github is fine -- the alternative would be util-linux@vger.kernel.org.
Comment by aaaaaaaaaaaaaaaaaaaa (Pyroh) - Monday, 25 August 2014, 18:54 GMT
This has been fixed in git apparently

https://github.com/karelzak/util-linux/commit/e4ea53de0b6bc31303fdfc9ebb546bce4527c5d6

Can someone test this?
Comment by Dave Reisner (falconindy) - Tuesday, 26 August 2014, 02:26 GMT
> This has been fixed in git apparently
Yup, that's what happens when you report things upstream.

> Can someone test this?
I'm sure it works, but yes, it'd be nice to confirm. I've not yet backpored this because I've been out of town.

Loading...