DragonFly BSD
DragonFly bugs List (threaded) for 2006-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: spinlock crash


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 30 Aug 2006 17:21:32 -0700 (PDT)

:Received a panic today from -HEAD from sources dated August 16th.
:kernel and core (.12) is being uploaded to leaf.  Should take another 2
:hours or so before the core uploads.
:
:--Peter

    Got it.  It looks like a self-deadlock during the scan.  I think the
    bug is in unp_mark(), it is returning early without unlocking the
    spinlock.

    Try this patch.

						-Matt

Index: kern/uipc_usrreq.c
===================================================================
RCS file: /cvs/src/sys/kern/uipc_usrreq.c,v
retrieving revision 1.27
diff -u -r1.27 uipc_usrreq.c
--- kern/uipc_usrreq.c	12 Aug 2006 00:26:20 -0000	1.27
+++ kern/uipc_usrreq.c	31 Aug 2006 00:18:27 -0000
@@ -1380,10 +1380,10 @@
 
 	if (info->locked_fp != fp)
 		spin_lock_wr(&fp->f_spin);
-	if (fp->f_flag & FMARK)
-		return;
-	++info->defer;
-	fp->f_flag |= (FMARK|FDEFER);
+	if ((fp->f_flag & FMARK) == 0) {
+		++info->defer;
+		fp->f_flag |= (FMARK|FDEFER);
+	}
 	if (info->locked_fp != fp)
 		spin_unlock_wr(&fp->f_spin);
 }



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]