Hi all,
   At weekend, I read the kernel code about aio & direction. For close(), it 
don't wait aio to complete.
But for fsync(), it will wait all aio to complete. 
   Mark used this patch(which using fsync() on write_thread_entry) and the 
result is looks good.
   I want to revert the patch which don't use aio when closing journal. And 
using fsync(). It make the code simple.
   How about this?

Thanks!
Jianpeng

> [email protected]
> Subject: Re: Deadlock in ceph journal
> 
> On 23/08/14 10:22, Somnath Roy wrote:
> > I think it is using direct io for non-aio mode as well.
> >
> > Thanks & Regards
> > Somnath
> >
> 
> > One thing that does still concern me - if I understand what is happening 
> > here
> correctly: we write to the journal using aio until we want to stop doing 
> writes
> (presumably pre closing it), then use normal io to write at that point.
> >
> > Given that we appear to be using direct io whenever we use aio, does this
> mean we end up mixing direct and buffered io to the journal [1] (or is the
> normal i.e non aio write still using direct io)?
> >
> >
> 
> Thanks Somnath,
> 
> I think you are correct (I missed the bit in FileJournal::_open that seems to
> cover this):
> 
> 
>    if (forwrite) {
>      flags = O_RDWR;
>      if (directio)
>        flags |= O_DIRECT | O_DSYNC;
> 
> 
> i.e the journal is opened with DIRECT, so all writes (async or not) will
> be direct.
> 
> Cheers
> 
> Mark
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to