diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 47d1a8008..b6bcbda74 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -847,7 +847,7 @@ func (ns *NodeServer) NodeUnstageVolume( unmapOptions: imgInfo.UnmapOptions, logDir: imgInfo.LogDir, } - if err = detachRBDImageOrDeviceSpec(ctx, dArgs); err != nil { + if err = detachRBDImageOrDeviceSpec(ctx, &dArgs); err != nil { log.ErrorLog( ctx, "error unmapping volume (%s) from staging path (%s): (%v)", diff --git a/internal/rbd/rbd_attach.go b/internal/rbd/rbd_attach.go index 350e57393..8f2f36789 100644 --- a/internal/rbd/rbd_attach.go +++ b/internal/rbd/rbd_attach.go @@ -384,7 +384,7 @@ func createPath(ctx context.Context, volOpt *rbdVolume, device string, cr *util. unmapOptions: volOpt.UnmapOptions, logDir: volOpt.LogDir, } - detErr := detachRBDImageOrDeviceSpec(ctx, dArgs) + detErr := detachRBDImageOrDeviceSpec(ctx, &dArgs) if detErr != nil { log.WarningLog(ctx, "rbd: %s unmap error %v", imagePath, detErr) } @@ -436,14 +436,14 @@ func detachRBDDevice(ctx context.Context, devicePath, volumeID, unmapOptions str unmapOptions: unmapOptions, } - return detachRBDImageOrDeviceSpec(ctx, dArgs) + return detachRBDImageOrDeviceSpec(ctx, &dArgs) } // detachRBDImageOrDeviceSpec detaches an rbd imageSpec or devicePath, with additional checking // when imageSpec is used to decide if image is already unmapped. func detachRBDImageOrDeviceSpec( ctx context.Context, - dArgs detachRBDImageArgs) error { + dArgs *detachRBDImageArgs) error { if dArgs.encrypted { mapperFile, mapperPath := util.VolumeMapper(dArgs.volumeID) mappedDevice, mapper, err := util.DeviceEncryptionStatus(ctx, mapperPath)