Fix incorrect error in CSI when searching for the device in /sys

kv-update
Vitaliy Filippov 2023-12-14 01:00:32 +03:00
parent 62ed130960
commit 9bac99ffb6
1 changed files with 2 additions and 1 deletions

View File

@ -257,7 +257,8 @@ func (ns *NodeServer) mapVduse(volName string, ctxVars map[string]string, readon
if (err == nil)
{
// Find block device name
matches, err := filepath.Glob("/sys/bus/vdpa/devices/"+vdpaId+"/virtio*/block/*")
var matches []string
matches, err = filepath.Glob("/sys/bus/vdpa/devices/"+vdpaId+"/virtio*/block/*")
if (err == nil && len(matches) == 0)
{
err = errors.New("/sys/bus/vdpa/devices/"+vdpaId+"/virtio*/block/* is not found")