Re: [Qemu-block] [PATCH v2 2/5] block: Uniform handling of 0-length bdrv_get_block_status()

2017-10-05 Thread Eric Blake
On 10/05/2017 09:35 AM, Stefan Hajnoczi wrote: > On Tue, Oct 03, 2017 at 08:43:44PM -0500, Eric Blake wrote: >> Handle a 0-length block status request up front, with a uniform >> return value claiming the area is not allocated. >> >> Most callers don't pass a length of 0 to bdrv_get_block_status()

Re: [Qemu-block] [PATCH v2 2/5] block: Uniform handling of 0-length bdrv_get_block_status()

2017-10-05 Thread Stefan Hajnoczi
On Tue, Oct 03, 2017 at 08:43:44PM -0500, Eric Blake wrote: > Handle a 0-length block status request up front, with a uniform > return value claiming the area is not allocated. > > Most callers don't pass a length of 0 to bdrv_get_block_status() > and friends; but it definitely happens with a 0-le

[Qemu-block] [PATCH v2 2/5] block: Uniform handling of 0-length bdrv_get_block_status()

2017-10-03 Thread Eric Blake
Handle a 0-length block status request up front, with a uniform return value claiming the area is not allocated. Most callers don't pass a length of 0 to bdrv_get_block_status() and friends; but it definitely happens with a 0-length read when copy-on-read is enabled. While we could audit all call