Skip to content

Commit bf8bcdd

Browse files
committed
rbd: storage the devicepath in NodeStage
Irrespective of the mounter store the devicePath in the NodeStageVolume. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
1 parent 0f95c04 commit bf8bcdd

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

internal/rbd/nodeserver.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -540,17 +540,6 @@ func (ns *NodeServer) stageTransaction(
540540
log.DebugLog(ctx, "rbd image: %s was successfully mapped at %s\n",
541541
volOptions, devicePath)
542542

543-
// userspace mounters like nbd need the device path as a reference while
544-
// restarting the userspace processes on a nodeplugin restart. For kernel
545-
// mounter(krbd) we don't need it as there won't be any process running
546-
// in userspace, hence we don't store the device path for krbd devices.
547-
if volOptions.Mounter == rbdNbdMounter {
548-
err = updateRBDImageMetadataStash(req.GetStagingTargetPath(), devicePath)
549-
if err != nil {
550-
return transaction, err
551-
}
552-
}
553-
554543
if volOptions.isBlockEncrypted() {
555544
devicePath, err = ns.processEncryptedDevice(ctx, volOptions, devicePath)
556545
if err != nil {
@@ -569,6 +558,11 @@ func (ns *NodeServer) stageTransaction(
569558
}
570559
}
571560

561+
err = updateRBDImageMetadataStash(req.GetStagingTargetPath(), devicePath)
562+
if err != nil {
563+
return transaction, err
564+
}
565+
572566
stagingTargetPath := getStagingTargetPath(req)
573567

574568
isBlock := req.GetVolumeCapability().GetBlock() != nil

0 commit comments

Comments
 (0)