From owner-freebsd-hackers Mon Mar 3 21:50:46 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA26070 for hackers-outgoing; Mon, 3 Mar 1997 21:50:46 -0800 (PST) Received: from sumatra.americantv.com (sumatra.americantv.com [199.184.181.250]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA26063 for ; Mon, 3 Mar 1997 21:50:42 -0800 (PST) Received: from right.PCS (right.pcs. [148.105.10.31]) by sumatra.americantv.com (8.7.6/8.7.3) with ESMTP id AAA07235; Tue, 4 Mar 1997 00:25:33 -0600 (CST) Received: (jlemon@localhost) by right.PCS (8.6.13/8.6.4) id FAA20756; Tue, 4 Mar 1997 05:50:58 GMT Message-ID: <19970303235057.26399@right.PCS> Date: Mon, 3 Mar 1997 23:50:57 -0600 From: Jonathan Lemon To: Michael Smith Cc: proff@iq.org, hackers@FreeBSD.ORG Subject: Re: xemacs crashes kernel References: <19970303230157.25741@right.PCS> <199703040532.QAA10831@genesis.atrad.adelaide.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61.1 In-Reply-To: <199703040532.QAA10831@genesis.atrad.adelaide.edu.au>; from Michael Smith on Mar 03, 1997 at 04:02:00PM +1030 Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Mar 03, 1997 at 04:02:00PM +1030, Michael Smith wrote: > error = VOP_FSYNC(vp, fp->f_cred, > (vp->v_mount->mnt_flag & MNT_ASYNC) ? MNT_NOWAIT : MNT_WAIT, p); > > MNT_ASYNC is 0x40, and mnt_flag looks to be about 0x18 offset in the > mount structure. Looks like maybe someone trying to fsync something > that's not a file, although a quick test here doesn't indicate that. > > Are non-file items supposed to have valid v_mount pointers? Other places > in the kernel that look at vp->v_mount often check it against zero first; > should that be done here, eg. > > (vp->v_mount && (vp->v_mount->mnt_flag & MNT_ASYNC)) ? MNT_NOWAIT... > > as well? This looks like it might have been overlooked when the async > filesystem stuff came in, as old versions of this code read : > > error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, p); > > Suggestions? Jonathan, can you try the above and see if it cures your > problem? I changed the fsync code to read: error = VOP_FSYNC(vp, fp->f_cred, (vp->v_mount && (vp->v_mount->mnt_flag & MNT_ASYNC)) ? MNT_NOWAIT : MNT_WAIT, p); And it doesn't crash the kernel any more. I'm not sure if this is the right fix or not. Julian - you might want to try this as well. (btw, mail to @iq.com bounces from here. :-( ) -- Jonathan