Skip to content

Commit

Permalink
Merge pull request #21714 from hallyn/2016-03-31/aufs.2
Browse files Browse the repository at this point in the history
don't try to use aufs in a user namespace
  • Loading branch information
calavera committed Apr 12, 2016
2 parents b6a08c3 + 2a71f28 commit 7c16063
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions daemon/graphdriver/aufs/aufs.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ import (
"github.com/docker/docker/pkg/stringid"

"github.com/opencontainers/runc/libcontainer/label"
rsystem "github.com/opencontainers/runc/libcontainer/system"
)

var (
// ErrAufsNotSupported is returned if aufs is not supported by the host.
ErrAufsNotSupported = fmt.Errorf("AUFS was not found in /proc/filesystems")
// ErrAufsNested means aufs cannot be used bc we are in a user namespace
ErrAufsNested = fmt.Errorf("AUFS cannot be used in non-init user namespace")
incompatibleFsMagic = []graphdriver.FsMagic{
graphdriver.FsMagicBtrfs,
graphdriver.FsMagicAufs,
Expand Down Expand Up @@ -146,6 +149,10 @@ func supportsAufs() error {
// proc/filesystems for when aufs is supported
exec.Command("modprobe", "aufs").Run()

if rsystem.RunningInUserNS() {
return ErrAufsNested
}

f, err := os.Open("/proc/filesystems")
if err != nil {
return err
Expand Down

0 comments on commit 7c16063

Please sign in to comment.