From 577c82f22c6c175240fa52fee560f39aaa7db3a7 Mon Sep 17 00:00:00 2001 From: Dean Deng Date: Tue, 13 Oct 2020 01:11:00 -0700 Subject: [vfs2] Add FilesystemType.Release to avoid reference leaks. Singleton filesystem like devpts and devtmpfs have a single filesystem shared among all mounts, so they acquire a "self-reference" when initialized that must be released when the entire virtual filesystem is released at sandbox exit. PiperOrigin-RevId: 336828852 --- pkg/sentry/fsimpl/pipefs/pipefs.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/sentry/fsimpl/pipefs/pipefs.go') diff --git a/pkg/sentry/fsimpl/pipefs/pipefs.go b/pkg/sentry/fsimpl/pipefs/pipefs.go index 903bd8cdf..e44b79b68 100644 --- a/pkg/sentry/fsimpl/pipefs/pipefs.go +++ b/pkg/sentry/fsimpl/pipefs/pipefs.go @@ -39,6 +39,9 @@ func (filesystemType) Name() string { return "pipefs" } +// Release implements vfs.FilesystemType.Release. +func (filesystemType) Release(ctx context.Context) {} + // GetFilesystem implements vfs.FilesystemType.GetFilesystem. func (filesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.VirtualFilesystem, creds *auth.Credentials, source string, opts vfs.GetFilesystemOptions) (*vfs.Filesystem, *vfs.Dentry, error) { panic("pipefs.filesystemType.GetFilesystem should never be called") -- cgit v1.2.3