Fix empty disk mount detection
This commit is contained in:
1 parent
e7917b41b5
commit
0afc1d761b
2 files changed
+13
-5
No files matched your search
@@ -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