diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-11-02 19:34:05 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-11-02 19:34:05 +0000 |
commit | 06c496f54fd0700ca8252ede5843575440ceb9b3 (patch) | |
tree | 5c18875817c206aa24e1c4c9c0d4560f0467628e /runsc | |
parent | 04d474e716e094266534c791188bea5e36fe5dda (diff) | |
parent | 1e1d6b2be37873c5e62461834df973f41565c662 (diff) |
Merge release-20211026.0-22-g1e1d6b2be (automated)
Diffstat (limited to 'runsc')
-rw-r--r-- | runsc/fsgofer/fsgofer.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runsc/fsgofer/fsgofer.go b/runsc/fsgofer/fsgofer.go index 600b21189..3d610199c 100644 --- a/runsc/fsgofer/fsgofer.go +++ b/runsc/fsgofer/fsgofer.go @@ -140,6 +140,17 @@ func (a *attachPoint) Attach() (p9.File, error) { return lf, nil } +// ServerOptions implements p9.Attacher. It's safe to call SetAttr and Allocate +// on deleted files because fsgofer either uses an existing FD or opens a new +// one using the magic symlink in `/proc/[pid]/fd` and cannot mistakely open +// a file that was created in the same path as the delete file. +func (a *attachPoint) ServerOptions() p9.AttacherOptions { + return p9.AttacherOptions{ + SetAttrOnDeleted: true, + AllocateOnDeleted: true, + } +} + // makeQID returns a unique QID for the given stat buffer. func (a *attachPoint) makeQID(stat *unix.Stat_t) p9.QID { a.deviceMu.Lock() |