From owner-freebsd-fs@FreeBSD.ORG Sat Apr 26 10:01:32 2008 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEEC1106564A for ; Sat, 26 Apr 2008 10:01:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay01.kiev.sovam.com (relay01.kiev.sovam.com [62.64.120.200]) by mx1.freebsd.org (Postfix) with ESMTP id 812928FC1D for ; Sat, 26 Apr 2008 10:01:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay01.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JphDl-000Pd6-G6; Sat, 26 Apr 2008 13:01:30 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3QA1NTm063952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 Apr 2008 13:01:23 +0300 (EEST) (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.14.2/8.14.2) with ESMTP id m3QA1I5I024826; Sat, 26 Apr 2008 13:01:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m3QA1Gid024825; Sat, 26 Apr 2008 13:01:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Apr 2008 13:01:16 +0300 From: Kostik Belousov To: Daichi GOTO Message-ID: <20080426100116.GL18958@deviant.kiev.zoral.com.ua> References: <4811B0A0.8040702@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1ybh4W+c0/0dBCW4" Content-Disposition: inline In-Reply-To: <4811B0A0.8040702@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 565941832c2f675ae953af64aa3a5396 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2724 [Apr 25 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: fs@freebsd.org Subject: Re: Approval request of some additions to src/sys/kern/vfs_subr.c and src/sys/sys/vnode.h X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 10:01:32 -0000 --1ybh4W+c0/0dBCW4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2008 at 07:21:20PM +0900, Daichi GOTO wrote: > Hi Konstantin :) >=20 > To fix a unionfs issue of http://www.freebsd.org/cgi/query-pr.cgi?pr=3D10= 9377, > we need to add new functions >=20 > void vkernrele(struct vnode *vp); > void vkernref(struct vnode *vp); >=20 > and one value >=20 > int v_kernusecount; /* i ref count of kernel */ >=20 > to src/sys/sys/vnode.h and rc/sys/kern/vfs_subr.c. >=20 > Unionfs will be panic when lower fs layer is forced umounted by > "umount -f". So to avoid this issue, we've added > "v_kernusecount" value that means "a vnode count that kernel are > using". vkernrele() and vkernref() are functions that manage > "v_kernusecount" value. >=20 > Please check those and give us an approve or some comments! There is already the vnode reference count. From your description, I cannot understand how the kernusecount would prevent the panic when forced unmount is performed. Could you, please, show the actual code ? PR mentioned does not contain any patch. The problem you described is common for the kernel code, and right way to handle it, for now, is to keep refcount _and_ check for the forced reclaim. --1ybh4W+c0/0dBCW4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkgS/WwACgkQC3+MBN1Mb4jEigCg6aLQtsufutJxtrBMQKGe9F+F DvIAnRrdIz0B1f9Tx8kWxDAV6zXubt9N =Rrhi -----END PGP SIGNATURE----- --1ybh4W+c0/0dBCW4--