Skip to content

Commit

Permalink
fix: always return 0 index if lvol is not provided when finding index
Browse files Browse the repository at this point in the history
ref: longhorn/longhorn 10013

Signed-off-by: Jack Lin <[email protected]>
  • Loading branch information
ChanYiLin authored and derekbit committed Dec 19, 2024
1 parent 612155e commit d82cf2a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/spdk/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,9 @@ func (b *Backup) constructMappings() *btypes.Mappings {

func (b *Backup) findIndex(lvolName string) int {
if lvolName == "" {
if b.replica.BackingImage != nil {
return 0
}
return 1
// Note that, 0 can be a backing image if ActiveChanin[0] is not nil.
// Caller should handle this case
return 0
}

for i, lvol := range b.replica.ActiveChain {
Expand Down

0 comments on commit d82cf2a

Please sign in to comment.