Bug 143200 - Use st_mtime instead of st_atime to track file access time
Summary: Use st_mtime instead of st_atime to track file access time
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-29 16:24 PDT by Antti Koivisto
Modified: 2015-03-30 11:17 PDT (History)
1 user (show)

See Also:


Attachments
patch (5.60 KB, patch)
2015-03-29 16:34 PDT, Antti Koivisto
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2015-03-29 16:24:49 PDT
On OS X atime updates automatically so calling Storage::traverse() always ends up updating all access times. We update mtime manually on successful cache retrieve only.
Comment 1 Antti Koivisto 2015-03-29 16:34:26 PDT
Created attachment 249701 [details]
patch
Comment 2 Darin Adler 2015-03-29 16:36:35 PDT
Comment on attachment 249701 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249701&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:592
> +    // Modificiation time is updated on read. Don't use access time since OS may update it automatically on any read.

Typo: Modificiation

Comment is unclear. When you say “is updated on read” you mean “is updated by WebKit cache code when it reads an item from the cache”, but it sounds like “is updated by the file system when any process reads the file”.
Comment 3 Antti Koivisto 2015-03-29 16:45:23 PDT
https://trac.webkit.org/r182124
Comment 4 Andreas Kling 2015-03-30 10:54:41 PDT
Mild LOL at this bug. atime rarely does what anyone really wants :|
Comment 5 Antti Koivisto 2015-03-30 11:17:53 PDT
Wish there was at least a way to disable automatic atime updates for cache files. It is semantically nice.