summaryrefslogtreecommitdiffstats
path: root/sys/isofs
diff options
context:
space:
mode:
authoranton <anton@openbsd.org>2019-08-05 08:35:59 +0000
committeranton <anton@openbsd.org>2019-08-05 08:35:59 +0000
commit836f297b392ea9a1d38b1ff0cf70716087e44f8a (patch)
tree83dd65931d92ba9dd808f5209c217e697912c701 /sys/isofs
parentsis(4) calls mii_phy_reset(); add explicit dependency on mii_phy in config (diff)
downloadwireguard-openbsd-836f297b392ea9a1d38b1ff0cf70716087e44f8a.tar.xz
wireguard-openbsd-836f297b392ea9a1d38b1ff0cf70716087e44f8a.zip
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/isofs')
-rw-r--r--sys/isofs/cd9660/cd9660_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c
index 5a588bb1a4e..c05b3dc5941 100644
--- a/sys/isofs/cd9660/cd9660_vnops.c
+++ b/sys/isofs/cd9660/cd9660_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_vnops.c,v 1.78 2019/07/12 13:56:27 solene Exp $ */
+/* $OpenBSD: cd9660_vnops.c,v 1.79 2019/08/05 08:35:59 anton Exp $ */
/* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */
/*-
@@ -1016,7 +1016,7 @@ filt_cd9660read(struct knote *kn, long hint)
return (1);
}
- kn->kn_data = node->i_size - kn->kn_fp->f_offset;
+ kn->kn_data = node->i_size - foffset(kn->kn_fp);
if (kn->kn_data == 0 && kn->kn_sfflags & NOTE_EOF) {
kn->kn_fflags |= NOTE_EOF;
return (1);