qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block/io.c: fix for the allocation failure
@ 2019-04-05 14:24 Andrey Shinkevich
  2019-04-05 14:24 ` Andrey Shinkevich
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Andrey Shinkevich @ 2019-04-05 14:24 UTC (permalink / raw)
  To: qemu-devel, qemu-block
  Cc: stefanha, fam, kwolf, mreitz, den, vsementsov, andrey.shinkevich

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 <den@openvz.org>
Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
 block/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/io.c b/block/io.c
index dfc153b..0412a51 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;
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2019-08-19 21:30 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-05 14:24 [Qemu-devel] [PATCH] block/io.c: fix for the allocation failure Andrey Shinkevich
2019-04-05 14:24 ` Andrey Shinkevich
2019-04-05 22:50 ` [Qemu-devel] [Qemu-block] " John Snow
2019-04-05 22:50   ` John Snow
2019-04-08  9:44   ` Andrey Shinkevich
2019-04-08  9:44     ` Andrey Shinkevich
2019-04-08 10:04     ` Kevin Wolf
2019-04-08 10:04       ` Kevin Wolf
2019-04-08 10:14       ` Kevin Wolf
2019-04-08 10:14         ` Kevin Wolf
2019-04-10 14:54         ` Stefan Hajnoczi
2019-04-10 14:54           ` Stefan Hajnoczi
2019-04-08 11:55       ` Andrey Shinkevich
2019-04-08 11:55         ` Andrey Shinkevich
2019-04-08  9:00 ` [Qemu-devel] " Stefan Hajnoczi
2019-04-08  9:00   ` Stefan Hajnoczi
2019-04-08  9:45   ` Andrey Shinkevich
2019-04-08  9:45     ` Andrey Shinkevich
2019-08-17 14:42 ` Eric Blake
2019-08-17 14:49   ` Eric Blake
2019-08-17 14:56     ` Eric Blake
2019-08-19 19:46       ` Denis V. Lunev
2019-08-19 20:30         ` Eric Blake
2019-08-19 20:53           ` Denis V. Lunev
2019-08-19 21:29             ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).