zfs unmount fails because of double umount call
When I try to unmount zfs dataset, I get and error:
- zfs create pool/root/test
- strace -ff zfs unmount pool/root/test
umount: can’t unmount /test: Invalid argument
cannot unmount ‘/test’: umount failed
If I run it under strace (), I see that it calls umount2() twice:
- strace -ff zfs unmount pool/root/test
…
[pid 957] umount2(“/test”, 0) = 0
[pid 957] open(“/test”, O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_PATH) = 6
[pid 957] readlink(“/proc/self/fd/6”, “/test”, 4095) = 5
[pid 957] fstat(6, {st_mode=S_IFDIR|0755, st_size=2, …}) = 0
[pid 957] stat(“/test”, {st_mode=S_IFDIR|0755, st_size=2, …}) = 0
[pid 957] close(6) = 0
[pid 957] umount2(“/test”, 0) = –1 EINVAL (Invalid argument)
…
So it actually unmounts the dataset during the first syscall, but trying to do it again and fails during the second. It not such a problem when running by hands. But for example lxd fails to work with zfs storage driver because of that.
I have access to non-alpine systems with zfs (but much older version 0.6.3) - there are no problems. And I found nothing during googling. So I think it could be Alpine-specific bug.
(from redmine: issue id 8498, created on 2018-02-18)