mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Improve zfs init log message for zfs
Signed-off-by: Drew Hubl <drew.hubl@gmail.com> Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
be14665210
commit
27b002f4a0
1 changed files with 10 additions and 9 deletions
|
@ -1,21 +1,22 @@
|
||||||
package zfs
|
package zfs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/docker/docker/daemon/graphdriver"
|
"github.com/docker/docker/daemon/graphdriver"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"golang.org/x/sys/unix"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func checkRootdirFs(rootdir string) error {
|
func checkRootdirFs(rootDir string) error {
|
||||||
var buf unix.Statfs_t
|
fsMagic, err := graphdriver.GetFSMagic(rootDir)
|
||||||
if err := unix.Statfs(rootdir, &buf); err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Failed to access '%s': %s", rootdir, err)
|
return err
|
||||||
|
}
|
||||||
|
backingFS := "unknown"
|
||||||
|
if fsName, ok := graphdriver.FsNames[fsMagic]; ok {
|
||||||
|
backingFS = fsName
|
||||||
}
|
}
|
||||||
|
|
||||||
if graphdriver.FsMagic(buf.Type) != graphdriver.FsMagicZfs {
|
if fsMagic != graphdriver.FsMagicZfs {
|
||||||
logrus.Debugf("[zfs] no zfs dataset found for rootdir '%s'", rootdir)
|
logrus.WithField("root", rootDir).WithField("backingFS", backingFS).WithField("driver", "zfs").Error("No zfs dataset found for root")
|
||||||
return graphdriver.ErrPrerequisites
|
return graphdriver.ErrPrerequisites
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue