You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
We found that the
getDiskFormat
function (code) might return anil
error if the given disk path does not exist.If the disk path does not exist,
blkid -p ...
returns errno2
, indicating that the disk format was not found. Consequently,getDiskFormat()
returns anil
error to its caller. However, thisnil
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 ofnil
.More context: longhorn/longhorn#10416
The text was updated successfully, but these errors were encountered: