2015-04-27 14:53:12 +00:00
|
|
|
// +build linux
|
|
|
|
|
2013-11-07 12:33:31 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
aufs driver directory structure
|
|
|
|
|
2015-04-27 14:53:12 +00:00
|
|
|
.
|
|
|
|
├── layers // Metadata of layers
|
|
|
|
│ ├── 1
|
|
|
|
│ ├── 2
|
|
|
|
│ └── 3
|
|
|
|
├── diff // Content of the layer
|
|
|
|
│ ├── 1 // Contains layers that need to be mounted for the id
|
|
|
|
│ ├── 2
|
|
|
|
│ └── 3
|
|
|
|
└── mnt // Mount points for the rw layers to be mounted
|
|
|
|
├── 1
|
|
|
|
├── 2
|
|
|
|
└── 3
|
2013-11-07 12:33:31 +00:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2013-11-01 01:07:54 +00:00
|
|
|
package aufs
|
|
|
|
|
|
|
|
import (
|
2013-11-08 01:57:14 +00:00
|
|
|
"bufio"
|
2013-11-01 01:07:54 +00:00
|
|
|
"fmt"
|
2016-10-20 23:40:59 +00:00
|
|
|
"io"
|
2015-03-26 06:02:21 +00:00
|
|
|
"io/ioutil"
|
2013-11-01 01:07:54 +00:00
|
|
|
"os"
|
|
|
|
"os/exec"
|
|
|
|
"path"
|
2016-03-09 21:23:04 +00:00
|
|
|
"path/filepath"
|
2013-11-08 01:57:14 +00:00
|
|
|
"strings"
|
2014-01-14 11:23:20 +00:00
|
|
|
"sync"
|
2016-09-13 16:25:36 +00:00
|
|
|
"time"
|
2014-05-29 19:55:59 +00:00
|
|
|
|
2014-07-24 22:19:50 +00:00
|
|
|
"github.com/docker/docker/daemon/graphdriver"
|
2014-09-30 06:23:36 +00:00
|
|
|
"github.com/docker/docker/pkg/archive"
|
2014-10-29 19:06:51 +00:00
|
|
|
"github.com/docker/docker/pkg/chrootarchive"
|
2017-08-04 00:22:00 +00:00
|
|
|
"github.com/docker/docker/pkg/containerfs"
|
2015-02-27 18:50:55 +00:00
|
|
|
"github.com/docker/docker/pkg/directory"
|
2015-10-08 15:51:41 +00:00
|
|
|
"github.com/docker/docker/pkg/idtools"
|
2017-02-17 23:46:19 +00:00
|
|
|
"github.com/docker/docker/pkg/locker"
|
2014-07-24 22:19:50 +00:00
|
|
|
mountpk "github.com/docker/docker/pkg/mount"
|
2017-02-14 18:35:20 +00:00
|
|
|
"github.com/docker/docker/pkg/system"
|
2016-03-31 19:42:16 +00:00
|
|
|
rsystem "github.com/opencontainers/runc/libcontainer/system"
|
2017-04-18 13:26:36 +00:00
|
|
|
"github.com/opencontainers/selinux/go-selinux/label"
|
2017-07-05 14:22:57 +00:00
|
|
|
"github.com/pkg/errors"
|
2017-07-26 21:42:13 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
2017-05-23 14:22:32 +00:00
|
|
|
"github.com/vbatts/tar-split/tar/storage"
|
|
|
|
"golang.org/x/sys/unix"
|
2013-11-01 01:07:54 +00:00
|
|
|
)
|
|
|
|
|
2014-02-18 10:58:38 +00:00
|
|
|
var (
|
2015-07-22 02:15:14 +00:00
|
|
|
// ErrAufsNotSupported is returned if aufs is not supported by the host.
|
2014-02-18 10:58:38 +00:00
|
|
|
ErrAufsNotSupported = fmt.Errorf("AUFS was not found in /proc/filesystems")
|
2016-03-31 19:42:16 +00:00
|
|
|
// ErrAufsNested means aufs cannot be used bc we are in a user namespace
|
2016-05-10 13:25:54 +00:00
|
|
|
ErrAufsNested = fmt.Errorf("AUFS cannot be used in non-init user namespace")
|
|
|
|
backingFs = "<unknown>"
|
2015-03-26 06:02:21 +00:00
|
|
|
|
|
|
|
enableDirpermLock sync.Once
|
|
|
|
enableDirperm bool
|
2014-02-18 10:58:38 +00:00
|
|
|
)
|
|
|
|
|
2013-11-04 23:22:34 +00:00
|
|
|
func init() {
|
|
|
|
graphdriver.Register("aufs", Init)
|
|
|
|
}
|
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// Driver contains information about the filesystem mounted.
|
2013-11-19 11:27:59 +00:00
|
|
|
type Driver struct {
|
2016-03-27 05:53:47 +00:00
|
|
|
sync.Mutex
|
2016-03-09 21:23:04 +00:00
|
|
|
root string
|
|
|
|
uidMaps []idtools.IDMap
|
|
|
|
gidMaps []idtools.IDMap
|
2016-05-06 20:09:45 +00:00
|
|
|
ctr *graphdriver.RefCounter
|
2016-03-09 21:23:04 +00:00
|
|
|
pathCacheLock sync.Mutex
|
|
|
|
pathCache map[string]string
|
2016-04-21 16:08:37 +00:00
|
|
|
naiveDiff graphdriver.DiffDriver
|
2017-02-17 23:46:19 +00:00
|
|
|
locker *locker.Locker
|
2013-11-01 01:07:54 +00:00
|
|
|
}
|
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// Init returns a new AUFS driver.
|
2013-11-04 01:54:51 +00:00
|
|
|
// An error is returned if AUFS is not supported.
|
2015-10-08 15:51:41 +00:00
|
|
|
func Init(root string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {
|
2015-01-15 21:40:39 +00:00
|
|
|
|
2013-11-04 23:22:34 +00:00
|
|
|
// Try to load the aufs kernel module
|
2013-11-08 01:57:14 +00:00
|
|
|
if err := supportsAufs(); err != nil {
|
2014-03-27 16:41:06 +00:00
|
|
|
return nil, graphdriver.ErrNotSupported
|
2013-11-04 23:22:34 +00:00
|
|
|
}
|
2014-05-29 19:55:59 +00:00
|
|
|
|
2017-12-04 22:45:26 +00:00
|
|
|
// Perform feature detection on /var/lib/docker/aufs if it's an existing directory.
|
|
|
|
// This covers situations where /var/lib/docker/aufs is a mount, and on a different
|
|
|
|
// filesystem than /var/lib/docker.
|
|
|
|
// If the path does not exist, fall back to using /var/lib/docker for feature detection.
|
|
|
|
testdir := root
|
|
|
|
if _, err := os.Stat(testdir); os.IsNotExist(err) {
|
|
|
|
testdir = filepath.Dir(testdir)
|
|
|
|
}
|
|
|
|
|
|
|
|
fsMagic, err := graphdriver.GetFSMagic(testdir)
|
2015-01-15 21:40:39 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if fsName, ok := graphdriver.FsNames[fsMagic]; ok {
|
|
|
|
backingFs = fsName
|
2014-05-29 19:55:59 +00:00
|
|
|
}
|
|
|
|
|
2016-05-10 13:25:54 +00:00
|
|
|
switch fsMagic {
|
2016-05-31 09:36:55 +00:00
|
|
|
case graphdriver.FsMagicAufs, graphdriver.FsMagicBtrfs, graphdriver.FsMagicEcryptfs:
|
2016-05-10 13:25:54 +00:00
|
|
|
logrus.Errorf("AUFS is not supported over %s", backingFs)
|
|
|
|
return nil, graphdriver.ErrIncompatibleFS
|
2014-05-29 19:55:59 +00:00
|
|
|
}
|
|
|
|
|
2013-11-07 12:33:31 +00:00
|
|
|
paths := []string{
|
|
|
|
"mnt",
|
|
|
|
"diff",
|
|
|
|
"layers",
|
|
|
|
}
|
|
|
|
|
2014-01-14 11:23:20 +00:00
|
|
|
a := &Driver{
|
2016-03-09 21:23:04 +00:00
|
|
|
root: root,
|
|
|
|
uidMaps: uidMaps,
|
|
|
|
gidMaps: gidMaps,
|
|
|
|
pathCache: make(map[string]string),
|
2016-05-06 20:09:45 +00:00
|
|
|
ctr: graphdriver.NewRefCounter(graphdriver.NewFsChecker(graphdriver.FsMagicAufs)),
|
2017-02-17 23:46:19 +00:00
|
|
|
locker: locker.New(),
|
2014-01-14 11:23:20 +00:00
|
|
|
}
|
|
|
|
|
2015-10-08 15:51:41 +00:00
|
|
|
rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
Simplify/fix MkdirAll usage
This subtle bug keeps lurking in because error checking for `Mkdir()`
and `MkdirAll()` is slightly different wrt to `EEXIST`/`IsExist`:
- for `Mkdir()`, `IsExist` error should (usually) be ignored
(unless you want to make sure directory was not there before)
as it means "the destination directory was already there"
- for `MkdirAll()`, `IsExist` error should NEVER be ignored.
Mostly, this commit just removes ignoring the IsExist error, as it
should not be ignored.
Also, there are a couple of cases then IsExist is handled as
"directory already exist" which is wrong. As a result, some code
that never worked as intended is now removed.
NOTE that `idtools.MkdirAndChown()` behaves like `os.MkdirAll()`
rather than `os.Mkdir()` -- so its description is amended accordingly,
and its usage is handled as such (i.e. IsExist error is not ignored).
For more details, a quote from my runc commit 6f82d4b (July 2015):
TL;DR: check for IsExist(err) after a failed MkdirAll() is both
redundant and wrong -- so two reasons to remove it.
Quoting MkdirAll documentation:
> MkdirAll creates a directory named path, along with any necessary
> parents, and returns nil, or else returns an error. If path
> is already a directory, MkdirAll does nothing and returns nil.
This means two things:
1. If a directory to be created already exists, no error is
returned.
2. If the error returned is IsExist (EEXIST), it means there exists
a non-directory with the same name as MkdirAll need to use for
directory. Example: we want to MkdirAll("a/b"), but file "a"
(or "a/b") already exists, so MkdirAll fails.
The above is a theory, based on quoted documentation and my UNIX
knowledge.
3. In practice, though, current MkdirAll implementation [1] returns
ENOTDIR in most of cases described in #2, with the exception when
there is a race between MkdirAll and someone else creating the
last component of MkdirAll argument as a file. In this very case
MkdirAll() will indeed return EEXIST.
Because of #1, IsExist check after MkdirAll is not needed.
Because of #2 and #3, ignoring IsExist error is just plain wrong,
as directory we require is not created. It's cleaner to report
the error now.
Note this error is all over the tree, I guess due to copy-paste,
or trying to follow the same usage pattern as for Mkdir(),
or some not quite correct examples on the Internet.
[1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-09-25 19:39:36 +00:00
|
|
|
// Create the root aufs driver dir
|
2017-11-18 23:52:47 +00:00
|
|
|
if err := idtools.MkdirAllAndChown(root, 0700, idtools.IDPair{UID: rootUID, GID: rootGID}); err != nil {
|
2013-11-07 12:33:31 +00:00
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2014-10-30 21:04:56 +00:00
|
|
|
if err := mountpk.MakePrivate(root); err != nil {
|
2014-06-05 19:50:53 +00:00
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
Simplify and fix os.MkdirAll() usage
TL;DR: check for IsExist(err) after a failed MkdirAll() is both
redundant and wrong -- so two reasons to remove it.
Quoting MkdirAll documentation:
> MkdirAll creates a directory named path, along with any necessary
> parents, and returns nil, or else returns an error. If path
> is already a directory, MkdirAll does nothing and returns nil.
This means two things:
1. If a directory to be created already exists, no error is returned.
2. If the error returned is IsExist (EEXIST), it means there exists
a non-directory with the same name as MkdirAll need to use for
directory. Example: we want to MkdirAll("a/b"), but file "a"
(or "a/b") already exists, so MkdirAll fails.
The above is a theory, based on quoted documentation and my UNIX
knowledge.
3. In practice, though, current MkdirAll implementation [1] returns
ENOTDIR in most of cases described in #2, with the exception when
there is a race between MkdirAll and someone else creating the
last component of MkdirAll argument as a file. In this very case
MkdirAll() will indeed return EEXIST.
Because of #1, IsExist check after MkdirAll is not needed.
Because of #2 and #3, ignoring IsExist error is just plain wrong,
as directory we require is not created. It's cleaner to report
the error now.
Note this error is all over the tree, I guess due to copy-paste,
or trying to follow the same usage pattern as for Mkdir(),
or some not quite correct examples on the Internet.
[v2: a separate aufs commit is merged into this one]
[1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-07-29 23:49:05 +00:00
|
|
|
// Populate the dir structure
|
2013-11-07 12:33:31 +00:00
|
|
|
for _, p := range paths {
|
2017-11-18 23:52:47 +00:00
|
|
|
if err := idtools.MkdirAllAndChown(path.Join(root, p), 0700, idtools.IDPair{UID: rootUID, GID: rootGID}); err != nil {
|
2013-11-07 12:33:31 +00:00
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
2017-08-22 18:17:19 +00:00
|
|
|
logger := logrus.WithFields(logrus.Fields{
|
|
|
|
"module": "graphdriver",
|
|
|
|
"driver": "aufs",
|
|
|
|
})
|
2016-04-21 16:08:37 +00:00
|
|
|
|
2017-08-21 21:38:13 +00:00
|
|
|
for _, path := range []string{"mnt", "diff"} {
|
|
|
|
p := filepath.Join(root, path)
|
2017-08-22 18:17:19 +00:00
|
|
|
entries, err := ioutil.ReadDir(p)
|
2017-08-21 21:38:13 +00:00
|
|
|
if err != nil {
|
2017-08-22 18:17:19 +00:00
|
|
|
logger.WithError(err).WithField("dir", p).Error("error reading dir entries")
|
2017-08-21 21:38:13 +00:00
|
|
|
continue
|
|
|
|
}
|
2017-08-22 18:17:19 +00:00
|
|
|
for _, entry := range entries {
|
|
|
|
if !entry.IsDir() {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if strings.HasSuffix(entry.Name(), "-removing") {
|
|
|
|
logger.WithField("dir", entry.Name()).Debug("Cleaning up stale layer dir")
|
|
|
|
if err := system.EnsureRemoveAll(filepath.Join(p, entry.Name())); err != nil {
|
|
|
|
logger.WithField("dir", entry.Name()).WithError(err).Error("Error removing stale layer dir")
|
2017-08-21 21:38:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-21 16:08:37 +00:00
|
|
|
a.naiveDiff = graphdriver.NewNaiveDiffDriver(a, uidMaps, gidMaps)
|
2014-01-14 11:23:20 +00:00
|
|
|
return a, nil
|
2013-11-01 01:07:54 +00:00
|
|
|
}
|
|
|
|
|
2013-11-08 01:57:14 +00:00
|
|
|
// Return a nil error if the kernel supports aufs
|
|
|
|
// We cannot modprobe because inside dind modprobe fails
|
|
|
|
// to run
|
|
|
|
func supportsAufs() error {
|
2013-11-14 17:42:12 +00:00
|
|
|
// We can try to modprobe aufs first before looking at
|
|
|
|
// proc/filesystems for when aufs is supported
|
|
|
|
exec.Command("modprobe", "aufs").Run()
|
|
|
|
|
2016-03-31 19:42:16 +00:00
|
|
|
if rsystem.RunningInUserNS() {
|
|
|
|
return ErrAufsNested
|
|
|
|
}
|
|
|
|
|
2013-11-08 01:57:14 +00:00
|
|
|
f, err := os.Open("/proc/filesystems")
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
defer f.Close()
|
|
|
|
|
|
|
|
s := bufio.NewScanner(f)
|
|
|
|
for s.Scan() {
|
|
|
|
if strings.Contains(s.Text(), "aufs") {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
2014-02-18 10:58:38 +00:00
|
|
|
return ErrAufsNotSupported
|
2013-11-08 01:57:14 +00:00
|
|
|
}
|
|
|
|
|
2014-12-12 18:46:09 +00:00
|
|
|
func (a *Driver) rootPath() string {
|
2013-11-08 19:36:58 +00:00
|
|
|
return a.root
|
2013-11-07 12:33:31 +00:00
|
|
|
}
|
|
|
|
|
2014-12-12 18:46:09 +00:00
|
|
|
func (*Driver) String() string {
|
2013-11-07 12:33:31 +00:00
|
|
|
return "aufs"
|
|
|
|
}
|
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// Status returns current information about the filesystem such as root directory, number of directories mounted, etc.
|
2014-12-12 18:46:09 +00:00
|
|
|
func (a *Driver) Status() [][2]string {
|
2013-11-20 21:53:54 +00:00
|
|
|
ids, _ := loadIds(path.Join(a.rootPath(), "layers"))
|
|
|
|
return [][2]string{
|
|
|
|
{"Root Dir", a.rootPath()},
|
2015-01-15 21:40:39 +00:00
|
|
|
{"Backing Filesystem", backingFs},
|
2013-11-20 21:53:54 +00:00
|
|
|
{"Dirs", fmt.Sprintf("%d", len(ids))},
|
2015-03-26 17:58:49 +00:00
|
|
|
{"Dirperm1 Supported", fmt.Sprintf("%v", useDirperm())},
|
2013-11-20 21:53:54 +00:00
|
|
|
}
|
2013-11-15 10:04:02 +00:00
|
|
|
}
|
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// GetMetadata not implemented
|
2015-06-15 18:05:10 +00:00
|
|
|
func (a *Driver) GetMetadata(id string) (map[string]string, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2013-11-19 01:20:03 +00:00
|
|
|
// Exists returns true if the given id is registered with
|
|
|
|
// this driver
|
2014-12-12 18:46:09 +00:00
|
|
|
func (a *Driver) Exists(id string) bool {
|
2013-11-19 07:28:45 +00:00
|
|
|
if _, err := os.Lstat(path.Join(a.rootPath(), "layers", id)); err != nil {
|
2013-11-16 01:16:30 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2016-02-19 01:24:59 +00:00
|
|
|
// CreateReadWrite creates a layer that is writable for use as a container
|
|
|
|
// file system.
|
2016-11-09 20:59:58 +00:00
|
|
|
func (a *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error {
|
|
|
|
return a.Create(id, parent, opts)
|
2016-02-19 01:24:59 +00:00
|
|
|
}
|
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// Create three folders for each id
|
2013-11-07 12:33:31 +00:00
|
|
|
// mnt, layers, and diff
|
2016-11-09 20:59:58 +00:00
|
|
|
func (a *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error {
|
2016-03-20 04:42:58 +00:00
|
|
|
|
2016-11-09 20:59:58 +00:00
|
|
|
if opts != nil && len(opts.StorageOpt) != 0 {
|
2016-03-20 04:42:58 +00:00
|
|
|
return fmt.Errorf("--storage-opt is not supported for aufs")
|
|
|
|
}
|
|
|
|
|
2016-02-27 12:54:17 +00:00
|
|
|
if err := a.createDirsFor(id); err != nil {
|
2013-11-05 04:51:12 +00:00
|
|
|
return err
|
|
|
|
}
|
2013-11-07 12:33:31 +00:00
|
|
|
// Write the layers metadata
|
|
|
|
f, err := os.Create(path.Join(a.rootPath(), "layers", id))
|
|
|
|
if err != nil {
|
2013-11-05 04:51:12 +00:00
|
|
|
return err
|
|
|
|
}
|
2013-11-07 12:33:31 +00:00
|
|
|
defer f.Close()
|
2013-11-05 04:51:12 +00:00
|
|
|
|
2013-11-07 12:33:31 +00:00
|
|
|
if parent != "" {
|
2016-04-21 16:08:37 +00:00
|
|
|
ids, err := getParentIDs(a.rootPath(), parent)
|
2013-11-07 12:33:31 +00:00
|
|
|
if err != nil {
|
2013-11-05 04:51:12 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2016-02-27 12:54:17 +00:00
|
|
|
if _, err := fmt.Fprintln(f, parent); err != nil {
|
2013-11-08 19:10:33 +00:00
|
|
|
return err
|
|
|
|
}
|
2013-11-07 12:33:31 +00:00
|
|
|
for _, i := range ids {
|
2016-02-27 12:54:17 +00:00
|
|
|
if _, err := fmt.Fprintln(f, i); err != nil {
|
2013-11-08 19:10:33 +00:00
|
|
|
return err
|
|
|
|
}
|
2013-11-07 12:33:31 +00:00
|
|
|
}
|
2013-11-05 04:51:12 +00:00
|
|
|
}
|
2016-03-09 21:23:04 +00:00
|
|
|
|
2013-11-05 04:51:12 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-03-01 05:32:30 +00:00
|
|
|
// createDirsFor creates two directories for the given id.
|
|
|
|
// mnt and diff
|
2013-11-19 11:27:59 +00:00
|
|
|
func (a *Driver) createDirsFor(id string) error {
|
2013-11-07 12:33:31 +00:00
|
|
|
paths := []string{
|
|
|
|
"mnt",
|
|
|
|
"diff",
|
|
|
|
}
|
2013-11-05 04:51:12 +00:00
|
|
|
|
2015-10-08 15:51:41 +00:00
|
|
|
rootUID, rootGID, err := idtools.GetRootUIDGID(a.uidMaps, a.gidMaps)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2016-03-01 05:32:30 +00:00
|
|
|
// Directory permission is 0755.
|
|
|
|
// The path of directories are <aufs_root_path>/mnt/<image_id>
|
|
|
|
// and <aufs_root_path>/diff/<image_id>
|
2013-11-07 12:33:31 +00:00
|
|
|
for _, p := range paths {
|
2017-11-18 23:52:47 +00:00
|
|
|
if err := idtools.MkdirAllAndChown(path.Join(a.rootPath(), p, id), 0755, idtools.IDPair{UID: rootUID, GID: rootGID}); err != nil {
|
2013-11-07 12:33:31 +00:00
|
|
|
return err
|
|
|
|
}
|
2013-11-05 04:51:12 +00:00
|
|
|
}
|
2013-11-07 12:33:31 +00:00
|
|
|
return nil
|
|
|
|
}
|
2013-11-05 04:51:12 +00:00
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// Remove will unmount and remove the given id.
|
2013-11-19 11:27:59 +00:00
|
|
|
func (a *Driver) Remove(id string) error {
|
2017-02-17 23:46:19 +00:00
|
|
|
a.locker.Lock(id)
|
|
|
|
defer a.locker.Unlock(id)
|
2016-03-09 21:23:04 +00:00
|
|
|
a.pathCacheLock.Lock()
|
|
|
|
mountpoint, exists := a.pathCache[id]
|
|
|
|
a.pathCacheLock.Unlock()
|
|
|
|
if !exists {
|
|
|
|
mountpoint = a.getMountpoint(id)
|
2013-11-05 04:51:12 +00:00
|
|
|
}
|
2016-09-13 16:25:36 +00:00
|
|
|
|
2017-07-05 14:22:57 +00:00
|
|
|
logger := logrus.WithFields(logrus.Fields{
|
|
|
|
"module": "graphdriver",
|
|
|
|
"driver": "aufs",
|
|
|
|
"layer": id,
|
|
|
|
})
|
|
|
|
|
2016-09-13 16:25:36 +00:00
|
|
|
var retries int
|
|
|
|
for {
|
|
|
|
mounted, err := a.mounted(mountpoint)
|
|
|
|
if err != nil {
|
2017-07-05 14:22:57 +00:00
|
|
|
if os.IsNotExist(err) {
|
|
|
|
break
|
|
|
|
}
|
2016-09-13 16:25:36 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
if !mounted {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
2017-07-05 14:22:57 +00:00
|
|
|
err = a.unmount(mountpoint)
|
|
|
|
if err == nil {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != unix.EBUSY {
|
|
|
|
return errors.Wrapf(err, "aufs: unmount error: %s", mountpoint)
|
|
|
|
}
|
|
|
|
if retries >= 5 {
|
|
|
|
return errors.Wrapf(err, "aufs: unmount error after retries: %s", mountpoint)
|
2016-09-13 16:25:36 +00:00
|
|
|
}
|
2017-07-05 14:22:57 +00:00
|
|
|
// If unmount returns EBUSY, it could be a transient error. Sleep and retry.
|
|
|
|
retries++
|
|
|
|
logger.Warnf("unmount failed due to EBUSY: retry count: %d", retries)
|
|
|
|
time.Sleep(100 * time.Millisecond)
|
2013-11-07 12:33:31 +00:00
|
|
|
}
|
|
|
|
|
2017-08-21 21:38:13 +00:00
|
|
|
// Remove the layers file for the id
|
|
|
|
if err := os.Remove(path.Join(a.rootPath(), "layers", id)); err != nil && !os.IsNotExist(err) {
|
|
|
|
return errors.Wrapf(err, "error removing layers dir for %s", id)
|
2016-03-09 21:23:04 +00:00
|
|
|
}
|
|
|
|
|
2017-08-21 21:38:13 +00:00
|
|
|
if err := atomicRemove(a.getDiffPath(id)); err != nil {
|
|
|
|
return errors.Wrapf(err, "could not remove diff path for id %s", id)
|
2013-11-07 12:33:31 +00:00
|
|
|
}
|
2016-03-09 21:23:04 +00:00
|
|
|
|
2017-08-21 21:38:13 +00:00
|
|
|
// Atomically remove each directory in turn by first moving it out of the
|
|
|
|
// way (so that docker doesn't find it anymore) before doing removal of
|
|
|
|
// the whole tree.
|
|
|
|
if err := atomicRemove(mountpoint); err != nil {
|
|
|
|
if errors.Cause(err) == unix.EBUSY {
|
|
|
|
logger.WithField("dir", mountpoint).WithError(err).Warn("error performing atomic remove due to EBUSY")
|
|
|
|
}
|
|
|
|
return errors.Wrapf(err, "could not remove mountpoint for id %s", id)
|
2013-11-20 01:08:21 +00:00
|
|
|
}
|
2016-03-09 21:23:04 +00:00
|
|
|
|
|
|
|
a.pathCacheLock.Lock()
|
|
|
|
delete(a.pathCache, id)
|
|
|
|
a.pathCacheLock.Unlock()
|
2013-11-20 01:08:21 +00:00
|
|
|
return nil
|
2013-11-05 04:51:12 +00:00
|
|
|
}
|
|
|
|
|
2017-08-21 21:38:13 +00:00
|
|
|
func atomicRemove(source string) error {
|
|
|
|
target := source + "-removing"
|
|
|
|
|
|
|
|
err := os.Rename(source, target)
|
|
|
|
switch {
|
|
|
|
case err == nil, os.IsNotExist(err):
|
|
|
|
case os.IsExist(err):
|
|
|
|
// Got error saying the target dir already exists, maybe the source doesn't exist due to a previous (failed) remove
|
|
|
|
if _, e := os.Stat(source); !os.IsNotExist(e) {
|
|
|
|
return errors.Wrapf(err, "target rename dir '%s' exists but should not, this needs to be manually cleaned up")
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
return errors.Wrapf(err, "error preparing atomic delete")
|
|
|
|
}
|
|
|
|
|
|
|
|
return system.EnsureRemoveAll(target)
|
|
|
|
}
|
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// Get returns the rootfs path for the id.
|
2016-07-21 10:03:37 +00:00
|
|
|
// This will mount the dir at its given path
|
2017-08-04 00:22:00 +00:00
|
|
|
func (a *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) {
|
2017-02-17 23:46:19 +00:00
|
|
|
a.locker.Lock(id)
|
|
|
|
defer a.locker.Unlock(id)
|
2016-02-12 15:20:16 +00:00
|
|
|
parents, err := a.getParentLayerPaths(id)
|
|
|
|
if err != nil && !os.IsNotExist(err) {
|
2017-08-04 00:22:00 +00:00
|
|
|
return nil, err
|
2016-02-12 15:20:16 +00:00
|
|
|
}
|
|
|
|
|
2016-03-09 21:23:04 +00:00
|
|
|
a.pathCacheLock.Lock()
|
|
|
|
m, exists := a.pathCache[id]
|
|
|
|
a.pathCacheLock.Unlock()
|
|
|
|
|
|
|
|
if !exists {
|
|
|
|
m = a.getDiffPath(id)
|
|
|
|
if len(parents) > 0 {
|
|
|
|
m = a.getMountpoint(id)
|
|
|
|
}
|
|
|
|
}
|
2016-05-06 20:09:45 +00:00
|
|
|
if count := a.ctr.Increment(m); count > 1 {
|
2017-08-04 00:22:00 +00:00
|
|
|
return containerfs.NewLocalContainerFS(m), nil
|
2016-05-06 20:09:45 +00:00
|
|
|
}
|
2016-03-09 21:23:04 +00:00
|
|
|
|
2013-11-07 12:33:31 +00:00
|
|
|
// If a dir does not have a parent ( no layers )do not try to mount
|
|
|
|
// just return the diff path to the data
|
2016-02-12 15:20:16 +00:00
|
|
|
if len(parents) > 0 {
|
2016-03-09 21:23:04 +00:00
|
|
|
if err := a.mount(id, m, mountLabel, parents); err != nil {
|
2017-08-04 00:22:00 +00:00
|
|
|
return nil, err
|
2013-11-07 12:33:31 +00:00
|
|
|
}
|
|
|
|
}
|
2016-03-09 21:23:04 +00:00
|
|
|
|
|
|
|
a.pathCacheLock.Lock()
|
|
|
|
a.pathCache[id] = m
|
|
|
|
a.pathCacheLock.Unlock()
|
2017-08-04 00:22:00 +00:00
|
|
|
return containerfs.NewLocalContainerFS(m), nil
|
2013-11-07 12:33:31 +00:00
|
|
|
}
|
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// Put unmounts and updates list of active mounts.
|
2015-01-09 22:14:52 +00:00
|
|
|
func (a *Driver) Put(id string) error {
|
2017-02-17 23:46:19 +00:00
|
|
|
a.locker.Lock(id)
|
|
|
|
defer a.locker.Unlock(id)
|
2016-03-09 21:23:04 +00:00
|
|
|
a.pathCacheLock.Lock()
|
|
|
|
m, exists := a.pathCache[id]
|
|
|
|
if !exists {
|
|
|
|
m = a.getMountpoint(id)
|
|
|
|
a.pathCache[id] = m
|
2015-08-26 23:12:17 +00:00
|
|
|
}
|
2016-03-09 21:23:04 +00:00
|
|
|
a.pathCacheLock.Unlock()
|
2016-05-06 20:09:45 +00:00
|
|
|
if count := a.ctr.Decrement(m); count > 0 {
|
|
|
|
return nil
|
|
|
|
}
|
2016-03-09 21:23:04 +00:00
|
|
|
|
|
|
|
err := a.unmount(m)
|
|
|
|
if err != nil {
|
|
|
|
logrus.Debugf("Failed to unmount %s aufs: %v", id, err)
|
2014-01-14 11:23:20 +00:00
|
|
|
}
|
2016-03-09 21:23:04 +00:00
|
|
|
return err
|
2013-12-05 21:18:02 +00:00
|
|
|
}
|
|
|
|
|
2016-04-21 16:08:37 +00:00
|
|
|
// isParent returns if the passed in parent is the direct parent of the passed in layer
|
|
|
|
func (a *Driver) isParent(id, parent string) bool {
|
|
|
|
parents, _ := getParentIDs(a.rootPath(), id)
|
|
|
|
if parent == "" && len(parents) > 0 {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return !(len(parents) > 0 && parent != parents[0])
|
|
|
|
}
|
|
|
|
|
2014-09-11 03:30:52 +00:00
|
|
|
// Diff produces an archive of the changes between the specified
|
|
|
|
// layer and its parent layer which may be "".
|
2016-10-20 23:40:59 +00:00
|
|
|
func (a *Driver) Diff(id, parent string) (io.ReadCloser, error) {
|
2016-04-21 16:08:37 +00:00
|
|
|
if !a.isParent(id, parent) {
|
|
|
|
return a.naiveDiff.Diff(id, parent)
|
|
|
|
}
|
|
|
|
|
2014-09-11 03:30:52 +00:00
|
|
|
// AUFS doesn't need the parent layer to produce a diff.
|
2014-02-14 00:05:36 +00:00
|
|
|
return archive.TarWithOptions(path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
|
2014-10-23 21:30:11 +00:00
|
|
|
Compression: archive.Uncompressed,
|
2015-09-29 17:18:28 +00:00
|
|
|
ExcludePatterns: []string{archive.WhiteoutMetaPrefix + "*", "!" + archive.WhiteoutOpaqueDir},
|
2015-10-08 15:51:41 +00:00
|
|
|
UIDMaps: a.uidMaps,
|
|
|
|
GIDMaps: a.gidMaps,
|
2013-11-12 01:17:38 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2016-02-19 01:58:23 +00:00
|
|
|
type fileGetNilCloser struct {
|
|
|
|
storage.FileGetter
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f fileGetNilCloser) Close() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// DiffGetter returns a FileGetCloser that can read files from the directory that
|
|
|
|
// contains files for the layer differences. Used for direct access for tar-split.
|
|
|
|
func (a *Driver) DiffGetter(id string) (graphdriver.FileGetCloser, error) {
|
|
|
|
p := path.Join(a.rootPath(), "diff", id)
|
|
|
|
return fileGetNilCloser{storage.NewPathFileGetter(p)}, nil
|
2015-12-04 21:27:44 +00:00
|
|
|
}
|
|
|
|
|
2016-10-20 23:40:59 +00:00
|
|
|
func (a *Driver) applyDiff(id string, diff io.Reader) error {
|
2016-01-21 15:52:37 +00:00
|
|
|
return chrootarchive.UntarUncompressed(diff, path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
|
2015-10-08 15:51:41 +00:00
|
|
|
UIDMaps: a.uidMaps,
|
|
|
|
GIDMaps: a.gidMaps,
|
2016-01-21 15:52:37 +00:00
|
|
|
})
|
2013-11-07 12:33:31 +00:00
|
|
|
}
|
2013-11-01 01:07:54 +00:00
|
|
|
|
2014-09-11 03:30:52 +00:00
|
|
|
// DiffSize calculates the changes between the specified id
|
|
|
|
// and its parent and returns the size in bytes of the changes
|
|
|
|
// relative to its base filesystem directory.
|
2014-12-18 02:26:03 +00:00
|
|
|
func (a *Driver) DiffSize(id, parent string) (size int64, err error) {
|
2016-04-21 16:08:37 +00:00
|
|
|
if !a.isParent(id, parent) {
|
|
|
|
return a.naiveDiff.DiffSize(id, parent)
|
|
|
|
}
|
2014-09-11 03:30:52 +00:00
|
|
|
// AUFS doesn't need the parent layer to calculate the diff size.
|
2015-02-27 18:50:55 +00:00
|
|
|
return directory.Size(path.Join(a.rootPath(), "diff", id))
|
2013-11-07 12:33:31 +00:00
|
|
|
}
|
|
|
|
|
2014-09-11 03:30:52 +00:00
|
|
|
// ApplyDiff extracts the changeset from the given diff into the
|
|
|
|
// layer with the specified id and parent, returning the size of the
|
|
|
|
// new layer in bytes.
|
2016-10-20 23:40:59 +00:00
|
|
|
func (a *Driver) ApplyDiff(id, parent string, diff io.Reader) (size int64, err error) {
|
2016-04-21 16:08:37 +00:00
|
|
|
if !a.isParent(id, parent) {
|
|
|
|
return a.naiveDiff.ApplyDiff(id, parent, diff)
|
|
|
|
}
|
|
|
|
|
|
|
|
// AUFS doesn't need the parent id to apply the diff if it is the direct parent.
|
2014-09-11 03:30:52 +00:00
|
|
|
if err = a.applyDiff(id, diff); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
return a.DiffSize(id, parent)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Changes produces a list of changes between the specified layer
|
|
|
|
// and its parent layer. If parent is "", then all changes will be ADD changes.
|
|
|
|
func (a *Driver) Changes(id, parent string) ([]archive.Change, error) {
|
2016-04-21 16:08:37 +00:00
|
|
|
if !a.isParent(id, parent) {
|
|
|
|
return a.naiveDiff.Changes(id, parent)
|
|
|
|
}
|
|
|
|
|
2014-09-11 03:30:52 +00:00
|
|
|
// AUFS doesn't have snapshots, so we need to get changes from all parent
|
|
|
|
// layers.
|
2013-11-08 19:10:33 +00:00
|
|
|
layers, err := a.getParentLayerPaths(id)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return archive.Changes(layers, path.Join(a.rootPath(), "diff", id))
|
|
|
|
}
|
|
|
|
|
2013-11-19 11:27:59 +00:00
|
|
|
func (a *Driver) getParentLayerPaths(id string) ([]string, error) {
|
2016-04-21 16:08:37 +00:00
|
|
|
parentIds, err := getParentIDs(a.rootPath(), id)
|
2013-11-08 19:10:33 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
layers := make([]string, len(parentIds))
|
|
|
|
|
|
|
|
// Get the diff paths for all the parent ids
|
|
|
|
for i, p := range parentIds {
|
|
|
|
layers[i] = path.Join(a.rootPath(), "diff", p)
|
|
|
|
}
|
|
|
|
return layers, nil
|
2013-11-07 12:33:31 +00:00
|
|
|
}
|
|
|
|
|
2016-03-09 21:23:04 +00:00
|
|
|
func (a *Driver) mount(id string, target string, mountLabel string, layers []string) error {
|
2016-03-27 05:53:47 +00:00
|
|
|
a.Lock()
|
|
|
|
defer a.Unlock()
|
|
|
|
|
2013-11-07 12:33:31 +00:00
|
|
|
// If the id is mounted or we get an error return
|
2016-03-09 21:23:04 +00:00
|
|
|
if mounted, err := a.mounted(target); err != nil || mounted {
|
2013-11-01 01:07:54 +00:00
|
|
|
return err
|
|
|
|
}
|
2013-11-07 12:33:31 +00:00
|
|
|
|
2016-03-09 21:23:04 +00:00
|
|
|
rw := a.getDiffPath(id)
|
2013-11-07 12:33:31 +00:00
|
|
|
|
2014-04-17 23:47:27 +00:00
|
|
|
if err := a.aufsMount(layers, rw, target, mountLabel); err != nil {
|
2015-03-12 13:15:32 +00:00
|
|
|
return fmt.Errorf("error creating aufs mount to %s: %v", target, err)
|
2013-11-01 01:07:54 +00:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-03-09 21:23:04 +00:00
|
|
|
func (a *Driver) unmount(mountPath string) error {
|
2016-03-27 05:53:47 +00:00
|
|
|
a.Lock()
|
|
|
|
defer a.Unlock()
|
|
|
|
|
2016-03-09 21:23:04 +00:00
|
|
|
if mounted, err := a.mounted(mountPath); err != nil || !mounted {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := Unmount(mountPath); err != nil {
|
2013-11-01 01:07:54 +00:00
|
|
|
return err
|
|
|
|
}
|
2016-03-09 21:23:04 +00:00
|
|
|
return nil
|
2013-11-01 01:07:54 +00:00
|
|
|
}
|
|
|
|
|
2016-03-09 21:23:04 +00:00
|
|
|
func (a *Driver) mounted(mountpoint string) (bool, error) {
|
|
|
|
return graphdriver.Mounted(graphdriver.FsMagicAufs, mountpoint)
|
2013-11-05 04:51:12 +00:00
|
|
|
}
|
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// Cleanup aufs and unmount all mountpoints
|
2013-11-19 11:27:59 +00:00
|
|
|
func (a *Driver) Cleanup() error {
|
2016-03-09 21:23:04 +00:00
|
|
|
var dirs []string
|
|
|
|
if err := filepath.Walk(a.mntPath(), func(path string, info os.FileInfo, err error) error {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if !info.IsDir() {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dirs = append(dirs, path)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, m := range dirs {
|
2015-08-26 23:12:17 +00:00
|
|
|
if err := a.unmount(m); err != nil {
|
2016-07-25 23:10:28 +00:00
|
|
|
logrus.Debugf("aufs error unmounting %s: %s", m, err)
|
2013-11-05 04:51:12 +00:00
|
|
|
}
|
|
|
|
}
|
2014-06-05 19:50:53 +00:00
|
|
|
return mountpk.Unmount(a.root)
|
2013-11-01 01:07:54 +00:00
|
|
|
}
|
|
|
|
|
2014-04-17 23:47:27 +00:00
|
|
|
func (a *Driver) aufsMount(ro []string, rw, target, mountLabel string) (err error) {
|
2013-11-26 18:50:53 +00:00
|
|
|
defer func() {
|
|
|
|
if err != nil {
|
|
|
|
Unmount(target)
|
|
|
|
}
|
|
|
|
}()
|
2013-11-01 01:07:54 +00:00
|
|
|
|
2014-11-13 17:57:28 +00:00
|
|
|
// Mount options are clipped to page size(4096 bytes). If there are more
|
|
|
|
// layers then these are remounted individually using append.
|
|
|
|
|
2015-03-26 06:02:21 +00:00
|
|
|
offset := 54
|
|
|
|
if useDirperm() {
|
2017-06-08 11:21:52 +00:00
|
|
|
offset += len(",dirperm1")
|
2015-03-26 06:02:21 +00:00
|
|
|
}
|
2017-05-23 14:22:32 +00:00
|
|
|
b := make([]byte, unix.Getpagesize()-len(mountLabel)-offset) // room for xino & mountLabel
|
2014-11-13 17:57:28 +00:00
|
|
|
bp := copy(b, fmt.Sprintf("br:%s=rw", rw))
|
|
|
|
|
2016-09-14 03:01:45 +00:00
|
|
|
index := 0
|
|
|
|
for ; index < len(ro); index++ {
|
|
|
|
layer := fmt.Sprintf(":%s=ro+wh", ro[index])
|
|
|
|
if bp+len(layer) > len(b) {
|
|
|
|
break
|
2013-11-01 01:07:54 +00:00
|
|
|
}
|
2016-09-14 03:01:45 +00:00
|
|
|
bp += copy(b[bp:], layer)
|
|
|
|
}
|
2013-11-26 18:50:53 +00:00
|
|
|
|
2016-09-14 03:01:45 +00:00
|
|
|
opts := "dio,xino=/dev/shm/aufs.xino"
|
|
|
|
if useDirperm() {
|
|
|
|
opts += ",dirperm1"
|
|
|
|
}
|
|
|
|
data := label.FormatMountLabel(fmt.Sprintf("%s,%s", string(b[:bp]), opts), mountLabel)
|
|
|
|
if err = mount("none", target, "aufs", 0, data); err != nil {
|
|
|
|
return
|
|
|
|
}
|
2013-11-26 18:50:53 +00:00
|
|
|
|
2016-09-14 03:01:45 +00:00
|
|
|
for ; index < len(ro); index++ {
|
|
|
|
layer := fmt.Sprintf(":%s=ro+wh", ro[index])
|
|
|
|
data := label.FormatMountLabel(fmt.Sprintf("append%s", layer), mountLabel)
|
2017-05-23 14:22:32 +00:00
|
|
|
if err = mount("none", target, "aufs", unix.MS_REMOUNT, data); err != nil {
|
2016-09-14 03:01:45 +00:00
|
|
|
return
|
2014-11-13 17:57:28 +00:00
|
|
|
}
|
2013-11-26 18:50:53 +00:00
|
|
|
}
|
2014-11-13 17:57:28 +00:00
|
|
|
|
|
|
|
return
|
2013-11-01 01:07:54 +00:00
|
|
|
}
|
2015-03-26 06:02:21 +00:00
|
|
|
|
|
|
|
// useDirperm checks dirperm1 mount option can be used with the current
|
|
|
|
// version of aufs.
|
|
|
|
func useDirperm() bool {
|
|
|
|
enableDirpermLock.Do(func() {
|
|
|
|
base, err := ioutil.TempDir("", "docker-aufs-base")
|
|
|
|
if err != nil {
|
2015-03-30 18:46:44 +00:00
|
|
|
logrus.Errorf("error checking dirperm1: %v", err)
|
2015-03-26 06:02:21 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
defer os.RemoveAll(base)
|
|
|
|
|
|
|
|
union, err := ioutil.TempDir("", "docker-aufs-union")
|
|
|
|
if err != nil {
|
2015-03-30 18:46:44 +00:00
|
|
|
logrus.Errorf("error checking dirperm1: %v", err)
|
2015-03-26 06:02:21 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
defer os.RemoveAll(union)
|
|
|
|
|
|
|
|
opts := fmt.Sprintf("br:%s,dirperm1,xino=/dev/shm/aufs.xino", base)
|
|
|
|
if err := mount("none", union, "aufs", 0, opts); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
enableDirperm = true
|
|
|
|
if err := Unmount(union); err != nil {
|
2015-03-30 18:46:44 +00:00
|
|
|
logrus.Errorf("error checking dirperm1: failed to unmount %v", err)
|
2015-03-26 06:02:21 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
return enableDirperm
|
|
|
|
}
|