Skip to content

Commit

Permalink
Merge pull request #698 from giuseppe/counter-check-for-unmount
Browse files Browse the repository at this point in the history
counter: check for external umounts
  • Loading branch information
rhatdan authored Aug 24, 2020
2 parents 68196e0 + 051e1e6 commit 7d740f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func (c *RefCounter) incdec(path string, infoOp func(minfo *minfo)) int {
if c.checker.IsMounted(path) {
m.count++
}
} else if !c.checker.IsMounted(path) {
// if the unmount was performed outside of this process (e.g. conmon cleanup)
//the ref counter would lose track of it. Check if it is still mounted.
m.count = 0
}
infoOp(m)
count := m.count
Expand Down

0 comments on commit 7d740f6

Please sign in to comment.