From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 2 13:45:51 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A06016A420 for ; Thu, 2 Mar 2006 13:45:51 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from fw.zoral.com.ua (ll-227.216.82.212.sovam.net.ua [212.82.216.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F6EB43D45 for ; Thu, 2 Mar 2006 13:45:49 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.3/8.13.3) with ESMTP id k22Djika088371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 2 Mar 2006 15:45:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.4/8.13.4) with ESMTP id k22DjiZ0044919 for ; Thu, 2 Mar 2006 15:45:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.4/8.13.4/Submit) id k22DjhAX044918 for freebsd-hackers@freebsd.org; Thu, 2 Mar 2006 15:45:43 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 2 Mar 2006 15:45:43 +0200 From: Kostik Belousov To: freebsd-hackers@freebsd.org Message-ID: <20060302134543.GA37572@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.87.1, clamav-milter version 0.87 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on fw.zoral.com.ua Subject: vn_lock(9)' LK_UPGRADE|LK_RETRY safety X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2006 13:45:51 -0000 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Assume that thread owns LK_SHARED lock on vnode vp, and the call vn_lock(vp, LK_UPGRADE|LK_RETRY, curthread) is made. Is this upgrade safe from dropping shared lock during the retries made in vn_lock ? Man page for lockmgr says that failed LK_UPGRADE request returns with shared lock dropped. But, from the review of the code for lockmgr() and esp. acquire(), it seems that it is impossible to get error (due to absence of LK_NOWAIT and empty flags & zero timeout for msleep). Consequently, it seems that shared lock will not be dropped. Is this true ? Anyway, for instance, lookup(9) (sys/kern/vfs_lookup.c, line 552, rev. 1.88) uses such call and does not check for errors.=20 Best regards, Kostik Belousov --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (FreeBSD) iD8DBQFEBvcGC3+MBN1Mb4gRAm7GAJ4taL/MejA2sfrng78wYl7tdbA2ZgCfSiDU HDfIKVAQVC1qDzEXQnRg/v8= =Wr8J -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--