Skip to content

Commit

Permalink
incusd/storage: Fix UsedBy values for sub-directory volumes
Browse files Browse the repository at this point in the history
Closes lxc#1103

Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Aug 11, 2024
1 parent 1a884be commit 956c5c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/server/storage/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ func VolumeUsedByProfileDevices(s *state.State, poolName string, projectName str
continue
}

if dev["source"] == vol.Name {
if strings.Split(dev["source"], "/")[0] == vol.Name {
usedByDevices = append(usedByDevices, name)
}
}
Expand Down Expand Up @@ -937,7 +937,7 @@ func VolumeUsedByInstanceDevices(s *state.State, poolName string, projectName st
continue
}

if dev["source"] == vol.Name {
if strings.Split(dev["source"], "/")[0] == vol.Name {
usedByDevices = append(usedByDevices, devName)
}
}
Expand Down

0 comments on commit 956c5c3

Please sign in to comment.