Module Name:    src
Committed By:   christos
Date:           Sun Mar  1 01:14:41 UTC 2015

Modified Files:
        src/sys/kern: uipc_usrreq.c

Log Message:
PR/39918: ITOH Yasufumi: Replace KASSERT with continue, since the file
descriptor can be closed since closef() does not pay attention to FDEFER.
XXX: Pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/kern/uipc_usrreq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/uipc_usrreq.c
diff -u src/sys/kern/uipc_usrreq.c:1.174 src/sys/kern/uipc_usrreq.c:1.175
--- src/sys/kern/uipc_usrreq.c:1.174	Sat Feb 28 16:42:01 2015
+++ src/sys/kern/uipc_usrreq.c	Sat Feb 28 20:14:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_usrreq.c,v 1.174 2015/02/28 21:42:01 rtr Exp $	*/
+/*	$NetBSD: uipc_usrreq.c,v 1.175 2015/03/01 01:14:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.174 2015/02/28 21:42:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.175 2015/03/01 01:14:41 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1711,7 +1711,14 @@ unp_gc(file_t *dp)
 			if ((fp->f_flag & FDEFER) != 0) {
 				atomic_and_uint(&fp->f_flag, ~FDEFER);
 				unp_defer--;
-				KASSERT(fp->f_count != 0);
+				if (fp->f_count == 0) {
+					/*
+					 * XXX: closef() doesn't pay attention
+					 * to FDEFER
+					 */
+					mutex_exit(&fp->f_lock);
+					continue;
+				}
 			} else {
 				if (fp->f_count == 0 ||
 				    (fp->f_flag & FMARK) != 0 ||

Reply via email to