Open
Description
We found that the getDiskFormat
function (code) might return a nil
error if the given disk path does not exist.
If the disk path does not exist, blkid -p ...
returns errno 2
, indicating that the disk format was not found. Consequently, getDiskFormat()
returns a nil
error to its caller. However, this nil
error can be misleading because it does not clearly signal that the disk is missing.
We propose that before returning ("", nil)
, getDiskFormat()
should explicitly verify whether the disk exists. If the disk does not exist, the function should return an appropriate error instead of nil
.
More context: longhorn/longhorn#10416
Metadata
Metadata
Assignees
Labels
No labels