Make volume unmount more robust using exclusive mount w/ O_EXCL

This commit is contained in:
Cindy Wang
2016-07-06 10:42:56 -07:00
parent cbda93e23e
commit e13c678e3b
19 changed files with 227 additions and 25 deletions

View File

@@ -44,6 +44,19 @@ func (mi *fakeMountInterface) IsLikelyNotMountPoint(file string) (bool, error) {
return false, fmt.Errorf("unsupported")
}
func (mi *fakeMountInterface) DeviceOpened(pathname string) (bool, error) {
for _, mp := range mi.mountPoints {
if mp.Device == pathname {
return true, nil
}
}
return false, nil
}
func (mi *fakeMountInterface) PathIsDevice(pathname string) (bool, error) {
return true, nil
}
func fakeContainerMgrMountInt() mount.Interface {
return &fakeMountInterface{
[]mount.MountPoint{