openzfs/zfs

umount: only root can use "--types" option

Open

#8,478 创建于 2019年3月6日

在 GitHub 查看
 (15 评论) (0 反应) (0 负责人)C (9,908 star) (1,703 fork)batch import
Type: Defectgood first issue

描述

System information

Type Version/Name
Distribution Name Ubuntu
Distribution Version bionic (18.04.2)
Linux Kernel 4.15.0-46-generic
Architecture x86_64
ZFS Version 0.7.5-1ubuntu16
SPL Version 0.7.5-1ubuntu1

Describe the problem you're observing

When I try to create a volume as a non root user, I get a pretty warning explaining that as a non root user zfs can't mount the volume. When I try to destroy a volume as a non root user, I get a technical warning (from /bin/umount)

The equivalent error can be seen here:

$ /bin/umount x --types foo
umount: only root can use "--types" option

Ideally, just as zfs create gives a human readable warning when it knows it can't mount a volume, zfs destroy should give a human readable warning when it knows it can't unmount a volume.

Describe how to reproduce the problem

$ sudo zfs allow user create,mount,destroy pool/vol
$ zfs create pool/vol/test
filesystem successfully created, but it may only be mounted by root
$ sudo zfs mount pool/vol/test
$ zfs destroy pool/vol/test
umount: only root can use "--types" option
cannot unmount '/vol/test': umount failed

Include any warning/errors/backtraces from the system logs

贡献者指南