fix get storage by access path

This commit is contained in:
wanyaoqi
2019-05-08 16:56:20 +08:00
parent e0c3547952
commit d34ec40378
+1 -1
View File
@@ -623,7 +623,7 @@ func (self *SHost) GetStorageByFilePath(path string) *SStorage {
return nil
}
for i := 0; i < len(hoststorages); i += 1 {
if strings.HasPrefix(path, hoststorages[i].MountPoint) {
if len(hoststorages[i].MountPoint) > 0 && strings.HasPrefix(path, hoststorages[i].MountPoint) {
return hoststorages[i].GetStorage()
}
}