Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jun 2011 18:53:40 +0100
From:      Gavin Atkinson <gavin@FreeBSD.org>
To:        freebsd-geom@FreeBSD.org
Cc:        mav@FreeBSD.org
Subject:   geom_raid tasting providers that can't be raw disks
Message-ID:  <1308851620.3853.34.camel@buffy.york.ac.uk>

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

Hi,

While debugging a problem that looks like it was unrelated to geom_raid,
I realised that it tastes all providers, including each partition and
slice on raid devices it itself created.

Given that geom_raid is purely a replacement for ataraid, the only place
that the metadata can be valid is on the raw disk itself.  Therefore,
I'm proposing this patch:

Index: sys/geom/raid/g_raid.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/geom/raid/g_raid.c      (revision 223446)
+++ sys/geom/raid/g_raid.c      (working copy)
@@ -1993,6 +1993,12 @@
	g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
	G_RAID_DEBUG(2, "Tasting provider %s.", pp->name);

+	if (pp->geom->rank > 1) {
+		G_RAID_DEBUG(2, "Rank of provider %s is %d, skipping.",
+		    pp->name, pp->geom->rank);
+		return (NULL);
+	}
+
	gp =3D g_new_geomf(mp, "mirror:taste");
	/*
	 * This orphan function should be never called.

This will only allow the probing to happen on providers of rank 1, i.e.
the disks themselves.  I can't see any reason to probe any other
providers.  Any objection to this?

Also, should geom_raid be in GENERIC?  ataraid was, and it's one less
"gotcha" for upgrades.  Given the lack of ar0 -> raid/r0 aliases, the
upgrade is painful enough for users already, putting it in GENERIC may
at least help slightly...

Thanks,

Gavin

--=20
Gavin Atkinson
FreeBSD committer and bugmeister
GPG: A093262B (313A A79F 697D 3A5C 216A  EDF5 935D EF44 A093 262B)



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