diff --git a/daemon/graphdriver/btrfs/btrfs.go b/daemon/graphdriver/btrfs/btrfs.go index d9750c95b2..48388f72fe 100644 --- a/daemon/graphdriver/btrfs/btrfs.go +++ b/daemon/graphdriver/btrfs/btrfs.go @@ -256,10 +256,14 @@ func (d *Driver) Create(id, parent, mountLabel string) error { return err } } else { - parentDir, err := d.Get(parent, "") + parentDir := d.subvolumesDirID(parent) + st, err := os.Stat(parentDir) if err != nil { return err } + if !st.IsDir() { + return fmt.Errorf("%s: not a direcotory", parentDir) + } if err := subvolSnapshot(parentDir, subvolumes, id); err != nil { return err }