Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jan 2015 10:47:54 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-arch@freebsd.org
Cc:        Edward Tomasz =?utf-8?q?Napiera=C5=82a?= <trasz@freebsd.org>
Subject:   Re: Access times on directories.
Message-ID:  <201501201047.54379.jhb@freebsd.org>
In-Reply-To: <20150118221955.F60362@besplex.bde.org>
References:  <20150118103959.GA54396@brick.home> <20150118221955.F60362@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, January 18, 2015 6:55:07 am Bruce Evans wrote:
> On Sun, 18 Jan 2015, Edward Tomasz [utf-8] Napiera=C5~Ba wrote:
>=20
> > What is FreeBSD semantics for atime updates on directories?  It does not
> > seem to be working.  Is that by design?
>=20
> read(2) marks the atime for update in the usual way for directories
> on most or all file systems that support read(2) on directories.  That
> is about the only time atimes are marked on directories.  However,
> read(2) is rarely used for reading directories.  Most directory reads
> are probably done by readdir(2), and it uses getdirentries(2).  POSIX
> requires readdir() to mark the atime for update if an (uncached)
> directory entry is actually read.  This seems to be quite broken.
> There is no code in either readdir() or getdirentries to waste time
> marking the atime.  I think directory searches for the purpose of
> creating a new entry also don't update the atime, but this is not
> required by POSIX.

Also, I suspect that lookups would not trigger an atime update even if you =
fix=20
getdirentries (and of course that ignores the read-only mount case that Bru=
ce=20
already mentioned).

=2D-=20
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501201047.54379.jhb>