mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
![Kir Kolyshkin](/assets/img/avatar_default.png)
1. Use mount.Unmount() which ignores EINVAL ("not mounted") error, and provides better error diagnostics (so we don't have to explicitly add target to error messages). 2. Since we're ignoring "not mounted" error, we can call multiple unmounts without any locking -- but since "auplink flush" is still involved and can produce an error in logs, let's keep the check for fs being mounted (it's just a statfs so should be fast). 2. While at it, improve the "can't unmount" error message in Put(). Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
17 lines
410 B
Go
17 lines
410 B
Go
// +build linux
|
|
|
|
package aufs // import "github.com/docker/docker/daemon/graphdriver/aufs"
|
|
|
|
import (
|
|
"os/exec"
|
|
|
|
"github.com/docker/docker/pkg/mount"
|
|
)
|
|
|
|
// Unmount the target specified.
|
|
func Unmount(target string) error {
|
|
if err := exec.Command("auplink", target, "flush").Run(); err != nil {
|
|
logger.WithError(err).Warnf("Couldn't run auplink before unmount %s", target)
|
|
}
|
|
return mount.Unmount(target)
|
|
}
|