Return to BSD News archive
Xref: sserve comp.bugs.4bsd:1941 comp.os.386bsd.bugs:547 Path: sserve!newshost.anu.edu.au!munnari.oz.au!hp9000.csc.cuhk.hk!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!europa.eng.gtefsd.com!emory!ogicse!netnews.nwnet.net!news.u.washington.edu!ns1.nodak.edu!plains.NoDak.edu!tinguely From: tinguely@plains.NoDak.edu (Mark Tinguely) Newsgroups: comp.bugs.4bsd,comp.os.386bsd.bugs Subject: Re: flock broken - I could use some help Message-ID: <C5yDEn.JCt@ns1.nodak.edu> Date: 23 Apr 93 20:11:11 GMT Article-I.D.: ns1.C5yDEn.JCt References: <C5t8wH.Hs@moxie.hou.tx.us> <1993Apr21.184636.1121@cs.few.eur.nl> Sender: usenet@ns1.nodak.edu (Usenet login) Organization: North Dakota State University Lines: 37 Nntp-Posting-Host: plains.nodak.edu In article <1993Apr21.184636.1121@cs.few.eur.nl> pk@cs.few.eur.nl writes: >------- ufs_lockf.c ------- >*** /tmp/da16367 Wed Apr 21 20:36:22 1993 >--- ufs/ufs_lockf.c Wed Apr 21 20:35:47 1993 >*************** >*** 155,160 **** >--- 155,174 ---- I think the lock wakeup routines clean the block structures out. I think the problem was a close() and the master's unlock cause a race and a double release. I wanted to make sure only one release (based on the ip->i_lockf), but all of this gets done in lf_clearlock(), so I used that. I could not cause my machine to panic again after installing this change. I sent it also to Greg Hackney to test before releasing it. -------------- *** /sys/ufs/ufs_lockf.c.orig Fri Apr 23 14:02:27 1993 --- /sys/ufs/ufs_lockf.c Fri Apr 23 14:35:36 1993 *************** *** 155,161 **** } #endif /* LOCKF_DEBUG */ if (error = tsleep((caddr_t)lock, priority, lockstr, 0)) { ! free(lock, M_LOCKF); return (error); } } --- 155,162 ---- } #endif /* LOCKF_DEBUG */ if (error = tsleep((caddr_t)lock, priority, lockstr, 0)) { ! /* free(lock, M_LOCKF); */ ! (void) lf_clearlock(lock); return (error); } }