On 06/05/2015 19:23, Max Reitz wrote: > The guest sees whatever has been written into reply->error, and that > field hasn't been written by this function in that case. It has been > written by nbd_receive_reply() in nbd.c, and that value comes directly > from the server. In case of qemu-nbd being the server, a write beyond > the EOF should be caught by blk_check_byte_request() in > block/block-backend.c, which returns -EIO. So that's where the EIO comes > from.
Fair enough. This makes sense, but then we have to create ENOSPC elsewhere. > I don't know whether this EIO is subsequently converted to ENOSPC > because of werror=enospc, but considering that > https://bugzilla.redhat.com/show_bug.cgi?id=1090713 did not override > werror, it doesn't look like it. No, it shouldn't indeed. Could alloc_clusters_noref do bdrv_truncate and return ENOSPC if it fails? That's how for example qcow and vhdx work. vdi has the same problem. Paolo