Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-10 Thread Paolo Bonzini
On 10/12/2014 16:47, Ming Lei wrote: > > > Finally blkdev_issue_zeroout() can send WRITE SAME(10/16) directly > > > and it can be from user space, fs, and block drivers. > > > > That is WRITE SAME without UNMAP, it is not used by mkfs, and Linux has > > always honored max_write_same_blocks for it

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-10 Thread Ming Lei
On Wed, Dec 10, 2014 at 11:02 PM, Paolo Bonzini wrote: > > > On 10/12/2014 15:35, Ming Lei wrote: It is _not_ never happen at all, and easy to be triggered when using mkfs. >>> >>> mkfs is not something to optimize for, it's just something that should >>> work. (Also, some hardware may

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-10 Thread Paolo Bonzini
On 10/12/2014 15:35, Ming Lei wrote: >>> It is _not_ never happen at all, and easy to be triggered when using >>> mkfs. >> >> mkfs is not something to optimize for, it's just something that should >> work. (Also, some hardware may time out if you do write same with too >> high a block count). >

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-10 Thread Ming Lei
On Wed, Dec 10, 2014 at 8:55 PM, Paolo Bonzini wrote: > > > On 10/12/2014 13:23, Ming Lei wrote: >>> > >>> > Again, we're talking of 2GB and this is something that should never >>> > happen in practice. >> Again, the 2GB limit can be avoided if I/O is splitted, isn't it? > > Sure. The guest kerne

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-10 Thread Paolo Bonzini
On 10/12/2014 13:23, Ming Lei wrote: >> > >> > Again, we're talking of 2GB and this is something that should never >> > happen in practice. > Again, the 2GB limit can be avoided if I/O is splitted, isn't it? Sure. The guest kernel is doing the split. > It is _not_ never happen at all, and easy

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-10 Thread Ming Lei
On Wed, Dec 10, 2014 at 5:56 PM, Paolo Bonzini wrote: > > > On 10/12/2014 02:41, Ming Lei wrote: >> On Wed, Dec 10, 2014 at 1:45 AM, Paolo Bonzini wrote: >>> >>> >>> On 08/12/2014 08:19, Ming Lei wrote: >> >> Alternatively, I'd accept a SCSI patch setting max_ws_blocks and friends >>

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-10 Thread Paolo Bonzini
On 10/12/2014 02:41, Ming Lei wrote: > On Wed, Dec 10, 2014 at 1:45 AM, Paolo Bonzini wrote: >> >> >> On 08/12/2014 08:19, Ming Lei wrote: > > Alternatively, I'd accept a SCSI patch setting max_ws_blocks and friends > to 2GB - 1 block. >>> It should be better to not introduce the lim

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-09 Thread Ming Lei
On Wed, Dec 10, 2014 at 1:45 AM, Paolo Bonzini wrote: > > > On 08/12/2014 08:19, Ming Lei wrote: >>> > >>> > Alternatively, I'd accept a SCSI patch setting max_ws_blocks and friends >>> > to 2GB - 1 block. >> It should be better to not introduce the limit and split the writes >> into size of 2GB -

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-09 Thread Paolo Bonzini
On 08/12/2014 08:19, Ming Lei wrote: >> > >> > Alternatively, I'd accept a SCSI patch setting max_ws_blocks and friends >> > to 2GB - 1 block. > It should be better to not introduce the limit and split the writes > into size of 2GB - 1 block since there is only the limit for write zero. Why? Tha

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-07 Thread Ming Lei
On Sat, Dec 6, 2014 at 12:33 AM, Paolo Bonzini wrote: > > > On 05/12/2014 17:15, Ming Lei wrote: >> From: Ming Lei >> >> QEMU block should have supported to read/write at most >> 0x7f * 512 bytes, unfortunately INT_MAX is used to check >> bytes in both bdrv_co_do_writev() and bdrv_check_byte_

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-05 Thread Paolo Bonzini
On 05/12/2014 18:03, Max Reitz wrote: > On 2014-12-05 at 17:15, Ming Lei wrote: >> From: Ming Lei >> >> QEMU block should have supported to read/write at most >> 0x7f * 512 bytes, unfortunately INT_MAX is used to check >> bytes in both bdrv_co_do_writev() and bdrv_check_byte_request(), >> so

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-05 Thread Max Reitz
On 2014-12-05 at 17:15, Ming Lei wrote: From: Ming Lei QEMU block should have supported to read/write at most 0x7f * 512 bytes, unfortunately INT_MAX is used to check bytes in both bdrv_co_do_writev() and bdrv_check_byte_request(), so cause write failure if nr_sectors is equal or more than

Re: [Qemu-devel] [PATCH] block: fix big write

2014-12-05 Thread Paolo Bonzini
On 05/12/2014 17:15, Ming Lei wrote: > From: Ming Lei > > QEMU block should have supported to read/write at most > 0x7f * 512 bytes, unfortunately INT_MAX is used to check > bytes in both bdrv_co_do_writev() and bdrv_check_byte_request(), > so cause write failure if nr_sectors is equal or m

[Qemu-devel] [PATCH] block: fix big write

2014-12-05 Thread Ming Lei
From: Ming Lei QEMU block should have supported to read/write at most 0x7f * 512 bytes, unfortunately INT_MAX is used to check bytes in both bdrv_co_do_writev() and bdrv_check_byte_request(), so cause write failure if nr_sectors is equal or more than 0x40. There are still other INT_MAX u