From owner-cvs-src@FreeBSD.ORG Mon Dec 24 13:47:17 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1778A16A468; Mon, 24 Dec 2007 13:47:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id EC5B513C45A; Mon, 24 Dec 2007 13:47:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBODlGbh016926; Mon, 24 Dec 2007 13:47:16 GMT (envelope-from kib@repoman.freebsd.org) Received: (from kib@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBODlGWh016925; Mon, 24 Dec 2007 13:47:16 GMT (envelope-from kib) Message-Id: <200712241347.lBODlGWh016925@repoman.freebsd.org> From: Konstantin Belousov Date: Mon, 24 Dec 2007 13:47:16 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/snp snp.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2007 13:47:17 -0000 kib 2007-12-24 13:47:16 UTC FreeBSD src repository Modified files: sys/dev/snp snp.c Log: Move the check for the snp device being already attached after the fget() call, that is sleeping point, and possibly dropping Giant. The snp_target == NULL implies the snp_tty == NULL. Remove the code that is put under snp_target == NULL and snp_tty != NULL clause. In snpclose(), do the snp_detach() before scheduling the snp device destruction. Otherwise, after the return from snpclose(), the snp device is already removed from the snp_list, but tty is still in snooped state. Any attempt to do i/o on such tty cause panic because ttytosnp() returns NULL. Tested by: Peter Holm MFC after: 1 week Revision Changes Path 1.107 +6 -11 src/sys/dev/snp/snp.c