[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 5/8] block/io.c: fix for the allocation failure
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-block] [PULL 5/8] block/io.c: fix for the allocation failure |
Date: |
Fri, 10 May 2019 14:02:40 +0100 |
From: Andrey Shinkevich <address@hidden>
On a file system used by the customer, fallocate() returns an error
if the block is not properly aligned. So, bdrv_co_pwrite_zeroes()
fails. We can handle that case the same way as it is done for the
unsupported cases, namely, call to bdrv_driver_pwritev() that writes
zeroes to an image for the unaligned chunk of the block.
Suggested-by: Denis V. Lunev <address@hidden>
Signed-off-by: Andrey Shinkevich <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Message-Id: <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/io.c b/block/io.c
index dfc153b8d8..0412a51314 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1516,7 +1516,7 @@ static int coroutine_fn
bdrv_co_do_pwrite_zeroes(BlockDriverState *bs,
assert(!bs->supported_zero_flags);
}
- if (ret == -ENOTSUP && !(flags & BDRV_REQ_NO_FALLBACK)) {
+ if (ret < 0 && !(flags & BDRV_REQ_NO_FALLBACK)) {
/* Fall back to bounce buffer if write zeroes is unsupported */
BdrvRequestFlags write_flags = flags & ~BDRV_REQ_ZERO_WRITE;
--
2.21.0
- [Qemu-block] [PULL 0/8] Block patches, Stefan Hajnoczi, 2019/05/10
- [Qemu-block] [PULL 1/8] util/readline: add a space to fix errors by checkpatch tool, Stefan Hajnoczi, 2019/05/10
- [Qemu-block] [PULL 2/8] util: readline: replace tab indent by four spaces to fix checkpatch errors, Stefan Hajnoczi, 2019/05/10
- [Qemu-block] [PULL 3/8] util/readline: Add braces to fix checkpatch errors, Stefan Hajnoczi, 2019/05/10
- [Qemu-block] [PULL 4/8] block: Add coroutine_fn to bdrv_check_co_entry, Stefan Hajnoczi, 2019/05/10
- [Qemu-block] [PULL 5/8] block/io.c: fix for the allocation failure,
Stefan Hajnoczi <=
- [Qemu-block] [PULL 6/8] aio-posix: ensure poll mode is left when aio_notify is called, Stefan Hajnoczi, 2019/05/10
- [Qemu-block] [PULL 8/8] docs: add Security chapter to the documentation, Stefan Hajnoczi, 2019/05/10
- [Qemu-block] [PULL 7/8] docs: add Secure Coding Practices to developer docs, Stefan Hajnoczi, 2019/05/10
- Re: [Qemu-block] [PULL 0/8] Block patches, Peter Maydell, 2019/05/10