summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/gofer
diff options
context:
space:
mode:
authorBhasker Hariharan <bhaskerh@google.com>2021-03-03 12:18:04 -0800
committergVisor bot <gvisor-bot@google.com>2021-03-03 12:24:21 -0800
commit3e69f5d088d121f1d3c4bf44ca637a48f13c4819 (patch)
tree153fa7d51f509c8a5cf066a7aea90fd334a08899 /pkg/sentry/fs/gofer
parent80bc67c268dba0126cd258075c06d744399e0f02 (diff)
Add checklocks analyzer.
This validates that struct fields if annotated with "// checklocks:mu" where "mu" is a mutex field in the same struct then access to the field is only done with "mu" locked. All types that are guarded by a mutex must be annotated with // +checklocks:<mutex field name> For more details please refer to README.md. PiperOrigin-RevId: 360729328
Diffstat (limited to 'pkg/sentry/fs/gofer')
-rw-r--r--pkg/sentry/fs/gofer/inode_state.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/sentry/fs/gofer/inode_state.go b/pkg/sentry/fs/gofer/inode_state.go
index 141e3c27f..e2af1d2ae 100644
--- a/pkg/sentry/fs/gofer/inode_state.go
+++ b/pkg/sentry/fs/gofer/inode_state.go
@@ -109,6 +109,7 @@ func (i *inodeFileState) loadLoading(_ struct{}) {
}
// afterLoad is invoked by stateify.
+// +checklocks:i.loading
func (i *inodeFileState) afterLoad() {
load := func() (err error) {
// See comment on i.loading().