summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/gofer/regular_file.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-07-13 20:38:02 +0000
committergVisor bot <gvisor-bot@google.com>2020-07-13 20:38:02 +0000
commitb6add84b641bfe57ed259737adfc21b36c8501e8 (patch)
tree266cf8dc39f3807f4e1e19de8c672be5f5a6abc8 /pkg/sentry/fsimpl/gofer/regular_file.go
parent46006a86a10c4ad2100506256332191bea522d57 (diff)
parent6994f4d5912ce9dc9233aebe9902892824904b71 (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.go4
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()
}