Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jan 2010 14:11:56 -0800
From:      Matt Reimer <mattjreimer@gmail.com>
To:        freebsd-fs <freebsd-fs@freebsd.org>, Doug Rabson <dfr@rabson.org>,  Pawel Jakub Dawidek <pjd@freebsd.org>
Subject:   Fwd: PATCH: teach (gpt)zfsboot, zfsloader to discern vdev status  correctly
Message-ID:  <f383264b1001061411i5feb09f2pdfb9e7b29bdff1c1@mail.gmail.com>
In-Reply-To: <f383264b0912141446x435c7275lca1c315a7324a4bb@mail.gmail.com>
References:  <f383264b0912141446x435c7275lca1c315a7324a4bb@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--000e0cd729021f29f6047c863ea1
Content-Type: text/plain; charset=ISO-8859-1

Would one of you be able to review this patch and commit it if it's
acceptable? This is the same patch I submitted last month.

Matt

----

Instead of assuming all vdevs are healthy, check the newest vdev label
for each vdev's status. Booting from a degraded vdev should now be
more robust.

Sponsored by: VPOP Technologies, Inc.

Matt Reimer

(Note that much of this patch is merely whitespace change due to a
block needing to be reindented. I've attached
correct-status-nowhitespace.patch to make review easier.)

--000e0cd729021f29f6047c863ea1
Content-Type: application/octet-stream; name="correct-status.patch"
Content-Disposition: attachment; filename="correct-status.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g37u1j5r0

LS0tIC9zeXMvY2RkbC9ib290L3pmcy96ZnNpbXBsLmguT1JJRwkyMDA5LTExLTIxIDA3OjAyOjM1
LjAwMDAwMDAwMCAtMDgwMAorKysgL3N5cy9jZGRsL2Jvb3QvemZzL3pmc2ltcGwuaAkyMDA5LTEy
LTA3IDEzOjUwOjI2LjAwMDAwMDAwMCAtMDgwMApAQCAtNTQ2LDcgKzU0Niw2IEBACiAjZGVmaW5l
CVpQT09MX0NPTkZJR19EVEwJCSJEVEwiCiAjZGVmaW5lCVpQT09MX0NPTkZJR19TVEFUUwkJInN0
YXRzIgogI2RlZmluZQlaUE9PTF9DT05GSUdfV0hPTEVfRElTS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2ICYmIHZkZXYtPnZfcGh5
c19yZWFkKQkvKiBIYXMgdGhpcyB2ZGV2IGFscmVhZHkgYmVlbiBpbml0ZWQ/ICovCiAJCXJldHVy
biAoRUlPKTsKLQl9CiAKIAlpZiAobnZsaXN0X2ZpbmQobnZsaXN0LAogCQkJWlBPT0xfQ09ORklH
X1ZERVZfVFJFRSwKIAkJCURBVEFfVFlQRV9OVkxJU1QsIDAsICZ2ZGV2cykpIHsKIAkJcmV0dXJu
IChFSU8pOwogCX0KLQlyYyA9IHZkZXZfaW5pdF9mcm9tX252bGlzdCh2ZGV2cywgJnRvcF92ZGV2
KTsKKworCXJjID0gdmRldl9pbml0X2Zyb21fbnZsaXN0KHZkZXZzLCAmdG9wX3ZkZXYsIGlzX25l
d2VyKTsKIAlpZiAocmMpCiAJCXJldHVybiAocmMpOwogCkBAIC04MzgsNyArODg2LDYgQEAKIAlp
ZiAodmRldikgewogCQl2ZGV2LT52X3BoeXNfcmVhZCA9IHJlYWQ7CiAJCXZkZXYtPnZfcmVhZF9w
cml2ID0gcmVhZF9wcml2OwotCQl2ZGV2LT52X3N0YXRlID0gVkRFVl9TVEFURV9IRUFMVEhZOwog
CX0gZWxzZSB7CiAJCXByaW50ZigiWkZTOiBpbmNvbnNpc3RlbnQgbnZsaXN0IGNvbnRlbnRzXG4i
KTsKIAkJcmV0dXJuIChFSU8pOwo=
--000e0cd729021f29f6047c863ea1
Content-Type: application/octet-stream; 
	name="correct-status-nowhitespace.patch"
Content-Disposition: attachment; filename="correct-status-nowhitespace.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g37u3wsw1

LS0tIHpmcy96ZnNpbXBsLmMuT1JJRwkyMDA5LTExLTIxIDE1OjAyOjM1LjAwMDAwMDAwMCArMDAw
MAorKysgemZzL3pmc2ltcGwuYwkyMDA5LTEyLTExIDEyOjI2OjM4Ljc0NTk1NDI5NyArMDAwMApA
QCAtNTEsNyArNTEsNyBAQAogc3RhdGljIGNoYXIgKnphcF9zY3J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8pOwogCX0KIAl2ZGV2ID0gdmRldl9maW5kKGd1
aWQpOwotCWlmICh2ZGV2ICYmIHZkZXYtPnZfc3RhdGUgPT0gVkRFVl9TVEFURV9IRUFMVEhZKSB7
CisJaWYgKHZkZXYgJiYgdmRldi0+dl9waHlzX3JlYWQpCS8qIEhhcyB0aGlzIHZkZXYgYWxyZWFk
eSBiZWVuIGluaXRlZD8gKi8KIAkJcmV0dXJuIChFSU8pOwotCX0KIAogCWlmIChudmxpc3RfZmlu
ZChudmxpc3QsCiAJCQlaUE9PTF9DT05GSUdfVkRFVl9UUkVFLAogCQkJREFUQV9UWVBFX05WTElT
VCwgMCwgJnZkZXZzKSkgewogCQlyZXR1cm4gKEVJTyk7CiAJfQotCXJjID0gdmRldl9pbml0X2Zy
b21fbnZsaXN0KHZkZXZzLCAmdG9wX3ZkZXYpOworCisJcmMgPSB2ZGV2X2luaXRfZnJvbV9udmxp
c3QodmRldnMsICZ0b3BfdmRldiwgaXNfbmV3ZXIpOwogCWlmIChyYykKIAkJcmV0dXJuIChyYyk7
CiAKQEAgLTgzOCw3ICs4ODYsNiBAQAogCWlmICh2ZGV2KSB7CiAJCXZkZXYtPnZfcGh5c19yZWFk
ID0gcmVhZDsKIAkJdmRldi0+dl9yZWFkX3ByaXYgPSByZWFkX3ByaXY7Ci0JCXZkZXYtPnZfc3Rh
dGUgPSBWREVWX1NUQVRFX0hFQUxUSFk7CiAJfSBlbHNlIHsKIAkJcHJpbnRmKCJaRlM6IGluY29u
c2lzdGVudCBudmxpc3QgY29udGVudHNcbiIpOwogCQlyZXR1cm4gKEVJTyk7Cg==
--000e0cd729021f29f6047c863ea1--



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