Ian Turner <[EMAIL PROTECTED]> 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"?


_______________________________________________
Bug-tar mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-tar

Reply via email to