bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] [patch] O_NOATIME support


From: Paul Eggert
Subject: Re: [Bug-tar] [patch] O_NOATIME support
Date: Tue, 20 Sep 2005 10:56:26 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Ian Turner <address@hidden> writes:

> Perhaps it would be better to have --atime-preserve=system, for O_NOATIME 
> only, --atime-preserve=legacy, for utimes(), or --atime-preserve=best (or 
> just --atime-preserve) to guess what's best.

Yes, something like that sounds better (though I would use "restore"
rather than "legacy", and "heuristic" rather than "best").

>> Can't tar fstat the file and see whether its last access time is
>> changed, after reading the file?  If it hasn't changed, O_NOATIME is
>> probably working.
>
> Nope. Consider the case where some other process is also reading the file. It 
> introduces a race condition.

But this problems will merely cause us to fall back to using utimes,
and even then the problem will occur only if this is the first file
that we've seen in the file system, assuming that we've cached the
noatime flag.  That's OK for a heuristic, I think.

> Also, on some filesystems, the atime might not 
> change right away, introducing a second race condition.

Is that true even for the process that is actually reading the file?
I thought it had to do with NFS access, where one process on one host
is reading and another process on a different host is statting.

>> > +AC_CHECK_DECL(O_NOATIME,
>>
>> Is the Autoconf stuff necessary?  Why not just use "#ifdef O_NOATIME"?
>
> Mostly because it's used both in create.c and compare.c; it seemed to me 
> better to have the check all in one place.

I still don't get it.  Either way, the code needs to inspect a symbol;
does it really matter whether it's "#ifdef O_NOATIME" or "#if HAVE_NOATIME"?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]