Skip to content

Commit

Permalink
Merge pull request #3522 from clwluvw/hidden-device
Browse files Browse the repository at this point in the history
sysfs: trim spaces in device hidden check
  • Loading branch information
iwankgb authored Oct 4, 2024
2 parents c15f44e + 34f50e5 commit 96c346e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions utils/sysfs/sysfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,8 @@ func (fs *realSysFs) IsBlockDeviceHidden(name string) (bool, error) {
if err != nil {
return false, fmt.Errorf("failed to read %s: %w", devHiddenPath, err)
}
if string(hidden) == "1" {
return true, nil
}
return false, nil

return strings.TrimSpace(string(hidden)) == "1", nil
}

func (fs *realSysFs) GetBlockDeviceScheduler(name string) (string, error) {
Expand Down

0 comments on commit 96c346e

Please sign in to comment.