From 110c3d76e4a60070be4e38204b23ce206bace87d Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Thu, 8 Dec 2022 14:35:23 -0800 Subject: [PATCH] Remove remaining references to vfs2. PiperOrigin-RevId: 493998299 --- images/syzkaller/default-gvisor-config.cfg | 2 +- pkg/sentry/loader/elf.go | 8 +------- pkg/sentry/loader/vdso.go | 1 + pkg/sentry/socket/unix/unix.go | 6 ------ pkg/test/dockerutil/README.md | 3 +-- test/fuse/README.md | 7 ++----- 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/images/syzkaller/default-gvisor-config.cfg b/images/syzkaller/default-gvisor-config.cfg index f6b8dae50..4975b225a 100644 --- a/images/syzkaller/default-gvisor-config.cfg +++ b/images/syzkaller/default-gvisor-config.cfg @@ -10,6 +10,6 @@ "type": "gvisor", "vm": { "count": 1, - "runsc_args": "--debug --network none --platform ptrace --vfs2 -net-raw -watchdog-action=panic" + "runsc_args": "--debug --network none --platform ptrace -net-raw -watchdog-action=panic" } } diff --git a/pkg/sentry/loader/elf.go b/pkg/sentry/loader/elf.go index 73c332495..f20f715bd 100644 --- a/pkg/sentry/loader/elf.go +++ b/pkg/sentry/loader/elf.go @@ -90,14 +90,8 @@ type elfInfo struct { sharedObject bool } -// fullReader interface extracts the ReadFull method from fsbridge.File so that -// client code does not need to define an entire fsbridge.File when only read -// functionality is needed. -// -// TODO(gvisor.dev/issue/1035): Once VFS2 ships, rewrite this to wrap -// vfs.FileDescription's PRead/Read instead. type fullReader interface { - // ReadFull is the same as fsbridge.File.ReadFull. + // ReadFull is the same as vfs.FileDescription.ReadFull. ReadFull(ctx context.Context, dst usermem.IOSequence, offset int64) (int64, error) } diff --git a/pkg/sentry/loader/vdso.go b/pkg/sentry/loader/vdso.go index 94de24af2..2f4a1477c 100644 --- a/pkg/sentry/loader/vdso.go +++ b/pkg/sentry/loader/vdso.go @@ -55,6 +55,7 @@ type byteFullReader struct { data []byte } +// ReadFull implements fullReader.ReadFull. func (b *byteFullReader) ReadFull(ctx context.Context, dst usermem.IOSequence, offset int64) (int64, error) { if offset < 0 { return 0, linuxerr.EINVAL diff --git a/pkg/sentry/socket/unix/unix.go b/pkg/sentry/socket/unix/unix.go index d2001554d..485ebe746 100644 --- a/pkg/sentry/socket/unix/unix.go +++ b/pkg/sentry/socket/unix/unix.go @@ -417,12 +417,6 @@ func (*provider) Pair(t *kernel.Task, stype linux.SockType, protocol int) (*vfs. return s1, s2, nil } -// socketOpsCommon contains the socket operations common to VFS1 and VFS2. -// -// +stateify savable -type socketOpsCommon struct { -} - func (s *Socket) isPacket() bool { switch s.stype { case linux.SOCK_DGRAM, linux.SOCK_SEQPACKET: diff --git a/pkg/test/dockerutil/README.md b/pkg/test/dockerutil/README.md index 870292096..99170435e 100644 --- a/pkg/test/dockerutil/README.md +++ b/pkg/test/dockerutil/README.md @@ -35,8 +35,7 @@ use pprof profiles generated by `runsc debug`. The profiler will generate Block, CPU, Heap, Goroutine, and Mutex profiles. To generate profiles: * Install runsc with the `--profile` flag: `make configure RUNTIME=myrunsc - ARGS="--profile"` Also add other flags with ARGS like `--platform=kvm` or - `--vfs2`. + ARGS="--profile"` Also add other flags with ARGS like `--platform=kvm`. * Restart docker: `sudo service docker restart` To run and generate CPU profiles run: diff --git a/test/fuse/README.md b/test/fuse/README.md index 0831f422c..7a960ff18 100644 --- a/test/fuse/README.md +++ b/test/fuse/README.md @@ -107,19 +107,16 @@ complete a command and when the server awaits the next instruction. ## Running the tests -Based on syscall tests, FUSE tests generate targets only with vfs2 and fuse -enabled. The corresponding targets end in `_fuse`. - For example, to run fuse test in `stat_test.cc`: ```bash -$ bazel test //test/fuse:stat_test_runsc_ptrace_vfs2_fuse +$ bazel test //test/fuse:stat_test_runsc_ptrace ``` Test all targets tagged with fuse: ```bash -$ bazel test --test_tag_filters=fuse //test/fuse/... +$ bazel test //test/fuse/... ``` ## Writing a new FUSE test