summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/devtmpfs
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-10-13 08:16:42 +0000
committergVisor bot <gvisor-bot@google.com>2020-10-13 08:16:42 +0000
commite03503a84d2f4d3eba55b93d61f0c730e1a24842 (patch)
treedf5df29885ba3a06fb9c9e5a30db354af8c0c085 /pkg/sentry/fsimpl/devtmpfs
parent8959c30e99cd49d9f512ebeea65e7d45a776c242 (diff)
parent577c82f22c6c175240fa52fee560f39aaa7db3a7 (diff)
Merge release-20200928.0-99-g577c82f22 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/devtmpfs')
-rw-r--r--pkg/sentry/fsimpl/devtmpfs/devtmpfs.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/devtmpfs/devtmpfs.go b/pkg/sentry/fsimpl/devtmpfs/devtmpfs.go
index 6d1753080..ed729e480 100644
--- a/pkg/sentry/fsimpl/devtmpfs/devtmpfs.go
+++ b/pkg/sentry/fsimpl/devtmpfs/devtmpfs.go
@@ -71,6 +71,15 @@ func (fst *FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.Virtua
return fst.fs, fst.root, nil
}
+// Release implements vfs.FilesystemType.Release.
+func (fst *FilesystemType) Release(ctx context.Context) {
+ if fst.fs != nil {
+ // Release the original reference obtained when creating the filesystem.
+ fst.root.DecRef(ctx)
+ fst.fs.DecRef(ctx)
+ }
+}
+
// Accessor allows devices to create device special files in devtmpfs.
type Accessor struct {
vfsObj *vfs.VirtualFilesystem