Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Oct 2005 08:33:03 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Brian Fundakowski Feldman <green@FreeBSD.org>
Cc:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>, FreeBSD current mailing list <current@FreeBSD.org>
Subject:   Re: mount memory modified after free
Message-ID:  <20051020063303.GA19624@garage.freebsd.pl>
In-Reply-To: <20051019221804.GA43031@green.homeunix.org>
References:  <Pine.BSF.4.53.0510151551460.28204@e0-0.zab2.int.zabbadoz.net> <20051016194819.GB3017@garage.freebsd.pl> <20051019221804.GA43031@green.homeunix.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051020063303.GA19624>