Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check volume type before reducing from StorageDomain #185

Closed
aesteve-rh opened this issue May 18, 2022 · 0 comments · Fixed by #176
Closed

Check volume type before reducing from StorageDomain #185

aesteve-rh opened this issue May 18, 2022 · 0 comments · Fixed by #176
Assignees
Labels
bug Issue is a bug or fix for a bug storage
Milestone

Comments

@aesteve-rh
Copy link
Member

Problem

There is no safety check before reducing a volume in the StorageDomain class. This could lead to wrong reductions in case of, e.g., raw or preallocated volumes.

StoragePool.reduceVolume() is using StorageDomain.reduceVolume(), which is taking the metadata_lock and then calling to the Volume.reduce method with the volume optimal_size.

Plan

  • Use vol.can_reduce() method (which takes into account the type and the format of the volume) before reducing the volume in the StorageDomain.

This way, we avoid a potential wrong reduction and save the time of obtaining the optimal_size() in those cases.

@aesteve-rh aesteve-rh added bug Issue is a bug or fix for a bug storage labels May 18, 2022
@aesteve-rh aesteve-rh added this to the ovirt-4.5.1 milestone May 18, 2022
@aesteve-rh aesteve-rh self-assigned this May 18, 2022
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue May 18, 2022
There is not safety check before reducing a volume
in the StorageDomain class. This could lead to
wrong reductions in case of, e.g., raw or preallocated
volumes.

Use vol.can_reduce method before reducing the volume.

Fixes: oVirt#185
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue May 18, 2022
There is not safety check before reducing a volume
in the StorageDomain class. This could lead to
wrong reductions in case of, e.g., raw or preallocated
volumes.

Use vol.can_reduce method before reducing the volume.

Fixes: oVirt#185
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue May 18, 2022
There is not safety check before reducing a volume
in the StorageDomain class. This could lead to
wrong reductions in case of, e.g., raw or preallocated
volumes.

Use vol.can_reduce method before reducing the volume.

Fixes: oVirt#185
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue May 18, 2022
There is not safety check before reducing a volume
in the StorageDomain class. This could lead to
wrong reductions in case of, e.g., raw or preallocated
volumes.

Use vol.can_reduce method before reducing the volume.

Fixes: oVirt#185
Signed-off-by: Albert Esteve <aesteve@redhat.com>
nirs pushed a commit to aesteve-rh/vdsm that referenced this issue May 18, 2022
There is not safety check before reducing a volume
in the StorageDomain class. This could lead to
wrong reductions in case of, e.g., raw or preallocated
volumes.

Use vol.can_reduce method before reducing the volume.

Fixes: oVirt#185
Signed-off-by: Albert Esteve <aesteve@redhat.com>
@nirs nirs closed this as completed in #176 May 18, 2022
nirs pushed a commit that referenced this issue May 18, 2022
There is not safety check before reducing a volume
in the StorageDomain class. This could lead to
wrong reductions in case of, e.g., raw or preallocated
volumes.

Use vol.can_reduce method before reducing the volume.

Fixes: #185
Signed-off-by: Albert Esteve <aesteve@redhat.com>
erav pushed a commit to hbraha/vdsm that referenced this issue Jun 21, 2022
There is not safety check before reducing a volume
in the StorageDomain class. This could lead to
wrong reductions in case of, e.g., raw or preallocated
volumes.

Use vol.can_reduce method before reducing the volume.

Fixes: oVirt#185
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug or fix for a bug storage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant