Re: [Qemu-block] [PATCH] block/file-posix: add bdrv_attach_aio_context callback for host dev and cdrom

2018-07-20 Thread Nishanth Aravamudan
On 20.07.2018 [15:11:14 -0400], Farhan Ali wrote: > I am seeing another issue pop up, in a different test. Even though it's a > different assertion, it might be related based on the call trace. Just to be clear, this does not happen if you revert the original patch (i.e., the one you bisected to b

Re: [Qemu-block] [qemu-s390x] [Qemu-devel] [BUG?] aio_get_linux_aio: Assertion `ctx->linux_aio' failed

2018-07-19 Thread Nishanth Aravamudan
Hi Christian, On 19.07.2018 [08:55:20 +0200], Christian Borntraeger wrote: > > > On 07/18/2018 08:52 PM, Nishanth Aravamudan wrote: > > On 18.07.2018 [11:10:27 -0400], Farhan Ali wrote: > >> > >> > >> On 07/18/2018 09:42 AM, Farhan Ali wrote: > &g

[Qemu-block] [PATCH] block/file-posix: add bdrv_attach_aio_context callback for host dev and cdrom

2018-07-18 Thread Nishanth Aravamudan
cause they did not call aio_setup_linux_aio first. Add the appropriate callback definition to the affected driver definitions. Fixes: ed6e2161 ("linux-aio: properly bubble up errors from initialization") Reported-by: Farhan Ali Signed-off-by: Nishanth Aravamudan Cc: Eric Blake Cc:

[Qemu-block] [PATCH v4] linux-aio: properly bubble up errors from initialization

2018-06-22 Thread Nishanth Aravamudan
(), which will allocate a new AioContext if needed, and return errors on failures. If it fails for any reason, fallback to threaded AIO with an error message, as the device is already in-use by the guest. Add an assert that aio_get_linux_aio() cannot return NULL. Signed-off-by: Nishanth Aravamudan

Re: [Qemu-block] [PATCH v3 2/2] block/file-posix: reconfigure aio on iothread start

2018-06-22 Thread Nishanth Aravamudan
On 22.06.2018 [11:02:06 +0200], Kevin Wolf wrote: > Am 22.06.2018 um 04:25 hat Fam Zheng geschrieben: > > On Thu, 06/21 15:21, Nishanth Aravamudan wrote: > > > When the AioContext changes, we need to associate a LinuxAioState with > > > the new AioContext. Use the bdrv_

Re: [Qemu-block] [PATCH v3 1/2] linux-aio: properly bubble up errors from initialization

2018-06-22 Thread Nishanth Aravamudan
On 22.06.2018 [10:21:19 +0800], Fam Zheng wrote: > On Thu, 06/21 15:21, Nishanth Aravamudan wrote: > > laio_init() can fail for a couple of reasons, which will lead to a NULL > > pointer dereference in laio_attach_aio_context(). > > > > To solve this, add a aio_setup_li

[Qemu-block] [PATCH v3 1/2] linux-aio: properly bubble up errors from initialization

2018-06-21 Thread Nishanth Aravamudan
not modified, because it seems preferable to return the actual errno from the possible failing initialization calls. Add an assert that aio_get_linux_aio() cannot return NULL. Signed-off-by: Nishanth Aravamudan --- Changes from v2 -> v3 (thanks to Eric Blake and Kevin Wolf for review): Us

[Qemu-block] [PATCH v3 0/2] linux-aio: fix two NULL pointer dereferences failure paths

2018-06-21 Thread Nishanth Aravamudan
not being able to allocate additional AIO contexts for the I/O thread. This NULL is assigned to ctx->linux_aio and dereferenced in aio_get_linux_aio. Thanks to Jon Snow, Eric Blake and Kevin Wolf for review comments on v1 and v2. Nishanth Aravamudan (2): linux-aio: properly bubble up

[Qemu-block] [PATCH v3 2/2] block/file-posix: reconfigure aio on iothread start

2018-06-21 Thread Nishanth Aravamudan
threaded AIO with an error message, as the device is already in-use by the guest. Signed-off-by: Nishanth Aravamudan --- Note this patch didn't exist in v2, but is a result of feedback to that posting. block/file-posix.c | 16 1 file changed, 16 insertions(+) diff --git a/block

Re: [Qemu-block] [Qemu-devel] [PATCH] [RFC v2] aio: properly bubble up errors from initialization

2018-06-21 Thread Nishanth Aravamudan
On 21.06.2018 [15:51:08 +0200], Kevin Wolf wrote: > Am 21.06.2018 um 05:26 hat Nishanth Aravamudan geschrieben: > > On 20.06.2018 [12:34:52 -0700], Nishanth Aravamudan wrote: > > > On 20.06.2018 [11:57:42 +0200], Kevin Wolf wrote: > > > > Am 20.06.2018 um 00:54 hat N

Re: [Qemu-block] [Qemu-devel] [PATCH] [RFC v2] aio: properly bubble up errors from initialization

2018-06-20 Thread Nishanth Aravamudan
On 20.06.2018 [12:34:52 -0700], Nishanth Aravamudan wrote: > On 20.06.2018 [11:57:42 +0200], Kevin Wolf wrote: > > Am 20.06.2018 um 00:54 hat Nishanth Aravamudan geschrieben: > > > On 19.06.2018 [15:35:57 -0700], Nishanth Aravamudan wrote: > > > > On 19.06.2

Re: [Qemu-block] [Qemu-devel] [PATCH] [RFC v2] aio: properly bubble up errors from initialization

2018-06-20 Thread Nishanth Aravamudan
On 20.06.2018 [11:57:42 +0200], Kevin Wolf wrote: > Am 20.06.2018 um 00:54 hat Nishanth Aravamudan geschrieben: > > On 19.06.2018 [15:35:57 -0700], Nishanth Aravamudan wrote: > > > On 19.06.2018 [13:14:51 -0700], Nishanth Aravamudan wrote: > > > > On 19.06.2018 [14:

Re: [Qemu-block] [Qemu-devel] [PATCH] [RFC v2] aio: properly bubble up errors from initialization

2018-06-19 Thread Nishanth Aravamudan
On 19.06.2018 [15:35:57 -0700], Nishanth Aravamudan wrote: > On 19.06.2018 [13:14:51 -0700], Nishanth Aravamudan wrote: > > On 19.06.2018 [14:35:33 -0500], Eric Blake wrote: > > > On 06/15/2018 12:47 PM, Nishanth Aravamudan via Qemu-devel wrote: > > > >

Re: [Qemu-block] [Qemu-devel] [PATCH] [RFC v2] aio: properly bubble up errors from initialization

2018-06-19 Thread Nishanth Aravamudan
On 19.06.2018 [13:14:51 -0700], Nishanth Aravamudan wrote: > On 19.06.2018 [14:35:33 -0500], Eric Blake wrote: > > On 06/15/2018 12:47 PM, Nishanth Aravamudan via Qemu-devel wrote: > > > } else if (s->use_linux_aio) { > > > +

Re: [Qemu-block] [Qemu-devel] [PATCH] [RFC v2] aio: properly bubble up errors from initialization

2018-06-19 Thread Nishanth Aravamudan
On 19.06.2018 [14:35:33 -0500], Eric Blake wrote: > On 06/15/2018 12:47 PM, Nishanth Aravamudan via Qemu-devel wrote: > > laio_init() can fail for a couple of reasons, which will lead to a NULL > > pointer dereference in laio_attach_aio_context(). > > > > To solve this

[Qemu-block] [PATCH] [RFC v2] aio: properly bubble up errors from initialization

2018-06-15 Thread Nishanth Aravamudan
ith aio=native,cache=directsync. With this patch, the guest successfully starts (but obviously isn't using native AIO). Setting aio-max-nr back up to a reasonable value, AIO contexts are consumed normally. Signed-off-by: Nishanth Aravamudan --- Changes from v1 -> v2: Rather than affect

Re: [Qemu-block] [PATCH] [RFC] aio: properly bubble up errors from initialization

2018-06-15 Thread Nishanth Aravamudan
Hi Kevin, On 15.06.2018 [10:41:26 +0200], Kevin Wolf wrote: > Am 15.06.2018 um 01:21 hat Nishanth Aravamudan geschrieben: > > laio_init() can fail for a couple of reasons, which will lead to a NULL > > pointer dereference in laio_attach_aio_context(). > > >

[Qemu-block] [PATCH] [RFC] aio: properly bubble up errors from initialization

2018-06-14 Thread Nishanth Aravamudan
. With this patch, the guest successfully starts (but obviously isn't using native AIO). Setting aio-max-nr back up to a reasonable value, AIO contexts are consumed normally. Signed-off-by: Nishanth Aravamudan --- block/block-backend.c | 10 ++ block/file-posix.c

Re: [Qemu-block] [Qemu-devel] AIO error case

2018-05-23 Thread Nishanth Aravamudan
On Wed, May 23, 2018 at 10:53 AM, John Snow wrote: > > > > On 05/22/2018 06:01 PM, Nishanth Aravamudan via Qemu-devel wrote: > > Hi! > > > > Hi! CCing qemu-block@nongnu.org; > > > I'm tracking an error case in the native AIO path, and was wondering if