Fix empty disk mount detection

This commit is contained in:
2026-04-23 22:58:07 +03:00
parent e7917b41b5
commit 0afc1d761b
2 changed files with 13 additions and 5 deletions

View File

@@ -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
}