[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/18] sheepdog: don't update inode when create_and_
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 17/18] sheepdog: don't update inode when create_and_write fails |
Date: |
Wed, 2 Jan 2013 16:15:55 +0100 |
From: Liu Yuan <address@hidden>
For the error case such as SD_RES_NO_SPACE, we shouldn't update the inode bitmap
to avoid the scenario that the object is allocated but wasn't created at the
server side. This will result in VM's IO error on the failed object.
Cc: MORITA Kazutaka <address@hidden>
Cc: Kevin Wolf <address@hidden>
Signed-off-by: Liu Yuan <address@hidden>
Reviewed-by: MORITA Kazutaka <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block/sheepdog.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 13dc023..b9186fb 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -714,10 +714,11 @@ static void coroutine_fn aio_read_response(void *opaque)
* and max_dirty_data_idx are changed to include updated
* index between them.
*/
- s->inode.data_vdi_id[idx] = s->inode.vdi_id;
- s->max_dirty_data_idx = MAX(idx, s->max_dirty_data_idx);
- s->min_dirty_data_idx = MIN(idx, s->min_dirty_data_idx);
-
+ if (rsp.result == SD_RES_SUCCESS) {
+ s->inode.data_vdi_id[idx] = s->inode.vdi_id;
+ s->max_dirty_data_idx = MAX(idx, s->max_dirty_data_idx);
+ s->min_dirty_data_idx = MIN(idx, s->min_dirty_data_idx);
+ }
/*
* Some requests may be blocked because simultaneous
* create requests are not allowed, so we search the
--
1.8.0.2
- [Qemu-devel] [PATCH 05/18] dataplane: add event loop, (continued)
- [Qemu-devel] [PATCH 05/18] dataplane: add event loop, Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 10/18] virtio-blk: restore VirtIOBlkConf->config_wce flag, Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 09/18] iov: add qemu_iovec_concat_iov(), Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 12/18] virtio-blk: add x-data-plane=on|off performance feature, Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 11/18] dataplane: add virtio-blk data plane code, Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 15/18] qemu-img: report size overflow error message, Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 13/18] virtio-blk: Return UNSUPP for unknown request types, Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 18/18] sheepdog: pass oid directly to send_pending_req(), Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 16/18] block/raw-win32: Fix compiler warnings (wrong format specifiers), Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 14/18] cutils: change strtosz_suffix_unit function, Stefan Hajnoczi, 2013/01/02
- [Qemu-devel] [PATCH 17/18] sheepdog: don't update inode when create_and_write fails,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PULL v2 00/18] Block patches, Anthony Liguori, 2013/01/02