diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-01-29 20:35:41 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-29 20:35:41 +0000 |
commit | ba1f48bd4dc7b7bb3dbc93a992591555efd4c63a (patch) | |
tree | 9c4a89e2b2db3114c4823d7c4050ce0a7656b6b3 /pkg | |
parent | 921f966289215b8a4b193eb19bf9953874697a4a (diff) | |
parent | 0fa534f1164f2bf6cf50a37d4dce584b6fc8ec07 (diff) |
Merge release-20210125.0-30-g0fa534f11 (automated)
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/sentry/fsimpl/gofer/special_file.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/sentry/fsimpl/gofer/special_file.go b/pkg/sentry/fsimpl/gofer/special_file.go index 089955a96..ae972fcb5 100644 --- a/pkg/sentry/fsimpl/gofer/special_file.go +++ b/pkg/sentry/fsimpl/gofer/special_file.go @@ -299,10 +299,15 @@ func (fd *specialFileFD) pwrite(ctx context.Context, src usermem.IOSequence, off src = src.TakeFirst64(limit) } - // Do a buffered write. See rationale in PRead. if d.cachedMetadataAuthoritative() { - d.touchCMtime() + if fd.isRegularFile { + d.touchCMtimeLocked() + } else { + d.touchCMtime() + } } + + // Do a buffered write. See rationale in PRead. buf := make([]byte, src.NumBytes()) copied, copyErr := src.CopyIn(ctx, buf) if copied == 0 && copyErr != nil { |