From ac01f245ff4515af2b69225e8b7fb2cf28808275 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Thu, 10 May 2018 14:58:51 -0700 Subject: Skip atime and mtime update when file is backed by host FD When file is backed by host FD, atime and mtime for the host file and the cached attributes in the Sentry must be close together. In this case, the call to update atime and mtime can be skipped. This is important when host filesystem is using overlay because updating atime and mtime explicitly forces a copy up for every file that is touched. PiperOrigin-RevId: 196176413 Change-Id: I3933ea91637a071ba2ea9db9d8ac7cdba5dc0482 --- runsc/boot/fs.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'runsc/boot/fs.go') diff --git a/runsc/boot/fs.go b/runsc/boot/fs.go index 2073bd0b1..86cbe1169 100644 --- a/runsc/boot/fs.go +++ b/runsc/boot/fs.go @@ -141,10 +141,7 @@ func createMountNamespace(ctx context.Context, spec *specs.Spec, conf *Config, i // createRootMount creates the root filesystem. func createRootMount(ctx context.Context, spec *specs.Spec, conf *Config, fds *fdDispenser) (*fs.Inode, error) { // First construct the filesystem from the spec.Root. - mf := fs.MountSourceFlags{ - ReadOnly: spec.Root.Readonly, - NoAtime: true, - } + mf := fs.MountSourceFlags{ReadOnly: spec.Root.Readonly} var ( rootInode *fs.Inode @@ -261,7 +258,6 @@ func mountSubmount(ctx context.Context, spec *specs.Spec, conf *Config, mns *fs. // All writes go to upper, be paranoid and make lower readonly. mf.ReadOnly = true } - mf.NoAtime = true inode, err := filesystem.Mount(ctx, m.Type, mf, strings.Join(data, ",")) if err != nil { -- cgit v1.2.3