Skip to content

Commit

Permalink
Merge pull request #9834 from jfrazelle/9820-overlay-btrfs
Browse files Browse the repository at this point in the history
Add error when running overlay over btrfs.
  • Loading branch information
crosbymichael committed Jan 6, 2015
2 parents 84dc197 + 32f1025 commit 9d1caf4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions daemon/graphdriver/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ func Init(home string, options []string) (graphdriver.Driver, error) {
return nil, graphdriver.ErrNotSupported
}

// check if they are running over btrfs
var buf syscall.Statfs_t
if err := syscall.Statfs(path.Dir(home), &buf); err != nil {
return nil, err
}

switch graphdriver.FsMagic(buf.Type) {
case graphdriver.FsMagicBtrfs:
log.Error("'overlay' is not supported over btrfs.")
return nil, graphdriver.ErrIncompatibleFS
case graphdriver.FsMagicAufs:
log.Error("'overlay' is not supported over aufs.")
return nil, graphdriver.ErrIncompatibleFS
}

// Create the driver home dir
if err := os.MkdirAll(home, 0755); err != nil && !os.IsExist(err) {
return nil, err
Expand Down

0 comments on commit 9d1caf4

Please sign in to comment.