From owner-svn-src-all@FreeBSD.ORG Thu Jun 27 19:14:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3766BA5B; Thu, 27 Jun 2013 19:14:04 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 29BDE1A17; Thu, 27 Jun 2013 19:14:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5RJE4aY047808; Thu, 27 Jun 2013 19:14:04 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5RJE4on047806; Thu, 27 Jun 2013 19:14:04 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201306271914.r5RJE4on047806@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 27 Jun 2013 19:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252313 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2013 19:14:04 -0000 Author: trociny Date: Thu Jun 27 19:14:03 2013 New Revision: 252313 URL: http://svnweb.freebsd.org/changeset/base/252313 Log: To avoid LOR, always drop the filedesc lock before exporting fd to sbuf. Reviewed by: kib MFC after: 3 days Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Jun 27 18:59:07 2013 (r252312) +++ head/sys/kern/kern_descrip.c Thu Jun 27 19:14:03 2013 (r252313) @@ -3427,12 +3427,10 @@ kern_proc_filedesc_out(struct proc *p, * re-validate and re-evaluate its properties when * the loop continues. */ - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SUNLOCK(fdp); + FILEDESC_SUNLOCK(fdp); error = export_fd_to_sb(data, type, i, fflags, refcnt, offset, fd_cap_rights, kif, sb, &remainder); - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SLOCK(fdp); + FILEDESC_SLOCK(fdp); if (error) break; }