Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-02-03 Thread Max Reitz
On 02.02.2017 09:52, Alberto Garcia wrote: > On Wed 01 Feb 2017 11:16:38 PM CET, Max Reitz wrote: > >> Thanks, applied to my block tree, with >> %s/INT_MAX/BDRV_REQUEST_MAX_BYTES/g: > > I think you can use %d to print BDRV_REQUEST_MAX_BYTES, after all the > definition guarantees that it won't be

Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-02-02 Thread Alberto Garcia
On Wed 01 Feb 2017 11:16:38 PM CET, Max Reitz wrote: > Thanks, applied to my block tree, with > %s/INT_MAX/BDRV_REQUEST_MAX_BYTES/g: I think you can use %d to print BDRV_REQUEST_MAX_BYTES, after all the definition guarantees that it won't be larger than MIN(SIZE_MAX,INT_MAX) But it's fine with

Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-02-01 Thread Max Reitz
On 31.01.2017 17:09, Alberto Garcia wrote: > Passing a request size larger than INT_MAX to any of the I/O commands > results in an error. While 'read' and 'write' handle the error > correctly, 'aio_read' and 'aio_write' hit an assertion: > > blk_aio_read_entry: Assertion `rwco->qiov->size == acb->

Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-02-01 Thread Alberto Garcia
On Wed 01 Feb 2017 10:36:20 PM CET, Max Reitz wrote: >> +if (count > INT_MAX - len) { > > How about using BDRV_REQUEST_MAX_BYTES instead? > > (not yet in master, just in my block branch) Sounds good to me, feel free to edit my patch directly. Berto

Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-02-01 Thread Max Reitz
On 31.01.2017 17:09, Alberto Garcia wrote: > Passing a request size larger than INT_MAX to any of the I/O commands > results in an error. While 'read' and 'write' handle the error > correctly, 'aio_read' and 'aio_write' hit an assertion: > > blk_aio_read_entry: Assertion `rwco->qiov->size == acb->

Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-01-31 Thread Max Reitz
On 31.01.2017 19:11, Alberto Garcia wrote: > On Tue 31 Jan 2017 05:41:23 PM CET, Eric Blake wrote: > Ideally, it would be nice to fix the block layer to allow larger requests (since we already have code to auto-fragment down to device limits, we should be able to rely on that code

Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-01-31 Thread Alberto Garcia
On Tue 31 Jan 2017 05:41:23 PM CET, Eric Blake wrote: >>> Ideally, it would be nice to fix the block layer to allow larger >>> requests (since we already have code to auto-fragment down to device >>> limits, we should be able to rely on that code instead of having to >>> duplicate artificial cons

Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-01-31 Thread Eric Blake
On 01/31/2017 10:36 AM, Alberto Garcia wrote: > On Tue 31 Jan 2017 05:31:32 PM CET, Eric Blake wrote: > >> Ideally, it would be nice to fix the block layer to allow larger >> requests (since we already have code to auto-fragment down to device >> limits, we should be able to rely on that code inst

Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-01-31 Thread Eric Blake
On 01/31/2017 10:09 AM, Alberto Garcia wrote: > Passing a request size larger than INT_MAX to any of the I/O commands > results in an error. While 'read' and 'write' handle the error > correctly, 'aio_read' and 'aio_write' hit an assertion: > > blk_aio_read_entry: Assertion `rwco->qiov->size == ac

Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-01-31 Thread Alberto Garcia
On Tue 31 Jan 2017 05:31:32 PM CET, Eric Blake wrote: > Ideally, it would be nice to fix the block layer to allow larger > requests (since we already have code to auto-fragment down to device > limits, we should be able to rely on that code instead of having to > duplicate artificial constraints e

[Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX

2017-01-31 Thread Alberto Garcia
Passing a request size larger than INT_MAX to any of the I/O commands results in an error. While 'read' and 'write' handle the error correctly, 'aio_read' and 'aio_write' hit an assertion: blk_aio_read_entry: Assertion `rwco->qiov->size == acb->bytes' failed. The reason is that the QEMU I/O code