summaryrefslogtreecommitdiff
path: root/usr/src/lib/lvm
diff options
context:
space:
mode:
authorpetede <none@none>2006-11-24 05:40:55 -0800
committerpetede <none@none>2006-11-24 05:40:55 -0800
commit6b1acda1706fa79a5b975e20b643e546749e83d7 (patch)
tree0643120f0b6fdebe0fcd46f10eee81adfba82dba /usr/src/lib/lvm
parent4156fc34b973159b0334e05ae5ec19344487bdc0 (diff)
downloadillumos-joyent-6b1acda1706fa79a5b975e20b643e546749e83d7.tar.gz
6496941 SVM still removes the diskset if the SunCluster nodeid file is missing
Diffstat (limited to 'usr/src/lib/lvm')
-rw-r--r--usr/src/lib/lvm/libmeta/common/meta_metad_subr.c65
1 files changed, 36 insertions, 29 deletions
diff --git a/usr/src/lib/lvm/libmeta/common/meta_metad_subr.c b/usr/src/lib/lvm/libmeta/common/meta_metad_subr.c
index 1db4cae0f8..aa352a266d 100644
--- a/usr/src/lib/lvm/libmeta/common/meta_metad_subr.c
+++ b/usr/src/lib/lvm/libmeta/common/meta_metad_subr.c
@@ -338,7 +338,7 @@ static int
sr_hosts(md_set_record *sr)
{
int i,
- nid,
+ nid = 0,
self_in_set = FALSE;
md_error_t xep = mdnullerror;
md_mnnode_record *nr;
@@ -371,40 +371,47 @@ sr_hosts(md_set_record *sr)
}
if ((self_in_set == FALSE) && (!(MD_MNSET_REC(sr)))) {
- if (_cladm(CL_CONFIG, CL_NODEID, &nid) == 0) {
-
/*
- * See if we've got a node which has been booted in
- * non-cluster mode. If true the nodeid will match
- * one of the sr_nodes values because the conversion
- * from nodeid to hostname failed to occur.
+ * Under some circumstances (/etc/cluster/nodeid file is
+ * missing) it is possible for the call to _cladm() to
+ * return 0 and a nid of 0. In this instance do not remove
+ * the set as it is Sun Cluster error that needs to be fixed.
*/
- for (i = 0; i < MD_MAXSIDES; i++) {
- if (sr->sr_nodes[i][0] == 0)
- continue;
- if (atoi(sr->sr_nodes[i]) == nid)
- self_in_set = TRUE;
- }
+ if (_cladm(CL_CONFIG, CL_NODEID, &nid) == 0 && nid > 0) {
+
+ /*
+ * See if we've got a node which has been booted in
+ * non-cluster mode. If true the nodeid will match
+ * one of the sr_nodes values because the conversion
+ * from nodeid to hostname failed to occur.
+ */
+ for (i = 0; i < MD_MAXSIDES; i++) {
+ if (sr->sr_nodes[i][0] == 0)
+ continue;
+ if (atoi(sr->sr_nodes[i]) == nid)
+ self_in_set = TRUE;
+ }
- /* If we aren't in the set, delete the set */
- if (self_in_set == FALSE) {
+ /* If we aren't in the set, delete the set */
+ if (self_in_set == FALSE) {
+ syslog(LOG_ERR, dgettext(TEXT_DOMAIN,
+ "Removing set %s from database\n"),
+ sr->sr_setname);
+ s_delset(sr->sr_setname, &xep);
+ if (! mdisok(&xep))
+ mdclrerror(&xep);
+ return (1);
+ }
+ } else {
+ /*
+ * Send a message to syslog and return without
+ * deleting any sets
+ */
syslog(LOG_ERR, dgettext(TEXT_DOMAIN,
- "Removing set %s from database\n"), sr->sr_setname);
- s_delset(sr->sr_setname, &xep);
- if (! mdisok(&xep))
- mdclrerror(&xep);
+ "Call to _cladm failed for set %s nodeid %d\n"),
+ sr->sr_setname, nid);
return (1);
}
- } else {
- /*
- * Send a message to syslog and return without
- * deleting any sets
- */
- syslog(LOG_ERR, dgettext(TEXT_DOMAIN,
- "Call to _cladm failed for set %s\n"),
- sr->sr_setname);
- return (1);
- }
}
return (0);
}