Skip to content

Commit

Permalink
Enable VFS2 by default
Browse files Browse the repository at this point in the history
This change enables VFS2 by default. VFS2 is much faster than the previous
implementation and it's also more compatible. VFS1 is no longer supported and
will be deleted from the code.

Use `--vfs2=false` if you need to disable it. Make sure to report a bug if you
have the need to disable VFS2 or something is not working for you.

Closes #1035

PiperOrigin-RevId: 404898135
  • Loading branch information
fvoznika authored and gvisor-bot committed Oct 21, 2021
1 parent 207221f commit b928a24
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion runsc/config/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func RegisterFlags() {
flag.Bool("overlay", false, "wrap filesystem mounts with writable overlay. All modifications are stored in memory inside the sandbox.")
flag.Bool("verity", false, "specifies whether a verity file system will be mounted.")
flag.Bool("fsgofer-host-uds", false, "allow the gofer to mount Unix Domain Sockets.")
flag.Bool("vfs2", false, "enables VFSv2. This uses the new VFS layer that is faster than the previous one.")
flag.Bool("vfs2", true, "enables VFSv2. This uses the new VFS layer that is faster than the previous one.")
flag.Bool("fuse", false, "TEST ONLY; use while FUSE in VFSv2 is landing. This allows the use of the new experimental FUSE filesystem.")
flag.Bool("lisafs", false, "Enables lisafs protocol instead of 9P. This is only effective with VFS2.")
flag.Bool("cgroupfs", false, "Automatically mount cgroupfs.")
Expand Down
4 changes: 3 additions & 1 deletion runsc/container/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ var (
func configsHelper(t *testing.T, opts ...configOption) map[string]*config.Config {
// Always load the default config.
cs := make(map[string]*config.Config)
testutil.TestConfig(t)
for _, o := range opts {
c := testutil.TestConfig(t)
c.VFS2 = false
switch o {
case overlay:
c.Overlay = true
Expand Down Expand Up @@ -2615,6 +2615,8 @@ func TestCat(t *testing.T) {
f.Close()

spec, conf := sleepSpecConf(t)
// TODO(gvisor.dev/issue/6742): Add VFS2 support.
conf.VFS2 = false

_, bundleDir, cleanup, err := testutil.SetupContainer(spec, conf)
if err != nil {
Expand Down
8 changes: 3 additions & 5 deletions test/runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,9 @@ func runRunsc(tc gtest.TestCase, spec *specs.Spec) error {
if *overlay {
args = append(args, "-overlay")
}
if *vfs2 {
args = append(args, "-vfs2")
if *fuse {
args = append(args, "-fuse")
}
args = append(args, fmt.Sprintf("-vfs2=%t", *vfs2))
if *vfs2 && *fuse {
args = append(args, "-fuse")
}
if *debug {
args = append(args, "-debug", "-log-packets=true")
Expand Down

0 comments on commit b928a24

Please sign in to comment.