mirror of https://github.com/docker/docs.git
Merge pull request #20003 from liubogithub/btrfs
Graphdriver/btrfs: Avoid using single d.Get()
This commit is contained in:
commit
25941b5020
|
@ -256,10 +256,14 @@ func (d *Driver) Create(id, parent, mountLabel string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parentDir, err := d.Get(parent, "")
|
parentDir := d.subvolumesDirID(parent)
|
||||||
|
st, err := os.Stat(parentDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if !st.IsDir() {
|
||||||
|
return fmt.Errorf("%s: not a direcotory", parentDir)
|
||||||
|
}
|
||||||
if err := subvolSnapshot(parentDir, subvolumes, id); err != nil {
|
if err := subvolSnapshot(parentDir, subvolumes, id); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue