From owner-freebsd-current@FreeBSD.ORG Fri Oct 16 08:38:41 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1FBD106566B; Fri, 16 Oct 2009 08:38:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 467F68FC18; Fri, 16 Oct 2009 08:38:40 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n9G8c8ZS037672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Oct 2009 11:38:08 +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.3/8.14.3) with ESMTP id n9G8c8YU018385; Fri, 16 Oct 2009 11:38:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n9G8c8Vd018378; Fri, 16 Oct 2009 11:38:08 +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: Fri, 16 Oct 2009 11:38:08 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20091016083808.GO27077@deviant.kiev.zoral.com.ua> References: <4AD5BD00.4050700@icyb.net.ua> <20091014204657.GB1727@garage.freebsd.pl> <4AD82F80.2050302@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+wSiqF7c0ySQ2tNi" Content-Disposition: inline In-Reply-To: <4AD82F80.2050302@icyb.net.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at 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.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Alexander Best , freebsd-current@freebsd.org, Pawel Jakub Dawidek Subject: Re: panic when mounting device >= 2 times X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2009 08:38:42 -0000 --+wSiqF7c0ySQ2tNi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 16, 2009 at 11:32:00AM +0300, Andriy Gapon wrote: > on 14/10/2009 23:46 Pawel Jakub Dawidek said the following: > > I've this patch that is suppose to fix it: > >=20 > > http://people.freebsd.org/~pjd/patches/geom_vfs.c.patch > >=20 > > But AFAIR its not complete. I think it is still possible to remount one > > of the read-only mounts to read-write. > >=20 > > Another possibility that comes to my mind is to keep list/array of > > consumers in bo_private instead of using one consumer only. This would > > be better in terms of access management. >=20 > This looks very good for at least preventing the most common accidents. > I've been thinking about something like creating a cloned vnode for the d= evice > vnode and giving a private copy to each filesystem. But I currently lack = a lot > knowledge in this area, so I can't even say if it could be feasible, let = alone > implement it. I suspect this is pretty much bad idea. The reason is that buffer list is managed by buffer object that has 1:1 correspondence with the vnode. You will end up with aliased buffers. Actually, this could happen without the proposed change as well, I believe. It is enough to mount devfs several times and then use different devfs vnodes for the same device. But since people usually mount filesystems using /dev, this does not happen in practice. For multiple ro mounts to work, we need to find a way to push the buffer object to cdev. --+wSiqF7c0ySQ2tNi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrYMPAACgkQC3+MBN1Mb4j9pACdFiiomSB6/hKkk81VuQ1ELERr Qz8AnAt3rNHt2F/URcnAsR9hO0+bIijn =oyl6 -----END PGP SIGNATURE----- --+wSiqF7c0ySQ2tNi--