overlay: abort if backing fs lacks support for d_type

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2017-05-08 06:53:35 +00:00
parent 6e2457f186
commit 825c2ce3cc

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