]> Git Repo - qemu.git/commit
block: Fix unaligned zero write
authorFam Zheng <[email protected]>
Tue, 24 Mar 2015 01:23:49 +0000 (09:23 +0800)
committerStefan Hajnoczi <[email protected]>
Fri, 27 Mar 2015 10:01:12 +0000 (10:01 +0000)
commitfc3959e4669a1c2149b91ccb05101cfc7ae1fc05
treeb3e2be4c49d43cd621a579de7865c3687b7b59e9
parent2115f2a1d8c77c2a735add1ed02ae0c1feae0d9a
block: Fix unaligned zero write

If the zero write is not aligned, bdrv_co_do_pwritev will segfault
because of accessing to the NULL qiov passed in by bdrv_co_write_zeroes.
Fix this by allocating a local qiov in bdrv_co_do_pwritev if the request
is not aligned. (In this case the padding iovs are necessary anyway, so
it doesn't hurt.)

Also add a check at the end of bdrv_co_do_pwritev to clear the zero flag
if padding is involved.

Signed-off-by: Fam Zheng <[email protected]>
Message-id: 1427160230[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
block.c
This page took 0.023721 seconds and 4 git commands to generate.