diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2019-01-09 10:28:20 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-01-09 10:29:36 -0800 |
commit | d321f575e2acec6f1077ab09ff0a089fa6ac0ec6 (patch) | |
tree | 6808606015855a9f961628f42f2d5629355cad4d /runsc | |
parent | 0d7023d581612e1670ef36490a827e46968d6d08 (diff) |
Fix lock order violation.
overlayFileOperations.Readdir was holding overlay.copyMu while calling
DirentReaddir, which then attempts to take take the corresponding Dirent.mu,
causing a lock order violation. (See lock order documentation in
fs/copy_up.go.)
We only actually need to hold copyMu during readdirEntries(), so holding the
lock is moved in there, thus avoiding the lock order violation.
A new lock was added to protect overlayFileOperations.dirCache. We were
inadvertently relying on copyMu to protect this. There is no reason it should
not have its own lock.
PiperOrigin-RevId: 228542473
Change-Id: I03c3a368c8cbc0b5a79d50cc486fc94adaddc1c2
Diffstat (limited to 'runsc')
0 files changed, 0 insertions, 0 deletions