[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/18] block/vhdx: check error return of bdrv_flush()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 05/18] block/vhdx: check error return of bdrv_flush() |
Date: |
Tue, 8 Aug 2017 15:58:25 +0200 |
From: Jeff Cody <address@hidden>
Reported-by: Kevin Wolf <address@hidden>
Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vhdx-log.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index 95972230f0..a27dc059cd 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -565,7 +565,10 @@ static int vhdx_log_flush(BlockDriverState *bs,
BDRVVHDXState *s,
desc_entries = NULL;
}
- bdrv_flush(bs);
+ ret = bdrv_flush(bs);
+ if (ret < 0) {
+ goto exit;
+ }
/* once the log is fully flushed, indicate that we have an empty log
* now. This also sets the log guid to 0, to indicate an empty log */
vhdx_log_reset(bs, s);
@@ -1039,7 +1042,11 @@ int vhdx_log_write_and_flush(BlockDriverState *bs,
BDRVVHDXState *s,
/* Make sure data written (new and/or changed blocks) is stable
* on disk, before creating log entry */
- bdrv_flush(bs);
+ ret = bdrv_flush(bs);
+ if (ret < 0) {
+ goto exit;
+ }
+
ret = vhdx_log_write(bs, s, data, length, offset);
if (ret < 0) {
goto exit;
@@ -1047,7 +1054,11 @@ int vhdx_log_write_and_flush(BlockDriverState *bs,
BDRVVHDXState *s,
logs.log = s->log;
/* Make sure log is stable on disk */
- bdrv_flush(bs);
+ ret = bdrv_flush(bs);
+ if (ret < 0) {
+ goto exit;
+ }
+
ret = vhdx_log_flush(bs, s, &logs);
if (ret < 0) {
goto exit;
--
2.13.4
- [Qemu-devel] [PULL 00/18] Block layer patches for 2.10.0-rc2, Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 02/18] quorum: Set sectors-count to 0 when reporting a flush error, Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 04/18] block/vhdx: check for offset overflow to bdrv_truncate(), Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 03/18] block/vhdx: check error return of bdrv_getlength(), Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 05/18] block/vhdx: check error return of bdrv_flush(),
Kevin Wolf <=
- [Qemu-devel] [PULL 06/18] block/vhdx: check error return of bdrv_truncate(), Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 07/18] block: drop bdrv_set_key from BlockDriver, Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 01/18] qemu-iotests/109: Fix lock race condition, Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 08/18] block/null: Remove 'filename' option, Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 09/18] vmdk: Fix error handling/reporting of vmdk_check, Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 13/18] block: Fix order in bdrv_replace_child(), Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 12/18] parallels: drop check that bdrv_truncate() is working, Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 11/18] parallels: respect error code of bdrv_getlength() in allocate_clusters(), Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 10/18] block: respect error code from bdrv_getlength in handle_aiocb_write_zeroes, Kevin Wolf, 2017/08/08
- [Qemu-devel] [PULL 15/18] block: Set BDRV_O_ALLOW_RDWR during rw reopen, Kevin Wolf, 2017/08/08