From 2de89e15b7def75453779ec4caaa525c42d8f6d5 Mon Sep 17 00:00:00 2001 From: anton Date: Mon, 5 Aug 2019 08:36:00 +0000 Subject: 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@ --- sys/isofs/cd9660/cd9660_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/isofs') 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); -- cgit v1.2.3