summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/gofer/special_file.go
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-07-01 17:09:26 -0700
committergVisor bot <gvisor-bot@google.com>2020-07-01 17:11:26 -0700
commit65d99855583a21b6ea511ea74aa52318d0a1e5b2 (patch)
treea4763bd90cdb8885574805f5413d4b3e4ae55c3b /pkg/sentry/fsimpl/gofer/special_file.go
parent31b27adf9b63dcefd0a753908bf984aa1f78b394 (diff)
Port vfs1 implementation of sync_file_range to vfs2.
Currently, we always perform a full-file sync which could be extremely expensive for some applications. Although vfs1 did not fully support sync_file_range, there were some optimizations that allowed us skip some unnecessary write-outs. Updates #2923, #1897. PiperOrigin-RevId: 319324213
Diffstat (limited to 'pkg/sentry/fsimpl/gofer/special_file.go')
-rw-r--r--pkg/sentry/fsimpl/gofer/special_file.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/sentry/fsimpl/gofer/special_file.go b/pkg/sentry/fsimpl/gofer/special_file.go
index a016cbae1..2b381af05 100644
--- a/pkg/sentry/fsimpl/gofer/special_file.go
+++ b/pkg/sentry/fsimpl/gofer/special_file.go
@@ -235,8 +235,5 @@ func (fd *specialFileFD) Seek(ctx context.Context, offset int64, whence int32) (
// Sync implements vfs.FileDescriptionImpl.Sync.
func (fd *specialFileFD) Sync(ctx context.Context) error {
- if !fd.vfsfd.IsWritable() {
- return nil
- }
- return fd.handle.sync(ctx)
+ return fd.dentry().syncSharedHandle(ctx)
}