diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-06-19 15:48:16 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-06-19 15:48:16 +0000 |
commit | 8f2d48b38b4a07edcd8b126e74da39f1f5eb672d (patch) | |
tree | a83b8a8ea030a01062dc1685ece5e0eaa4acf718 /pkg/sentry/fsimpl | |
parent | 6171e45f4a950ee210b8bf8a255c33e5219a932d (diff) | |
parent | f40d023ad6f8c19898ca105842a88961b3c2994c (diff) |
Merge release-20200608.0-93-gf40d023ad (automated)
Diffstat (limited to 'pkg/sentry/fsimpl')
-rw-r--r-- | pkg/sentry/fsimpl/gofer/filesystem.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/gofer/filesystem.go b/pkg/sentry/fsimpl/gofer/filesystem.go index 21eb976cb..5501781ac 100644 --- a/pkg/sentry/fsimpl/gofer/filesystem.go +++ b/pkg/sentry/fsimpl/gofer/filesystem.go @@ -1196,7 +1196,8 @@ func (fs *filesystem) RenameAt(ctx context.Context, rp *vfs.ResolvingPath, oldPa if newParent.cachedMetadataAuthoritative() { newParent.dirents = nil newParent.touchCMtime() - if renamed.isDir() { + if renamed.isDir() && (replaced == nil || !replaced.isDir()) { + // Increase the link count if we did not replace another directory. newParent.incLinks() } } |