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,