Bug 1786950 - Block size detection is unsafe with multiple connections
Summary: Block size detection is unsafe with multiple connections
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-imageio
Classification: oVirt
Component: Daemon
Version: 1.5.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.3.8
: 1.5.3
Assignee: Nir Soffer
QA Contact: Yosi Ben Shimon
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-29 19:43 UTC by Nir Soffer
Modified: 2020-05-21 00:00 UTC (History)
4 users (show)

Fixed In Version: ovirt-imageio-1.5.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-27 12:56:03 UTC
oVirt Team: Storage
Embargoed:
sbonazzo: ovirt-4.3?
tnisan: blocker?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 105984 0 ovirt-4.3 MERGED file: Fix unsafe block size detection 2020-05-20 23:35:11 UTC

Description Nir Soffer 2019-12-29 19:43:33 UTC
Description of problem:

The block size detection for file based storage is not safe for use with
multiple connections, even when downloading an image, since the block size
detection assume single thread access to the image.

When trying to download empty image, block size detection may fail when one
connection is truncating the image back to the original size while another
connection is reading from the image. This is unlikely to happen since we 
don't have empty images - the minimum images size is 196K - new qcow2 volume.

When uploading images in qcow2 format, block size detection may corrupt
the first block of image by truncating data written by one connection by
another connection trying to restore the original image size.

Note that multiple connections for upload is not supported yet and is unsafe
anyway because of zeroing code, and will be available in oVirt 4.4 only when 
using the NBD backend, which does use block size detection.

However having block size detection that can modify the image is too risky
and it was fixed upstream in:

commit 7141efb4c93959b59fa3af1cca1819b925295150
Author: Nir Soffer <nsoffer>
Date:   Mon Dec 23 18:49:48 2019 +0200

    file: Fix unsafe block size detection

Version-Release number of selected component (if applicable):
1.5.2

How reproducible:
Random failure are possible.

Steps to Reproduce:
1. Upload qcow2 image with multiple connections, each connection uploads
   different portion of the image.

Actual results:
Upload fails or image is corrupted after the upload

Expected results:
Upload succeeds, image is valid after the upload

Additional info:
imageio client library will use multiple connections in oVirt 4.4, but it does
not use multiple connections when using the file backend so it is not affected
by this issue.

Comment 3 Yosi Ben Shimon 2020-01-23 12:58:07 UTC
Checked all tierX automation test cases from last 7 days on 4.3.
All passed without any regressions.

Moving to VERIFIED

Comment 4 Sandro Bonazzola 2020-01-27 12:56:03 UTC
This bugzilla is included in oVirt 4.3.8 release, published on January 27th 2020.

Since the problem described in this bug report should be
resolved in oVirt 4.3.8 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.

Comment 5 Nir Soffer 2020-05-21 00:00:19 UTC
Removing stale need infos.


Note You need to log in before you can comment on or make changes to this bug.