summaryrefslogtreecommitdiff
path: root/sys/tmpfs
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2021-10-23 17:39:09 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2021-10-23 17:39:09 +0000
commitf8033c8c8506f9d5967234a1ebbae1254a0a108b (patch)
tree97787a3439d3a2c0fc9d3c13563afeba4d647511 /sys/tmpfs
parent0f23e7aef428520dbc399fbb364aab4626f4a387 (diff)
Call uvm_vnp_uncache() in tmpfs_write(). We currently only call
uvm_vnp_uncache() in tmpfs_write() when a file grows in size. This is not enough. We need to invalidate UVM's cache of the vnode every time the contents of the vnode are modified. Failure to do so might lead to inconsistencies between read/mmap consumers. From Pedro Martelletto
Diffstat (limited to 'sys/tmpfs')
-rw-r--r--sys/tmpfs/tmpfs_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/tmpfs/tmpfs_vnops.c b/sys/tmpfs/tmpfs_vnops.c
index b1a4fe20cc0..690f09b1fec 100644
--- a/sys/tmpfs/tmpfs_vnops.c
+++ b/sys/tmpfs/tmpfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmpfs_vnops.c,v 1.47 2021/10/23 17:38:00 patrick Exp $ */
+/* $OpenBSD: tmpfs_vnops.c,v 1.48 2021/10/23 17:39:08 patrick Exp $ */
/* $NetBSD: tmpfs_vnops.c,v 1.100 2012/11/05 17:27:39 dholland Exp $ */
/*
@@ -625,7 +625,7 @@ tmpfs_write(void *v)
error = 0;
while (error == 0 && uio->uio_resid > 0) {
vsize_t len;
-
+ uvm_vnp_uncache(vp);
len = MIN(node->tn_size - uio->uio_offset, uio->uio_resid);
if (len == 0) {
break;