summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/tmpfs/filesystem.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-07-02 02:52:10 +0000
committergVisor bot <gvisor-bot@google.com>2020-07-02 02:52:10 +0000
commitd4091add4ab3c58108e999ff3ceca49278e3bccb (patch)
treed3a92b63ceaaa1a823f02c7be2bbcf5ed1d57e7e /pkg/sentry/fsimpl/tmpfs/filesystem.go
parent9325ff64d7d60ca528b9a8a23fb534d12ad9f864 (diff)
parent52b44719d6e14ec299d0d953b4dc07a712b897fa (diff)
Merge release-20200622.1-57-g52b44719d (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/tmpfs/filesystem.go')
-rw-r--r--pkg/sentry/fsimpl/tmpfs/filesystem.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/tmpfs/filesystem.go b/pkg/sentry/fsimpl/tmpfs/filesystem.go
index ce0dbb154..ed40f6b52 100644
--- a/pkg/sentry/fsimpl/tmpfs/filesystem.go
+++ b/pkg/sentry/fsimpl/tmpfs/filesystem.go
@@ -410,7 +410,7 @@ func (d *dentry) open(ctx context.Context, rp *vfs.ResolvingPath, opts *vfs.Open
if err := fd.vfsfd.Init(&fd, opts.Flags, rp.Mount(), &d.vfsd, &vfs.FileDescriptionOptions{AllowDirectIO: true}); err != nil {
return nil, err
}
- if opts.Flags&linux.O_TRUNC != 0 {
+ if !afterCreate && opts.Flags&linux.O_TRUNC != 0 {
if _, err := impl.truncate(0); err != nil {
return nil, err
}