Skip to content

Commit 178ed9a

Browse files
XanClicmdroth
authored andcommitted
qcow2: Respect bdrv_truncate() error
bdrv_truncate() may fail and qcow2_write_compressed() should return the error code in that case. Cc: [email protected] Signed-off-by: Max Reitz <[email protected]> Reviewed-by: Kevin Wolf <[email protected]> Signed-off-by: Kevin Wolf <[email protected]> (cherry picked from commit 6a69b96) Conflicts: block/qcow2.c *removed context dependency on 75d3d21 Signed-off-by: Michael Roth <[email protected]>
1 parent 0505d48 commit 178ed9a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

block/qcow2.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,8 +1960,7 @@ static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num,
19601960
sector based I/Os */
19611961
cluster_offset = bdrv_getlength(bs->file);
19621962
cluster_offset = (cluster_offset + 511) & ~511;
1963-
bdrv_truncate(bs->file, cluster_offset);
1964-
return 0;
1963+
return bdrv_truncate(bs->file, cluster_offset);
19651964
}
19661965

19671966
if (nb_sectors != s->cluster_sectors) {

0 commit comments

Comments
 (0)