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

[linux][disk]: fix Rdev cast #1575

Merged
merged 2 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build_test: ## test only buildable
GOOS=linux GOARCH=loong64 go test ./... | $(BUILD_FAIL_PATTERN)
GOOS=linux GOARCH=riscv64 go test ./... | $(BUILD_FAIL_PATTERN)
GOOS=linux GOARCH=s390x go test ./... | $(BUILD_FAIL_PATTERN)
GOOS=linux GOARCH=mips go test ./... | $(BUILD_FAIL_PATTERN)
GOOS=freebsd GOARCH=amd64 go test ./... | $(BUILD_FAIL_PATTERN)
GOOS=freebsd GOARCH=386 go test ./... | $(BUILD_FAIL_PATTERN)
GOOS=freebsd GOARCH=arm go test ./... | $(BUILD_FAIL_PATTERN)
Expand Down
8 changes: 4 additions & 4 deletions disk/disk_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ func SerialNumberWithContext(ctx context.Context, name string) (string, error) {
if err := unix.Stat(name, &stat); err != nil {
return "", err
}
major := unix.Major(stat.Rdev)
minor := unix.Minor(stat.Rdev)
major := unix.Major(uint64(stat.Rdev))
minor := unix.Minor(uint64(stat.Rdev))

sserial, _ := udevData(ctx, major, minor, "E:ID_SERIAL")
if sserial != "" {
Expand Down Expand Up @@ -541,8 +541,8 @@ func LabelWithContext(ctx context.Context, name string) (string, error) {
if err := unix.Stat(common.HostDevWithContext(ctx, name), &stat); err != nil {
return "", err
}
major := unix.Major(stat.Rdev)
minor := unix.Minor(stat.Rdev)
major := unix.Major(uint64(stat.Rdev))
minor := unix.Minor(uint64(stat.Rdev))

label, err := udevData(ctx, major, minor, "E:ID_FS_LABEL")
if err != nil {
Expand Down
Loading