summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/gofer/time.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-08-07 00:10:35 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-07 00:12:24 -0700
commit4fa1c304a133297bc6895729d74aa35a015e759e (patch)
tree57c561eb3674d98d4172bb7e930e4b9b4d44f8c2 /pkg/sentry/fsimpl/gofer/time.go
parentf20e63e31b56784c596897e86f03441f9d05f567 (diff)
Try to update atime and mtime on VFS2 gofer files on dentry eviction.
PiperOrigin-RevId: 325388385
Diffstat (limited to 'pkg/sentry/fsimpl/gofer/time.go')
-rw-r--r--pkg/sentry/fsimpl/gofer/time.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/gofer/time.go b/pkg/sentry/fsimpl/gofer/time.go
index 0eef4e16e..2cb8191b9 100644
--- a/pkg/sentry/fsimpl/gofer/time.go
+++ b/pkg/sentry/fsimpl/gofer/time.go
@@ -47,6 +47,7 @@ func (d *dentry) touchAtime(mnt *vfs.Mount) {
now := d.fs.clock.Now().Nanoseconds()
d.metadataMu.Lock()
atomic.StoreInt64(&d.atime, now)
+ atomic.StoreUint32(&d.atimeDirty, 1)
d.metadataMu.Unlock()
mnt.EndWrite()
}
@@ -67,6 +68,7 @@ func (d *dentry) touchCMtime() {
d.metadataMu.Lock()
atomic.StoreInt64(&d.mtime, now)
atomic.StoreInt64(&d.ctime, now)
+ atomic.StoreUint32(&d.mtimeDirty, 1)
d.metadataMu.Unlock()
}
@@ -76,4 +78,5 @@ func (d *dentry) touchCMtimeLocked() {
now := d.fs.clock.Now().Nanoseconds()
atomic.StoreInt64(&d.mtime, now)
atomic.StoreInt64(&d.ctime, now)
+ atomic.StoreUint32(&d.mtimeDirty, 1)
}