From owner-freebsd-current@FreeBSD.ORG Wed Oct 14 20:47:08 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 C7C12106566C for ; Wed, 14 Oct 2009 20:47:08 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id A98398FC16 for ; Wed, 14 Oct 2009 20:47:06 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 6DDD245EE6; Wed, 14 Oct 2009 22:47:04 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 35C2845E90; Wed, 14 Oct 2009 22:46:59 +0200 (CEST) Date: Wed, 14 Oct 2009 22:46:57 +0200 From: Pawel Jakub Dawidek To: Andriy Gapon Message-ID: <20091014204657.GB1727@garage.freebsd.pl> References: <4AD5BD00.4050700@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="l76fUT7nc3MelDdI" Content-Disposition: inline In-Reply-To: <4AD5BD00.4050700@icyb.net.ua> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: Alexander Best , freebsd-current@FreeBSD.org 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: Wed, 14 Oct 2009 20:47:08 -0000 --l76fUT7nc3MelDdI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 14, 2009 at 02:58:56PM +0300, Andriy Gapon wrote: > on 14/10/2009 14:21 Alexander Best said the following: > > could somebody have a look at this PR please: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/108968 > >=20 > > this still exists in -CURRENT. >=20 > This is because of serious and long-standing brokenness (probably from ti= me of > introduction of GEOM) in g_vfs_open/g_vfs_close. > The essence: > 1. we allow multiple concurrent read-only mounts of a device > 2. but even a read-only mount mangles bufobj of device vnode > 3. Bug! > Trivial fix with POLA violation - prohibit concurrent RO mounts. > Non-trivial fix - _somehow_ avoid changing or depending on device vnode b= ufobj. I've this patch that is suppose to fix it: http://people.freebsd.org/~pjd/patches/geom_vfs.c.patch But AFAIR its not complete. I think it is still possible to remount one of the read-only mounts to read-write. 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 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --l76fUT7nc3MelDdI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFK1jjBForvXbEpPzQRAit3AJ4y3sElFfuPMggRCMGKLgsWKZbt4ACbB6ZJ oI3aIbx6SYuHNjP3Nq1wLKI= =925B -----END PGP SIGNATURE----- --l76fUT7nc3MelDdI--