On Sun, Jun 3, 2018 at 12:51 PM, Amit Kulkarni <amit.o...@gmail.com> wrote:
> On Sun, 3 Jun 2018 10:37:30 -0700 > Philip Guenther <guent...@gmail.com> wrote: > ... > > Index: kern/kern_rwlock.c > > =================================================================== > > RCS file: /data/src/openbsd/src/sys/kern/kern_rwlock.c,v > > retrieving revision 1.35 > > diff -u -p -r1.35 kern_rwlock.c > > --- kern/kern_rwlock.c 21 Mar 2018 12:28:39 -0000 1.35 > > +++ kern/kern_rwlock.c 3 Jun 2018 17:00:02 -0000 > > @@ -223,6 +223,8 @@ _rw_enter(struct rwlock *rwl, int flags > > lop_flags = LOP_NEWORDER; > > if (flags & RW_WRITE) > > lop_flags |= LOP_EXCLUSIVE; > > + if (flags & RW_DUPOK) > > + lop_flags |= LOP_DUPOK; > > if ((flags & RW_NOSLEEP) == 0 && (flags & RW_DOWNGRADE) == 0) > > WITNESS_CHECKORDER(&rwl->rwl_lock_obj, lop_flags, file, > line, > > NULL); > > Index: kern/vfs_subr.c > > =================================================================== > > RCS file: /data/src/openbsd/src/sys/kern/vfs_subr.c,v > > retrieving revision 1.273 > > diff -u -p -r1.273 vfs_subr.c > > --- kern/vfs_subr.c 27 May 2018 06:02:14 -0000 1.273 > > +++ kern/vfs_subr.c 3 Jun 2018 17:04:09 -0000 > > @@ -188,6 +188,11 @@ vfs_busy(struct mount *mp, int flags) > > else > > rwflags |= RW_NOSLEEP; > > > > +#ifdef WITNESS > > + if (flags & VB_DUPOK) > > + rwflags |= RW_DUPOK; > > +#endif > > + > > The other parts where you added the dup are not checking for Witness. This > part above should be for all kernels, right? Witness or non-witness. > No, the other code-generating additions, in kern_rwlock.c, are also inside #ifdef WITNESS, just outside of the context of the diff. The RW_DUPOK flag has no effect if it's not a WITNESS kernel so excluding those lines is intentional. Philip Guenther