Skip to content

Commit

Permalink
lxd/storage/backend_lxd: Prevent usage of optimized image if zfs.bloc…
Browse files Browse the repository at this point in the history
…ksize differs

Signed-off-by: Din Music <din.music@canonical.com>
  • Loading branch information
MusicDin committed Sep 22, 2023
1 parent c5fd3bf commit d3f6815
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lxd/storage/backend_lxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3444,7 +3444,8 @@ func (b *lxdBackend) shouldUseOptimizedImage(fingerprint string, contentType dri
func volumeConfigsMatch(vol1, vol2 drivers.Volume) bool {
blockModeChanged := vol1.IsBlockBacked() != vol2.IsBlockBacked()
blockFSChanged := vol1.IsBlockBacked() && vol1.Config()["block.filesystem"] != vol2.Config()["block.filesystem"]
return !blockModeChanged && !blockFSChanged
blockSizeChanged := vol1.IsBlockBacked() && vol1.Config()["zfs.blocksize"] != vol2.Config()["zfs.blocksize"]
return !blockModeChanged && !blockFSChanged && !blockSizeChanged
}

// DeleteImage removes an image from the database and underlying storage device if needed.
Expand Down

0 comments on commit d3f6815

Please sign in to comment.