From owner-cvs-src-old@FreeBSD.ORG Tue Jun 23 10:56:08 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E684B1065689 for ; Tue, 23 Jun 2009 10:56:08 +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 D37BB8FC29 for ; Tue, 23 Jun 2009 10:56:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NAu8eg081273 for ; Tue, 23 Jun 2009 10:56:08 GMT (envelope-from kib@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5NAu8uV081272 for cvs-src-old@freebsd.org; Tue, 23 Jun 2009 10:56:08 GMT (envelope-from kib@repoman.freebsd.org) Message-Id: <200906231056.n5NAu8uV081272@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to kib@repoman.freebsd.org using -f From: Konstantin Belousov Date: Tue, 23 Jun 2009 10:55:21 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/sys/kern kern_lockf.c src/sys/sys lockf.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 10:56:09 -0000 kib 2009-06-23 10:55:21 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/kern kern_lockf.c sys/sys lockf.h Log: SVN rev 194695 on 2009-06-23 10:55:21Z by kib MFC r192685: The advisory lock may be activated or activated and removed during the sleep waiting for conditions when the lock may be granted. To prevent lf_setlock() from accessing possibly freed memory, add reference counting to the struct lockf_entry. Bump refcount around the sleep. Make lf_free_lock() return non-zero when structure was freed, and use this after the sleep to return EINTR to the caller. The error code might need a clarification, but we cannot return success to usermode, since the lock is not owned anymore. Revision Changes Path 1.57.2.10 +15 -2 src/sys/kern/kern_lockf.c 1.20.2.4 +1 -0 src/sys/sys/lockf.h