Fix empty disk mount detection
This commit is contained in:
@@ -32,8 +32,7 @@ const idFile = "disk.id"
|
||||
func Probe(mountPath string) (DiskInfo, error) {
|
||||
info := DiskInfo{MountPath: mountPath, State: DiskAbsent}
|
||||
|
||||
entries, err := os.ReadDir(mountPath)
|
||||
if err != nil || len(entries) == 0 {
|
||||
if _, err := os.ReadDir(mountPath); err != nil {
|
||||
return info, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user