6916483 panic in delfpollinfo
authorRoger A. Faulkner <Roger.Faulkner@Oracle.COM>
Fri, 30 Apr 2010 20:59:29 -0700
changeset 12290 7d1fba91d16d
parent 12289 09cf56812c71
child 12291 bccefec6707d
6916483 panic in delfpollinfo
usr/src/uts/common/os/fio.c
--- a/usr/src/uts/common/os/fio.c	Fri Apr 30 14:22:47 2010 +0800
+++ b/usr/src/uts/common/os/fio.c	Fri Apr 30 20:59:29 2010 -0700
@@ -20,8 +20,7 @@
  */
 
 /*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
@@ -1704,9 +1703,8 @@
 }
 
 /*
- * delete curthread from fpollinfo list.
+ * Delete curthread from fpollinfo list if it is there.
  */
-/*ARGSUSED*/
 void
 delfpollinfo(int fd)
 {
@@ -1716,19 +1714,15 @@
 	uf_info_t *fip = P_FINFO(curproc);
 
 	UF_ENTER(ufp, fip, fd);
-	if (ufp->uf_fpollinfo == NULL) {
-		UF_EXIT(ufp);
-		return;
+	for (fpipp = &ufp->uf_fpollinfo;
+	    (fpip = *fpipp) != NULL;
+	    fpipp = &fpip->fp_next) {
+		if (fpip->fp_thread == curthread) {
+			*fpipp = fpip->fp_next;
+			kmem_free(fpip, sizeof (fpollinfo_t));
+			break;
+		}
 	}
-	ASSERT(ufp->uf_busy);
-	/*
-	 * Find and delete curthread from the list.
-	 */
-	fpipp = &ufp->uf_fpollinfo;
-	while ((fpip = *fpipp)->fp_thread != curthread)
-		fpipp = &fpip->fp_next;
-	*fpipp = fpip->fp_next;
-	kmem_free(fpip, sizeof (fpollinfo_t));
 	/*
 	 * Assert that we are not still on the list, that is, that
 	 * this lwp did not call addfpollinfo twice for the same fd.