From owner-freebsd-hackers Thu Nov 5 00:59:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA07935 for freebsd-hackers-outgoing; Thu, 5 Nov 1998 00:59:46 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com (castles186.castles.com [208.214.165.186]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA07910 for ; Thu, 5 Nov 1998 00:59:41 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (LOCALHOST [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id AAA01153; Thu, 5 Nov 1998 00:57:48 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199811050857.AAA01153@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Peter Jeremy cc: peter@netplex.com.au, hackers@FreeBSD.ORG Subject: Re: MMAP and sync writes (Re: sync writes with softupdates enabled) In-reply-to: Your message of "Wed, 04 Nov 1998 21:05:16 +1100." <98Nov4.210449est.40336@border.alcanet.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 05 Nov 1998 00:57:47 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Any followthrough on this one? Particularly, any test results? > Peter Wemm wrote: > >> Note that there is a similar bug in 2.2.x. The fix is similar, but > >> needs some thought since there appears to be a problem with the > >> parameters to vm_object_page_clean(). In particular, `syncio' is > >> defined as boolean_t, as passed as the `waitfor' argument to > >> VOP_FSYNC() - which is MNT_ASYNC or MNT_SYNC elsewhere. I haven't > >> had the time to work out the correct definitions. > > > >Use TRUE and FALSE instead of OBJPC_SYNC and 0. > > I don't think it's that simple. The following is from 2.2.7-RELEASE: > > Looking at vm_object_page_clean(), all the existing calls use TRUE or > FALSE (or 1 or 0, which is equivalent, if less clear). This matches > the definition 'boolean_t syncio'. > > Within vm_object_page_clean(), syncio is only used as: > VOP_FSYNC(vp, NULL, syncio, curproc); > > The problem is that everywhere else, VOP_FSYNC() is called with the > third parameter as one of the following: > a) MNT_WAIT or MNT_NOWAIT explicitly specified. > b) (struct vop_fsync_args).a_waitfor > c) the 2nd argument of {fstype}_sync, invoked via VFS_SYNC() and > explicitly defined as MNT_WAIT or MNT_NOWAIT in > > a_waitfor is only assigned from VOP_FSYNC() and is compared against > MNT_WAIT/MNT_NOWAIT everywhere except: > ffs_inode.c:ffs_update() > if (ap->a_waitfor && (ap->a_vp->v_mount->mnt_flag & MNT_ASYNC) == 0) > return (bwrite(bp)); > > lfs_inode.c:lfs_update() > error = (ap->a_waitfor & LFS_SYNC ? lfs_vflush(vp) : 0); > if(ap->a_waitfor & LFS_SYNC && vp->v_dirtyblkhd.lh_first != NULL) > > VFS_SYNC() is invoked with the second parameter as one of the following: > a) MNT_WAIT or MNT_NOWAIT explicitly specified. > b) 1 in lfs_vfsops.c:lfs_unmount() > > Based on the above, I believe the 4th argument to vm_object_page_clean() > should really be an int and all calls should be updated to pass > MNT_WAIT or MNT_NOWAIT. > > These discrepancies would be far more obvious if more of the kernel > magic numbers were enum's instead of #defines - the compiler would > have some hope of pointing out the inconsistencies. > > Peter > -- > Peter Jeremy (VK2PJ) peter.jeremy@alcatel.com.au > Alcatel Australia Limited > 41 Mandible St Phone: +61 2 9690 5019 > ALEXANDRIA NSW 2015 Fax: +61 2 9690 5247 > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message