File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -205,13 +205,18 @@ func (fs *FS) wwnToDevicePath(
205205 symlinkPath := fmt .Sprintf ("%s%s" , MultipathDevDiskByIDPrefix , wwn )
206206 devPath , err := os .Readlink (symlinkPath )
207207
208- // Look for regular path device.
208+ // Look for nvme path device.
209209 if err != nil || devPath == "" {
210- symlinkPath = fmt .Sprintf ("/dev/disk/by-id/wwn-0x %s" , wwn )
210+ symlinkPath = fmt .Sprintf ("/dev/disk/by-id/nvme-eui. %s" , wwn )
211211 devPath , err = os .Readlink (symlinkPath )
212- if err != nil {
213- log .Printf ("Check for disk path %s not found" , symlinkPath )
214- return "" , "" , err
212+ if err != nil || devPath == "" {
213+ // Look for normal path device
214+ symlinkPath = fmt .Sprintf ("/dev/disk/by-id/wwn-0x%s" , wwn )
215+ devPath , err = os .Readlink (symlinkPath )
216+ if err != nil {
217+ log .Printf ("Check for disk path %s not found" , symlinkPath )
218+ return "" , "" , err
219+ }
215220 }
216221 }
217222 components := strings .Split (devPath , "/" )
Original file line number Diff line number Diff line change @@ -147,6 +147,12 @@ func TestWWNToDevicePath(t *testing.T) {
147147 wwn : "60570970000197900046533030394146" ,
148148 result : "/dev/mydevb" ,
149149 },
150+ {
151+ src : "/dev/disk/by-id/nvme-eui.12635330303134340000976000012000" ,
152+ tgt : "../../mydevb" ,
153+ wwn : "12635330303134340000976000012000" ,
154+ result : "/dev/mydevb" ,
155+ },
150156 }
151157 for _ , tt := range tests {
152158 t .Run ("" , func (_ * testing.T ) {
You can’t perform that action at this time.
0 commit comments