From owner-p4-projects@FreeBSD.ORG Sat Aug 23 14:48:53 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 84B061065675; Sat, 23 Aug 2008 14:48:53 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47D7E106566C for ; Sat, 23 Aug 2008 14:48:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3275C8FC1F for ; Sat, 23 Aug 2008 14:48:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7NEmrGR005998 for ; Sat, 23 Aug 2008 14:48:53 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7NEmrpE005996 for perforce@freebsd.org; Sat, 23 Aug 2008 14:48:53 GMT (envelope-from ed@FreeBSD.org) Date: Sat, 23 Aug 2008 14:48:53 GMT Message-Id: <200808231448.m7NEmrpE005996@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 148191 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Aug 2008 14:48:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=148191 Change 148191 by ed@ed_dull on 2008/08/23 14:48:07 Because we now properly clean up blocks in the queues, move the copy error and tty_gone() check outside the actual copying code. Do a similar thing inside ttyoutq to keep them in sync. Affected files ... .. //depot/projects/mpsafetty/sys/kern/tty_inq.c#7 edit .. //depot/projects/mpsafetty/sys/kern/tty_outq.c#8 edit Differences ... ==== //depot/projects/mpsafetty/sys/kern/tty_inq.c#7 (text+ko) ==== @@ -209,11 +209,6 @@ clen - flen, uio); tty_lock(tp); - if (tty_gone(tp)) { - /* Something went bad - discard this block. */ - uma_zfree(ttyinq_zone, tib); - return (ENXIO); - } /* Block can now be readded to the list. */ if (ti->ti_quota <= ti->ti_nblocks) { uma_zfree(ttyinq_zone, tib); @@ -221,8 +216,6 @@ TAILQ_INSERT_TAIL(&ti->ti_list, tib, tib_list); ti->ti_nblocks++; } - if (error != 0) - return (error); } else { char ob[TTYINQ_DATASIZE - 1]; atomic_add_long(&ttyinq_nslow, 1); @@ -238,12 +231,12 @@ tty_unlock(tp); error = uiomove(ob, clen - flen, uio); tty_lock(tp); + } - if (error != 0) - return (error); - if (tty_gone(tp)) - return (ENXIO); - } + if (error != 0) + return (error); + if (tty_gone(tp)) + return (ENXIO); } return (0); ==== //depot/projects/mpsafetty/sys/kern/tty_outq.c#8 (text+ko) ==== @@ -250,8 +250,6 @@ STAILQ_INSERT_TAIL(&to->to_list, tob, tob_list); to->to_nblocks++; } - if (error != 0) - return (error); } else { char ob[TTYOUTQ_DATASIZE - 1]; atomic_add_long(&ttyoutq_nslow, 1); @@ -267,10 +265,9 @@ tty_unlock(tp); error = uiomove(ob, clen, uio); tty_lock(tp); - - if (error != 0) - return (error); } + if (error != 0) + return (error); } return (0);