summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/overlay/directory.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-09-18 22:32:34 +0000
committergVisor bot <gvisor-bot@google.com>2020-09-18 22:32:34 +0000
commit4d48f2e1993cbba96479ed691e123090e4a5ad49 (patch)
tree8383c5464809aa176732c43f142b0c7e85b44370 /pkg/sentry/fsimpl/overlay/directory.go
parent4e151d4db227dfa8b556ce286ae7c8031bb8067b (diff)
parentc23e39f419f2dbdb67920fed1828399a5ac2479b (diff)
Merge release-20200907.0-150-gc23e39f41 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/overlay/directory.go')
-rw-r--r--pkg/sentry/fsimpl/overlay/directory.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/overlay/directory.go b/pkg/sentry/fsimpl/overlay/directory.go
index b1b292e83..7ab42e71e 100644
--- a/pkg/sentry/fsimpl/overlay/directory.go
+++ b/pkg/sentry/fsimpl/overlay/directory.go
@@ -143,7 +143,14 @@ func (d *dentry) getDirents(ctx context.Context) ([]vfs.Dirent, error) {
defer d.fs.renameMu.RUnlock()
d.dirMu.Lock()
defer d.dirMu.Unlock()
+ return d.getDirentsLocked(ctx)
+}
+// Preconditions:
+// * filesystem.renameMu must be locked.
+// * d.dirMu must be locked.
+// * d.isDir().
+func (d *dentry) getDirentsLocked(ctx context.Context) ([]vfs.Dirent, error) {
if d.dirents != nil {
return d.dirents, nil
}