The errors returned from Mount and Unmount functions are raw
syscall.Errno errors (like EPERM or EINVAL), which provides
no context about what has happened and why.
Similar to os.PathError type, introduce mount.Error type
with some context. The error messages will now look like this:
> mount /tmp/mount-tests/source:/tmp/mount-tests/target, flags: 0x1001: operation not permitted
or
> mount tmpfs:/tmp/mount-test-source-516297835: operation not permitted
Before this patch, it was just
> operation not permitted
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1. There is absolutely no need to consult /proc/self/mountinfo
before calling umount(2) -- it's easier to go ahead and ignore
EINVAL.
Here, EINVAL can mean two things:
- the path argument is not a mount point (i.e. it's not mounted)
- the flags argument is invalid (i.e. bad flags)
We assume we never pass the wrong flags to umount(2), so
EINVAL means "not mounted" and can safely be ignored.
This should speed up Umount() a lot.
2. For every Unix, umount is implemented in the same way,
so let's consolidate the umount code.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Had to vendor in a new version of golang.org/x/net to build
Also had to make some changes to drivers to handle
archive.Reader -> io.Reader
archive.Archive -> io.ReadCloser
Also update .gitingore to ignore emacs files, containers-storage.*
and generated man pages.
Also no longer test travis against golang 1.7, cri-o, moby have also
done this.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Mount is self contained and generic, it should be in pkg, to allow other pkg modules to use it.
Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)