Commit bd751f22 authored by Liu Yuan's avatar Liu Yuan Committed by Stefan Hajnoczi
Browse files

sheepdog: don't update inode when create_and_write fails



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 <morita.kazutaka@lab.ntt.co.jp>
Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: default avatarLiu Yuan <tailai.ly@taobao.com>
Reviewed-by: default avatarMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent fccedc62
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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.
             */
            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