[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190222053742.GA4270@avx2>
Date: Fri, 22 Feb 2019 08:37:42 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Jeremy Cline <jcline@...hat.com>,
David Both <dboth@...lennium-technology.com>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] proc: update i_atime when reading files
On Thu, Feb 21, 2019 at 11:37:14AM -0500, Jeremy Cline wrote:
> Prior to commit 1da4d377f943 ("proc: revalidate misc dentries"), the
> access, modify, and change times of files in /proc were just the current
> time.
Ehh, actually no. Doing
$(which sleep) infinity </proc/foo &
will sabotage atime updates because dentry and inode will be pinned in
caches.
"revalidate misc denries" commit simply makes the effect (much) more
visible by making objects stay in caches for longer.
> Now the mtime and ctime values change mostly as a user would
> expect, but the atime isn't updated when the file read. This patch
> updates the access time of /proc files when they are read.
> rv = read(file, buf, count, ppos);
> + if (rv >= 0)
> + inode->i_atime = current_time(inode);
> + }
Maybe it should be done given /proc is virtual so there are no concerns
about scheduling writes noone cares about to the filesystem.
Powered by blists - more mailing lists