vfs: MountNamespace.Root() has to return a top mount of /

A few mounts can be mounted on top of `/`.

PiperOrigin-RevId: 558264274
This commit is contained in:
Andrei Vagin
2023-08-18 15:35:47 -07:00
committed by gVisor bot
parent 9ee64caa00
commit eb6b3ac00b
20 changed files with 49 additions and 52 deletions
+1 -2
View File
@@ -96,8 +96,7 @@ func NewAccessor(ctx context.Context, vfsObj *vfs.VirtualFilesystem, creds *auth
return nil, err
}
// Pass a reference on root to the Accessor.
root := mntns.Root()
root.IncRef()
root := mntns.Root(ctx)
return &Accessor{
vfsObj: vfsObj,
mntns: mntns,
+1 -2
View File
@@ -52,8 +52,7 @@ func setupDevtmpfs(t *testing.T) (context.Context, *auth.Credentials, *vfs.Virtu
if err != nil {
t.Fatalf("failed to create tmpfs root mount: %v", err)
}
root := mntns.Root()
root.IncRef()
root := mntns.Root(ctx)
devpop := vfs.PathOperation{
Root: root,
Start: root,