Skip to content

Commit

Permalink
volume: change extend skip condition
Browse files Browse the repository at this point in the history
Consider format also on the skip condition
for extending volumes. Only COW sparse volumes
shall be skipped.

Fixes: c9d6da4
Bug-Url: https://bugzilla.redhat.com/2210036
Signed-off-by: Albert Esteve <[email protected]>
  • Loading branch information
aesteve-rh committed May 30, 2023
1 parent bf43d22 commit 07d3089
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/vdsm/storage/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,9 +1380,10 @@ def extendSize(self, new_capacity):
if self.isShared():
raise se.VolumeNonWritable(self.volUUID)

if self.getType() == sc.SPARSE_VOL:
self.log.debug("skipping sparse size extension for volume %s to "
"capacity %s", self.volUUID, new_capacity)
if (self.getFormat() == sc.COW_FORMAT and
self.getType() == sc.SPARSE_VOL):
self.log.debug("skipping cow sparse size extension for volume %s "
"to capacity %s", self.volUUID, new_capacity)
return

# Note: This function previously prohibited extending non-leaf volumes.
Expand Down
1 change: 0 additions & 1 deletion tests/storage/filevolume_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ def test_volume_size_unaligned(monkeypatch, tmpdir, tmp_repo, fake_access,
assert vol.getCapacity() == expected_vol_capacity


@pytest.mark.xfail(reason='Raw sparse volumes are not extended.')
def test_extend_volume(tmp_repo, fake_access, fake_task):
"""
Test added to verify fix for https://bugzilla.redhat.com/2210036.
Expand Down

0 comments on commit 07d3089

Please sign in to comment.