Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix IOCounters() SerialNumber enumeration #1508

Merged
merged 4 commits into from Aug 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion disk/disk_linux.go
Expand Up @@ -474,7 +474,11 @@ func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOC
}
d.Name = name

d.SerialNumber, _ = SerialNumberWithContext(ctx, name)
// Names passed in can be full paths (/dev/sda) or just device names (sda).
// Since `name`` here is already a basename, re-add a hardcoded /dev path.
// This is not ideal, but we may break the API by changing how SerialNumberWithContext
// works.
d.SerialNumber, _ = SerialNumberWithContext(ctx, "/dev/"+name)
gdvalle marked this conversation as resolved.
Show resolved Hide resolved
d.Label, _ = LabelWithContext(ctx, name)

ret[name] = d
Expand Down