Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jun 2003 22:00:42 +0200 (MEST)
From:      Per Kristian Hove <Per.Hove@math.ntnu.no>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        freebsd-current@freebsd.org
Subject:   Re: geom_vol_ffs problems 
Message-ID:  <Pine.GSO.4.52.0306092138020.10855@abel.math.ntnu.no>
In-Reply-To: <Pine.GSO.4.52.0306071257050.17588@abel.math.ntnu.no>
References:  <87296.1054977860@critter.freebsd.dk> <Pine.GSO.4.52.0306071257050.17588@abel.math.ntnu.no>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-959030623-1055188597=:10855
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.GSO.4.52.0306092156511.10855@abel.math.ntnu.no>

The attached patch changes the behaviour of geom_vol_ffs so that:

 - It works even if the file system doesn't fill the partition
   completely (it only checks for file system > mediasize).
 - It does not attach to providers it doesn't know how to handle.
 - It does not attach to sunlabel providers if the slice number is 2.
 - It does not attach to bsdlabel providers if the partition type
   isn't FS_BSDFFS.
 - It does not attach to providers that are attached to consumers
   of other types than "DEV".

The last check is to avoid connecting to submirrors, components of a
RAID5, one specific path of a multipathed fibre channel disk, etc.
(Hopefully, there will be a GEOM_FCAL class that implements load
sharing and fault tolerance in multipathed systems?:-) )

The big question is how to make sure geom_vol_ffs doesn't get the
chance to taste (and attach) before, say, geom_mirror does.

What do you think about this approach?


-- 
Per Kristian Hove
Dept. of Mathematical Sciences
Norwegian University of Science and Technology
---559023410-959030623-1055188597=:10855
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="geom_vol_ffs.c.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.52.0306092156370.10855@abel.math.ntnu.no>
Content-Description: 
Content-Disposition: ATTACHMENT; FILENAME="geom_vol_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m92aWRlciBi
YXNlZCBvbiB0aGF0Lg0KIAkgKi8NCkBAIC05MywxNCArMTQ1LDEyIEBADQog
CQkJY29udGludWU7DQogCQkvKiBDaGVjayBmb3IgbWFnaWMgYW5kIG1ha2Ug
c3VyZSB0aGluZ3MgYXJlIHRoZSByaWdodCBzaXplICovDQogCQlpZiAoZnMt
PmZzX21hZ2ljID09IEZTX1VGUzFfTUFHSUMpIHsNCi0JCQlpZiAoZnMtPmZz
X29sZF9zaXplICogZnMtPmZzX2ZzaXplICE9DQotCQkJICAgIChpbnQzMl90
KSBwcC0+bWVkaWFzaXplKSB7DQorCQkJaWYgKGZzLT5mc19vbGRfc2l6ZSAq
IGZzLT5mc19mc2l6ZSA+IHBwLT5tZWRpYXNpemUpIHsNCiAJCQkJZ19mcmVl
KGZzKTsNCiAJCQkJY29udGludWU7DQogCQkJfQ0KIAkJfSBlbHNlIGlmIChm
cy0+ZnNfbWFnaWMgPT0gRlNfVUZTMl9NQUdJQykgew0KLQkJCWlmIChmcy0+
ZnNfc2l6ZSAqIGZzLT5mc19mc2l6ZSAhPQ0KLQkJCSAgICAoaW50NjRfdCkg
cHAtPm1lZGlhc2l6ZSkgew0KKwkJCWlmIChmcy0+ZnNfc2l6ZSAqIGZzLT5m
c19mc2l6ZSA+IHBwLT5tZWRpYXNpemUpIHsNCiAJCQkJZ19mcmVlKGZzKTsN
CiAJCQkJY29udGludWU7DQogCQkJfQ0K

---559023410-959030623-1055188597=:10855--



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