From owner-freebsd-arch@FreeBSD.ORG Tue Jan 20 19:02:43 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDAE95CB; Tue, 20 Jan 2015 19:02:43 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B81FCBCC; Tue, 20 Jan 2015 19:02:43 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B49C0B97F; Tue, 20 Jan 2015 14:02:42 -0500 (EST) From: John Baldwin To: freebsd-arch@freebsd.org Subject: Re: Access times on directories. Date: Tue, 20 Jan 2015 10:47:54 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <20150118103959.GA54396@brick.home> <20150118221955.F60362@besplex.bde.org> In-Reply-To: <20150118221955.F60362@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201501201047.54379.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Jan 2015 14:02:42 -0500 (EST) Cc: Edward Tomasz =?utf-8?q?Napiera=C5=82a?= X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 19:02:44 -0000 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