On 07/05/2015 15:20, Kevin Wolf wrote:
> > Does ENOSPC over LVM (dm-linear) work at all, and who generates the
> > ENOSPC there?
>
> The LVM use case is what oVirt uses, so I'm pretty sure that it works.
> I'm now sure who generates the ENOSPC, but it's not qemu anyway. If I
> had to guess, I'd say that the kernel block layer might just forbid
> writing after EOF for any block device.

Indeed, though it's VFS (blkdev_write_iter in fs/block_dev.c) and not
the block layer.  It looks like we need this:

diff --git a/block/block-backend.c b/block/block-backend.c
index 93e46f3..e54c433 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -461,7 +461,7 @@ static int blk_check_byte_request(BlockBackend *blk, 
int64_t offset,
     }
 
     if (offset > len || len - offset < size) {
-        return -EIO;
+        return -ENOSPC;
     }
 
     return 0;

Paolo

Reply via email to