Merge pull request #9834 from jfrazelle/9820-overlay-btrfs

Add error when running overlay over btrfs.
This commit is contained in:
Michael Crosby 2015-01-06 13:16:17 -08:00
commit 9d1caf4272

View file

@ -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