summaryrefslogtreecommitdiffstats
path: root/sys/msdosfs
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/msdosfs
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/msdosfs')
-rw-r--r--sys/msdosfs/msdosfs_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index 9da3f95f632..f5e2cfd3784 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vnops.c,v 1.125 2019/07/19 00:24:31 cheloha Exp $ */
+/* $OpenBSD: msdosfs_vnops.c,v 1.126 2019/08/05 08:35:59 anton Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */
/*-
@@ -2017,7 +2017,7 @@ filt_msdosfsread(struct knote *kn, long hint)
return (1);
}
- kn->kn_data = dep->de_FileSize - kn->kn_fp->f_offset;
+ kn->kn_data = dep->de_FileSize - foffset(kn->kn_fp);
if (kn->kn_data == 0 && kn->kn_sfflags & NOTE_EOF) {
kn->kn_fflags |= NOTE_EOF;
return (1);