summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/host/inode.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-06-09 23:39:30 +0000
committergVisor bot <gvisor-bot@google.com>2020-06-09 23:39:30 +0000
commit7b7dca8c87f3c164cd0f868101dea283f07db2a3 (patch)
treec5698dd77497dcf6d0da5195593df29e0fe163bb /pkg/sentry/fs/host/inode.go
parenta31f9b462c885eee22886100cde8eb4d25af61ec (diff)
parent6722b1e56fa63f3409f222a63241705aa3f3ace4 (diff)
Merge release-20200522.0-106-g6722b1e56 (automated)
Diffstat (limited to 'pkg/sentry/fs/host/inode.go')
-rw-r--r--pkg/sentry/fs/host/inode.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/fs/host/inode.go b/pkg/sentry/fs/host/inode.go
index 62f1246aa..fbfba1b58 100644
--- a/pkg/sentry/fs/host/inode.go
+++ b/pkg/sentry/fs/host/inode.go
@@ -368,6 +368,9 @@ func (i *inodeOperations) Allocate(ctx context.Context, inode *fs.Inode, offset,
// WriteOut implements fs.InodeOperations.WriteOut.
func (i *inodeOperations) WriteOut(ctx context.Context, inode *fs.Inode) error {
+ if inode.MountSource.Flags.ReadOnly {
+ return nil
+ }
// Have we been using host kernel metadata caches?
if !inode.MountSource.Flags.ForcePageCache || !canMap(inode) {
// Then the metadata is already up to date on the host.