summaryrefslogtreecommitdiff
path: root/sys/nfs
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2019-08-05 08:36:00 +0000
committeranton <anton@cvs.openbsd.org>2019-08-05 08:36:00 +0000
commit2de89e15b7def75453779ec4caaa525c42d8f6d5 (patch)
tree51666813036b139145bd44ffc7e017740fd196ae /sys/nfs
parent2e6a89f0541effeff8b1f6b09613577db20cbc5d (diff)
Allow concurrent reads of the f_offset field of struct file by
serializing both read/write operations using the existing file mutex. The vnode lock still grants exclusive write access to the offset; the mutex is only used to make the actual write atomic and prevent any concurrent reader from observing intermediate values. ok mpi@ visa@
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_kq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c
index a73847a9a2e..990f66651c0 100644
--- a/sys/nfs/nfs_kq.c
+++ b/sys/nfs/nfs_kq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_kq.c,v 1.24 2019/07/12 13:56:27 solene Exp $ */
+/* $OpenBSD: nfs_kq.c,v 1.25 2019/08/05 08:35:59 anton Exp $ */
/* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */
/*-
@@ -226,7 +226,7 @@ filt_nfsread(struct knote *kn, long hint)
return (1);
}
- kn->kn_data = np->n_size - kn->kn_fp->f_offset;
+ kn->kn_data = np->n_size - foffset(kn->kn_fp);
#ifdef DEBUG
printf("nfsread event. %lld\n", kn->kn_data);
#endif