diff --git a/Makefile b/Makefile index 4a0b7dae0..adee4ccfe 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ lint-fix: getdeps ## runs golangci-lint suite of linters with automatic fixes @$(GOLANGCI) run --build-tags kqueue --timeout=10m --config ./.golangci.yml --fix check: test -test: verifiers build ## builds minio, runs linters, tests +test: verifiers build build-debugging ## builds minio, runs linters, tests @echo "Running unit tests" @MINIO_API_REQUESTS_MAX=10000 CGO_ENABLED=0 go test -tags kqueue ./... @@ -128,10 +128,12 @@ verify-healing-inconsistent-versions: ## verify resolving inconsistent versions @GORACE=history_size=7 CGO_ENABLED=1 go build -race -tags kqueue -trimpath --ldflags "$(LDFLAGS)" -o $(PWD)/minio 1>/dev/null @(env bash $(PWD)/buildscripts/resolve-right-versions.sh) +build-debugging: + @(env bash $(PWD)/docs/debugging/build.sh) + build: checks ## builds minio to $(PWD) @echo "Building minio binary to './minio'" @CGO_ENABLED=0 go build -tags kqueue -trimpath --ldflags "$(LDFLAGS)" -o $(PWD)/minio 1>/dev/null - @(env bash $(PWD)/docs/debugging/build.sh) hotfix-vars: $(eval LDFLAGS := $(shell MINIO_RELEASE="RELEASE" MINIO_HOTFIX="hotfix.$(shell git rev-parse --short HEAD)" go run buildscripts/gen-ldflags.go $(shell git describe --tags --abbrev=0 | \ diff --git a/docs/debugging/reorder-disks/main.go b/docs/debugging/reorder-disks/main.go index ff04de990..af89e8d96 100644 --- a/docs/debugging/reorder-disks/main.go +++ b/docs/debugging/reorder-disks/main.go @@ -99,10 +99,11 @@ func getMajorMinor(path string) (string, error) { return "", fmt.Errorf("unable to stat `%s`: %w", path, err) } - major := (stat.Dev & 0x00000000000fff00) >> 8 - major |= (stat.Dev & 0xfffff00000000000) >> 32 - minor := (stat.Dev & 0x00000000000000ff) >> 0 - minor |= (stat.Dev & 0x00000ffffff00000) >> 12 + devID := uint64(stat.Dev) + major := (devID & 0x00000000000fff00) >> 8 + major |= (devID & 0xfffff00000000000) >> 32 + minor := (devID & 0x00000000000000ff) >> 0 + minor |= (devID & 0x00000ffffff00000) >> 12 return fmt.Sprintf("%d:%d", major, minor), nil }