In case statfs() returns ENOENT, do not return an error, but rather treat this as "not mounted". Related to commit d42dbdd3d48d. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@@ -313,9 +313,6 @@ func (a *Driver) Remove(id string) error {
for {
mounted, err := a.mounted(mountpoint)
if err != nil {
- if os.IsNotExist(err) {
- break
- }
return err
}
if !mounted {
@@ -118,6 +118,9 @@ func (c *defaultChecker) IsMounted(path string) bool {
func Mounted(fsType FsMagic, mountPath string) (bool, error) {
var buf unix.Statfs_t
if err := unix.Statfs(mountPath, &buf); err != nil {
+ if err == unix.ENOENT { // not exist, thus not mounted
+ err = nil
+ }
return false, err
return FsMagic(buf.Type) == fsType, nil