From owner-cvs-src-old@FreeBSD.ORG Sun May 24 12:39:48 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 0B1BA1065759 for ; Sun, 24 May 2009 12:39:48 +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 EADBD8FC08 for ; Sun, 24 May 2009 12:39:47 +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 n4OCdldd030319 for ; Sun, 24 May 2009 12:39:47 GMT (envelope-from kib@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n4OCdlCw030318 for cvs-src-old@freebsd.org; Sun, 24 May 2009 12:39:47 GMT (envelope-from kib@repoman.freebsd.org) Message-Id: <200905241239.n4OCdlCw030318@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to kib@repoman.freebsd.org using -f From: Konstantin Belousov Date: Sun, 24 May 2009 12:39:38 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD 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: Sun, 24 May 2009 12:39:48 -0000 kib 2009-05-24 12:39:38 UTC FreeBSD src repository Modified files: sys/kern kern_lockf.c sys/sys lockf.h Log: SVN rev 192685 on 2009-05-24 12:39:38Z by kib 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. Reviewed by: dfr Tested by: pho MFC after: 1 month Revision Changes Path 1.71 +15 -2 src/sys/kern/kern_lockf.c 1.24 +1 -0 src/sys/sys/lockf.h