summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-02-09 18:47:27 +0000
committergVisor bot <gvisor-bot@google.com>2021-02-09 18:47:27 +0000
commitfaa5b3394e01ab3639c8e91665557993a90c4016 (patch)
tree42c67e9c63f9bd78be7597dea0d3e69c186769f6
parent9ca9e6bb60ebba31a1293782ec25af0b2991c4dd (diff)
parent2b978d8743c5cf08d0e99512dd23580574a3ec23 (diff)
Merge release-20210201.0-65-g2b978d874 (automated)
-rw-r--r--pkg/sentry/fs/host/file.go13
-rw-r--r--pkg/sentry/fs/host/inode.go7
2 files changed, 3 insertions, 17 deletions
diff --git a/pkg/sentry/fs/host/file.go b/pkg/sentry/fs/host/file.go
index 86d1a87f0..fd4e057d8 100644
--- a/pkg/sentry/fs/host/file.go
+++ b/pkg/sentry/fs/host/file.go
@@ -180,16 +180,9 @@ func (f *fileOperations) Readdir(ctx context.Context, file *fs.File, serializer
// IterateDir implements fs.DirIterator.IterateDir.
func (f *fileOperations) IterateDir(ctx context.Context, d *fs.Dirent, dirCtx *fs.DirCtx, offset int) (int, error) {
- if f.dirinfo == nil {
- f.dirinfo = new(dirInfo)
- f.dirinfo.buf = make([]byte, usermem.PageSize)
- }
- entries, err := f.iops.readdirAll(f.dirinfo)
- if err != nil {
- return offset, err
- }
- count, err := fs.GenericReaddir(dirCtx, fs.NewSortedDentryMap(entries))
- return offset + count, err
+ // We only support non-directory file descriptors that have been
+ // imported, so just claim that this isn't a directory, even if it is.
+ return offset, syscall.ENOTDIR
}
// Write implements fs.FileOperations.Write.
diff --git a/pkg/sentry/fs/host/inode.go b/pkg/sentry/fs/host/inode.go
index 2c14aa6d9..df4b265fa 100644
--- a/pkg/sentry/fs/host/inode.go
+++ b/pkg/sentry/fs/host/inode.go
@@ -411,10 +411,3 @@ func (i *inodeOperations) DropLink() {}
// NotifyStatusChange implements fs.InodeOperations.NotifyStatusChange.
func (i *inodeOperations) NotifyStatusChange(ctx context.Context) {}
-
-// readdirAll returns all of the directory entries in i.
-func (i *inodeOperations) readdirAll(d *dirInfo) (map[string]fs.DentAttr, error) {
- // We only support non-directory file descriptors that have been
- // imported, so just claim that this isn't a directory, even if it is.
- return nil, syscall.ENOTDIR
-}