[sheepdog] [PATCH] disk cache: drop O_DSYNC only when O_DIRECT is set

Liu Yuan namei.unix at gmail.com
Tue Oct 30 11:30:37 CET 2012


On 10/30/2012 08:49 AM, MORITA Kazutaka wrote:
> At Thu, 25 Oct 2012 13:52:01 +0900,
> MORITA Kazutaka wrote:
>>
>> To make sure that data is not cached by the host os, we cannot drop
>> O_DSYNC when O_DIRECT is not set.
>>

Why data are cached in page cache a problem? We do sync(2) it afterwards.

We don't set O_DIRECT for inode object, so sync(2) won't flush it to
disk safely?

Thanks,
Yuan

>> Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
>> ---
>>  sheep/plain_store.c |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> I would drop this patch since dropping a page cache with posix_fadvise
> looks better than adding O_DSYNC flag.  I'll send the patch later.
> 




More information about the sheepdog mailing list