diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-07-13 20:38:02 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-13 20:38:02 +0000 |
commit | b6add84b641bfe57ed259737adfc21b36c8501e8 (patch) | |
tree | 266cf8dc39f3807f4e1e19de8c672be5f5a6abc8 /pkg/sentry/fsimpl/gofer/regular_file.go | |
parent | 46006a86a10c4ad2100506256332191bea522d57 (diff) | |
parent | 6994f4d5912ce9dc9233aebe9902892824904b71 (diff) |
Merge release-20200622.1-102-g6994f4d59 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/gofer/regular_file.go')
-rw-r--r-- | pkg/sentry/fsimpl/gofer/regular_file.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/gofer/regular_file.go b/pkg/sentry/fsimpl/gofer/regular_file.go index a2f02d9c7..f10350c97 100644 --- a/pkg/sentry/fsimpl/gofer/regular_file.go +++ b/pkg/sentry/fsimpl/gofer/regular_file.go @@ -89,7 +89,9 @@ func (fd *regularFileFD) Allocate(ctx context.Context, mode, offset, length uint if err != nil { return err } - d.size = size + d.dataMu.Lock() + atomic.StoreUint64(&d.size, size) + d.dataMu.Unlock() if !d.cachedMetadataAuthoritative() { d.touchCMtimeLocked() } |