Merge pull request #815 from AkihiroSuda/dtype

overlay: abort if backing fs lacks support for d_type
This commit is contained in:
Phil Estes
2017-05-10 14:24:01 -05:00
committed by GitHub
3 changed files with 186 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/containerd/containerd"
"github.com/containerd/containerd/fs"
"github.com/containerd/containerd/fs/fsutils"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/snapshot"
@@ -47,6 +48,13 @@ func NewSnapshotter(root string) (snapshot.Snapshotter, error) {
if err := os.MkdirAll(root, 0700); err != nil {
return nil, err
}
supportsDType, err := fsutils.SupportsDType(root)
if err != nil {
return nil, err
}
if !supportsDType {
return nil, fmt.Errorf("%s does not support d_type. If the backing filesystem is xfs, please reformat with ftype=1 to enable d_type support.", root)
}
ms, err := storage.NewMetaStore(filepath.Join(root, "metadata.db"))
if err != nil {
return nil, err