Re: [Ocfs2-devel] [PATCH] ocfs2: don't use iocb when EIOCBQUEUED returns

2018-05-08 Thread Changwei Ge
Hi Joseph, Thanks a lot for your comments. Actually, I think I have found the root cause why the iocb is freed. As __generic_file_write_iter() returns -EIOCBQUEUED, aio_complete() will be invoked asynchronously against write_iter()->ocfs2_file_write_iter(). If -EIOCBQUEUED is not returned, aio_

Re: [Ocfs2-devel] [PATCH] ocfs2: don't use iocb when EIOCBQUEUED returns

2018-05-08 Thread Joseph Qi
Hi Changwei, I agree with Gang that currently we still haven't figured out why iocb was freed. Though you fix won't bring any side effect, it looks like a workaround. That means, the freed iocb may still have risk in other place. Thanks, Joseph On 18/5/8 23:23, Changwei Ge wrote: > Hi Gang, > >

Re: [Ocfs2-devel] [PATCH] ocfs2: don't use iocb when EIOCBQUEUED returns

2018-05-08 Thread Changwei Ge
Hi Gang, I don't think this patch is a workaround trick. We do face the risk using freed iocb although it is actually indeed hard to encounter, it still exists. So I propose to fix it making ocfs2 more reliable. Moreover, this patch has been kept in -mm tree for one month. Can anyone help re

Re: [Ocfs2-devel] [PATCH] ocfs2: don't use iocb when EIOCBQUEUED returns

2018-04-10 Thread Gang He
Hi Changwei, The code change just works around the problem, but theoretically the IOCB object should not be freed before which is handled. Anyway, if we can find the root cause behind via some way (e.g. inject delay in some place), the result is more perfect. Thanks Gang >>> > Hi Jun, > >

Re: [Ocfs2-devel] [PATCH] ocfs2: don't use iocb when EIOCBQUEUED returns

2018-04-10 Thread Changwei Ge
Hi Jun, On 2018/4/11 9:52, piaojun wrote: > Hi Changwei, > > It seems other codes which try to access 'iocb' will also cause error, > right? I think we should find the reason why 'iocb' is freed first. Which code snippet do you mean? Actually, I have checked most of other parts in write_iter()

Re: [Ocfs2-devel] [PATCH] ocfs2: don't use iocb when EIOCBQUEUED returns

2018-04-10 Thread piaojun
Hi Changwei, It seems other codes which try to access 'iocb' will also cause error, right? I think we should find the reason why 'iocb' is freed first. thanks, Jun On 2018/4/11 9:07, Changwei Ge wrote: > Hi Jun, > > On 2018/4/11 8:52, piaojun wrote: >> Hi Changwei, >> >> It looks like a code bu

Re: [Ocfs2-devel] [PATCH] ocfs2: don't use iocb when EIOCBQUEUED returns

2018-04-10 Thread Changwei Ge
Hi Jun, On 2018/4/11 8:52, piaojun wrote: > Hi Changwei, > > It looks like a code bug, and 'iocb' should not be freed at this place. > Could this BUG reproduced easily? Actually, it's not easy to be reproduced since IO is much slower than CPU executing instructions. But the logic here is broken

Re: [Ocfs2-devel] [PATCH] ocfs2: don't use iocb when EIOCBQUEUED returns

2018-04-10 Thread piaojun
Hi Changwei, It looks like a code bug, and 'iocb' should not be freed at this place. Could this BUG reproduced easily? thanks, Jun On 2018/4/10 20:00, Changwei Ge wrote: > When -EIOCBQUEUED returns, it means that aio_complete() will be called > from dio_complete(), which is an asynchronous progr