From owner-freebsd-current@FreeBSD.ORG Thu Oct 20 06:33:33 2005 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F94616A41F; Thu, 20 Oct 2005 06:33:33 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B7F443D64; Thu, 20 Oct 2005 06:33:32 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id A78B8516FC; Thu, 20 Oct 2005 08:33:29 +0200 (CEST) Received: from localhost (djy136.neoplus.adsl.tpnet.pl [83.24.2.136]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id A2A86516A9; Thu, 20 Oct 2005 08:33:20 +0200 (CEST) Date: Thu, 20 Oct 2005 08:33:03 +0200 From: Pawel Jakub Dawidek To: Brian Fundakowski Feldman Message-ID: <20051020063303.GA19624@garage.freebsd.pl> References: <20051016194819.GB3017@garage.freebsd.pl> <20051019221804.GA43031@green.homeunix.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: <20051019221804.GA43031@green.homeunix.org> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r535 (FreeBSD) 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.5 required=3.0 tests=BAYES_00,RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: "Bjoern A. Zeeb" , FreeBSD current mailing list Subject: Re: mount memory modified after free 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: Thu, 20 Oct 2005 06:33:33 -0000 --9amGYk9869ThD9tj Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 19, 2005 at 06:18:04PM -0400, Brian Fundakowski Feldman wrote: +> On Sun, Oct 16, 2005 at 09:48:19PM +0200, Pawel Jakub Dawidek wrote: +> > On Sat, Oct 15, 2005 at 04:00:08PM +0000, Bjoern A. Zeeb wrote: +> > +> Hi, +> > +>=20 +> > +> I had /dev/ad8s4d mounted read only to /shared and +> > +> /local/building/ports/shared, then unounted /shared and did a +> > +> mount -u -o rw /local/building/ports/shared *kaboom* +> >=20 +> > This is known problem. Multiple read-only mounts aren't safe. +>=20 +> Do you mean that multiply-mounting both read-write and read-only isn't +> safe? I don't think multiple read-only mounts are unsafe. Multiple read-only mount are in theory safe, but don't work currently. The problem was reported by ru@ some time ago I analized it and it is hard to fix. Bascially there is only one place to store mount-point's vnode in device structure (IIRC) and if you mount the same provider twice, it will be overwritten and you'll not be able to unmount first file system without panicing. The patch I came up with is here: http://people.freebsd.org/~pjd/patches/geom_vfs.c.patch but it has another problem: you can remount one of mounted file system read-write and I don't know how to stop this. As a work-around, I think something like this will work: # gnop create /dev/ad0s1a # gnop create /dev/ad0s1a.nop # mount -r /dev/ad0s1a /mnt/foo # mount -r /dev/ad0s1a.nop /mnt/foo.bar # mount -r /dev/ad0s1a.nop.nop /mnt/foo.baz (you operate on different devices here) --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --9amGYk9869ThD9tj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDVzofForvXbEpPzQRAmA9AJ4i443U1zQQwn6T1CJfz7WZu8VmMQCgo7hj Zr/Xop+/SEv85QPhNZWP0c8= =11DA -----END PGP SIGNATURE----- --9amGYk9869ThD9tj--