File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import (
2929 "testing"
3030
3131 "github.com/containerd/containerd/v2/pkg/testutil"
32+ "golang.org/x/sys/unix"
3233)
3334
3435type superblockROFeatures struct {
@@ -143,8 +144,7 @@ func resolveDevicePath(path string) (_ string, e error) {
143144 }
144145
145146 // resolve to device path
146- maj := (stat .Dev >> 8 ) & 0xff
147- min := stat .Dev & 0xff
147+ major , minor := unix .Major (stat .Dev ), unix .Minor (stat .Dev )
148148
149149 m , err := os .Open ("/proc/self/mountinfo" )
150150 if err != nil {
@@ -162,7 +162,7 @@ func resolveDevicePath(path string) (_ string, e error) {
162162 scanner := bufio .NewScanner (m )
163163
164164 var entry string
165- sub := fmt .Sprintf ("%d:%d" , maj , min )
165+ sub := fmt .Sprintf ("%d:%d" , major , minor )
166166 for scanner .Scan () {
167167 if strings .Contains (scanner .Text (), sub ) {
168168 entry = scanner .Text ()
You can’t perform that action at this time.
0 commit comments