RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-16 Thread Ananiev, Leonid I
Sent: Friday, February 16, 2007 3:01 AM To: Ananiev, Leonid I Cc: Ken Chen; [EMAIL PROTECTED]; Andrew Morton; linux-kernel@vger.kernel.org; linux-aio; Chris Mason Subject: Re: [PATCH] aio: fix kernel bug when page is temporally busy On Feb 15, 2007, at 3:32 PM, Ananiev, Leonid I wrote: >>

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-15 Thread Zach Brown
On Feb 15, 2007, at 3:32 PM, Ananiev, Leonid I wrote: If EIOCBRETRY then generic_file_aio_write() will be recalled for the same iocb. Only if kick_iocb() is called. It won't be called if i_i_p2_r() was the only thing to return -EIOCBRETRY. It is not need to call kick_iocb() for generic_file_

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-15 Thread Ananiev, Leonid I
o_run_iocb() during 5 hours aiostress running. Does it mean that EIOCBQUEUED is always reset and never returned? Leonid -Original Message- From: Zach Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, February 15, 2007 10:23 PM To: Ananiev, Leonid I Cc: Ken Chen; [EMAIL PROTECTED]; Andrew

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-15 Thread Ananiev, Leonid I
-Original Message- From: Zach Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, February 15, 2007 10:23 PM To: Ananiev, Leonid I Cc: Ken Chen; [EMAIL PROTECTED]; Andrew Morton; linux-kernel@vger.kernel.org; linux-aio; Chris Mason Subject: Re: [PATCH] aio: fix kernel bug when page is

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-15 Thread Zach Brown
On Feb 15, 2007, at 11:11 AM, Ananiev, Leonid I wrote: It returns -EIOCBRETRY without guaranteeing that kick_iocb() will be called. This can lead to operations hanging If EIOCBRETRY then generic_file_aio_write() will be recalled for the same iocb. Only if kick_iocb() is called. It won't b

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-15 Thread Ananiev, Leonid I
t it? Leonid -Original Message- From: Zach Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, February 15, 2007 9:25 PM To: Ananiev, Leonid I Cc: Ken Chen; [EMAIL PROTECTED]; Andrew Morton; linux-kernel@vger.kernel.org; linux-aio; Chris Mason Subject: Re: [PATCH] aio: fix kernel bug when p

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-15 Thread Zach Brown
If invalidate_inode_pages2_range() will return EIOCBRETRY as the patch "aio: fix kernel bug when page is temporally busy" Sorry Leonid, this patch is not safe. It returns -EIOCBRETRY without guaranteeing that kick_iocb() will be called. This can lead to operations hanging, bo

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-15 Thread Ananiev, Leonid I
d of dropping > it to the floor. If invalidate_inode_pages2_range() will return EIOCBRETRY as the patch "aio: fix kernel bug when page is temporally busy" sets then do_sync_read/write() will not drop IO submit but will retry it: for (;;) { ret = filp->f_op->aio_read(&kio

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-14 Thread Ananiev, Leonid I
l.org Subject: Re: [PATCH] aio: fix kernel bug when page is temporally busy On Wed, 14 Feb 2007 20:51:33 +0300 "Ananiev, Leonid I" <[EMAIL PROTECTED]> wrote: > Fix kernel bug when IO page is temporally busy: > invalidate_inode_pages2_range() returns EIOCBRETRY but not EIO. >

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-14 Thread Andrew Morton
On Wed, 14 Feb 2007 20:51:33 +0300 "Ananiev, Leonid I" <[EMAIL PROTECTED]> wrote: > Fix kernel bug when IO page is temporally busy: > invalidate_inode_pages2_range() returns EIOCBRETRY but not EIO. > invalidate_inode_pages2() returns EIO as earlier. > > Signed-off-by: Leonid Ananiev <[EMAIL PRO

[PATCH] aio: fix kernel bug when page is temporally busy

2007-02-14 Thread Ananiev, Leonid I
-wrap lines are fixed. Sorry. >From Leonid Ananiev Fix kernel bug if IO page is temporally busy: invalidate_inode_pages2_range() returns EIOCBRETRY but not EIO. invalidate_inode_pages2() returns EIO as earlier. Signed-off-by: Leonid Ananiev <[EMAIL PROTECTED]> --- --- linux-2.6.20/mm/truncate.c

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-12 Thread Ananiev, Leonid I
Andrew, You wrote on Friday, February 09, 2007 8:53 AM > invalidate_inode_pages2() has other callers. I suspect with this change > we'll end up leaking EIOCBRETRY back to userspace. The path is modified so that invalidate_inode_pages2() returns EIO as earlier. could you consider modified patch Th

Recall: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-12 Thread Ananiev, Leonid I
Ananiev, Leonid I would like to recall the message, "[PATCH] aio: fix kernel bug when page is temporally busy". - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.

Recall: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-12 Thread Ananiev, Leonid I
Ananiev, Leonid I would like to recall the message, "[PATCH] aio: fix kernel bug when page is temporally busy". - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-12 Thread Ananiev, Leonid I
Andrew, You wrote on Friday, February 09, 2007 8:53 AM > invalidate_inode_pages2() has other callers. I suspect with this change > we'll end up leaking EIOCBRETRY back to userspace. The path is modified so that invalidate_inode_pages2() returns EIO as earlier. could you consider modified patch Th

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-10 Thread Ananiev, Leonid I
Ken Chen writes: > So any error value returned from invalidate_inode_pages2_range() has > to be taken seriously in the direct IO submit path instead of dropping > it to the floor. If invalidate_inode_pages2_range() will return EIOCBRETRY as the patch "aio: fix kernel bug when page

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-10 Thread Ananiev, Leonid I
> If invalidate_inode_pages2_range() says it can not invalidate pages, > while dio to the same file offset range is in flight, something is > really wrong there. If invalidate_inode_pages2_range() says it can not invalidate pages It means that soft_irq does completing IO now on other cpu. Next ret

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-10 Thread Ananiev, Leonid I
Pulavarty Subject: Re: [PATCH] aio: fix kernel bug when page is temporally busy On 2/9/07, Ananiev, Leonid I <[EMAIL PROTECTED]> wrote: > I have used EIOCBRETRY in the patch to minimize source code modification > only. > [...] > A lot of errno's have different meaning in different

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-10 Thread Ananiev, Leonid I
PM To: Ananiev, Leonid I Cc: [EMAIL PROTECTED]; Andrew Morton; linux-kernel@vger.kernel.org; linux-aio; Zach Brown; Chris Mason; Badari Pulavarty Subject: Re: [PATCH] aio: fix kernel bug when page is temporally busy On 2/9/07, Ananiev, Leonid I <[EMAIL PROTECTED]> wrote: > I have used E

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-10 Thread Ken Chen
On 2/9/07, Ananiev, Leonid I <[EMAIL PROTECTED]> wrote: I have used EIOCBRETRY in the patch to minimize source code modification only. [...] A lot of errno's have different meaning in different functions or contexts. EAGAIN could be used instated of EIOCBRETRY for irredundant set. I also think

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-09 Thread Zach Brown
On Feb 9, 2007, at 6:05 AM, Suparna Bhattacharya wrote: On Fri, Feb 09, 2007 at 11:40:27AM +0100, Jiri Kosina wrote: On Fri, 9 Feb 2007, Andrew Morton wrote: @@ -1204,7 +1204,7 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov, do_generic_file_rea

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-09 Thread Ananiev, Leonid I
Leonid -Original Message- From: Suparna Bhattacharya [mailto:[EMAIL PROTECTED] Sent: Friday, February 09, 2007 2:06 PM To: Jiri Kosina Cc: Andrew Morton; Ananiev, Leonid I; linux-kernel@vger.kernel.org; linux-aio; Zach Brown; Chris Mason; Badari Pulavarty; Jan Kara Subject: Re: [PATCH] ai

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-09 Thread Suparna Bhattacharya
On Fri, Feb 09, 2007 at 11:40:27AM +0100, Jiri Kosina wrote: > On Fri, 9 Feb 2007, Andrew Morton wrote: > > > > @@ -1204,7 +1204,7 @@ generic_file_aio_read(struct kiocb *iocb, const > > > struct iovec *iov, > > > do_generic_file_read(filp,ppos,&desc,file_read_actor); > > >

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-09 Thread Jiri Kosina
On Fri, 9 Feb 2007, Andrew Morton wrote: > > @@ -1204,7 +1204,7 @@ generic_file_aio_read(struct kiocb *iocb, const > > struct iovec *iov, > > do_generic_file_read(filp,ppos,&desc,file_read_actor); > > retval += desc.written; > > if (desc

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-09 Thread Andrew Morton
On Fri, 9 Feb 2007 10:54:36 +0100 (CET) Jiri Kosina <[EMAIL PROTECTED]> wrote: > @@ -1204,7 +1204,7 @@ generic_file_aio_read(struct kiocb *iocb, const struct > iovec *iov, > do_generic_file_read(filp,ppos,&desc,file_read_actor); > retval += desc.written

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-09 Thread Jiri Kosina
On Fri, 9 Feb 2007, Ananiev, Leonid I wrote: > I have used EIOCBRETRY in the patch to minimize source code modification > only. It is notable that EIOCBRETRY is never set in kernel, but tested > only. There is indeed something strange in aio in 2.6.20 (and maybe older) - for example do_generic

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-09 Thread Jiri Kosina
On Fri, 9 Feb 2007, Ananiev, Leonid I wrote: > Fix "Kernel BUG at fs/aio.c:509". Return EIOCBRETRY but not EIO if page > is busy. I am currently also hunting in this area, and I think there is something strange in generic_file_aio_read(). This seems strange: for (seg = 0; seg < nr_segs

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-09 Thread Ananiev, Leonid I
: fix kernel bug when page is temporally busy On Fri, Feb 09, 2007 at 08:41:41AM +0300, Ananiev, Leonid I wrote: > > invalidate_inode_pages2() has other callers. I suspect with this > change > > we'll end up leaking EIOCBRETRY back to userspace. > > EIOCBRETR

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-08 Thread Suparna Bhattacharya
On Fri, Feb 09, 2007 at 08:41:41AM +0300, Ananiev, Leonid I wrote: > > invalidate_inode_pages2() has other callers. I suspect with this > change > > we'll end up leaking EIOCBRETRY back to userspace. > > EIOCBRETRY is used and caught already in do_sync_read() and > do_sync_readv_writev(). > >

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-08 Thread Andrew Morton
On Fri, 9 Feb 2007 08:41:41 +0300 "Ananiev, Leonid I" <[EMAIL PROTECTED]> wrote: > > > invalidate_inode_pages2() has other callers. I suspect with this > change > > we'll end up leaking EIOCBRETRY back to userspace. > > EIOCBRETRY is used and caught already in do_sync_read() and > do_sync_readv

RE: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-08 Thread Ananiev, Leonid I
> invalidate_inode_pages2() has other callers. I suspect with this change > we'll end up leaking EIOCBRETRY back to userspace. EIOCBRETRY is used and caught already in do_sync_read() and do_sync_readv_writev(). Below fixed patch against kernel 2.6.20. >From Leonid Ananiev Fix kernel bug when

Re: [PATCH] aio: fix kernel bug when page is temporally busy

2007-02-08 Thread Andrew Morton
On Fri, 9 Feb 2007 07:29:31 +0300 "Ananiev, Leonid I" <[EMAIL PROTECTED]> wrote: > >From Leonid Ananiev > > Fix "Kernel BUG at fs/aio.c:509". Return EIOCBRETRY but not EIO if page > is busy. > > Signed-off-by: Leonid Ananiev <[EMAIL PROTECTED]> > > "Kernel BUG at fs/aio.c:509" > http://marc.th

[PATCH] aio: fix kernel bug when page is temporally busy

2007-02-08 Thread Ananiev, Leonid I
>From Leonid Ananiev Fix "Kernel BUG at fs/aio.c:509". Return EIOCBRETRY but not EIO if page is busy. Signed-off-by: Leonid Ananiev <[EMAIL PROTECTED]> "Kernel BUG at fs/aio.c:509" http://marc.theaimsgroup.com/?l=linux-kernel&m=117031052517746&w=2 is present in 2.6.20 as well as 2.6.19. The in