summaryrefslogtreecommitdiff
path: root/usr/src/lib/lvm/libmeta/common
diff options
context:
space:
mode:
authorpetede <none@none>2006-10-11 09:18:43 -0700
committerpetede <none@none>2006-10-11 09:18:43 -0700
commite7931779866930790a6df2c2515b5e524056a19e (patch)
treeb414dffdb3cf7219efc98d5d90be244e2e4cb672 /usr/src/lib/lvm/libmeta/common
parentc3e7e8f0a37f8af55d7ffb99da89f7c68b7c9f8d (diff)
downloadillumos-joyent-e7931779866930790a6df2c2515b5e524056a19e.tar.gz
6474029 metaset -s diskset -t should take ownership of a cluster node after reboot
Diffstat (limited to 'usr/src/lib/lvm/libmeta/common')
-rw-r--r--usr/src/lib/lvm/libmeta/common/meta_set_tkr.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/usr/src/lib/lvm/libmeta/common/meta_set_tkr.c b/usr/src/lib/lvm/libmeta/common/meta_set_tkr.c
index 98e0329ab7..c14c8b2e8b 100644
--- a/usr/src/lib/lvm/libmeta/common/meta_set_tkr.c
+++ b/usr/src/lib/lvm/libmeta/common/meta_set_tkr.c
@@ -31,6 +31,8 @@
#include "meta_set_prv.h"
#include <sys/lvm/md_crc.h>
+#include <strings.h>
+#include <sys/bitmap.h>
extern char *blkname(char *);
@@ -517,6 +519,9 @@ meta_set_take(
int unrslv_replicated = 0;
mddrivenamelist_t *dnlp = NULL;
int retake_flag = 0;
+ unsigned long node_active[BT_BITOUL(MD_MAXSIDES)];
+
+ bzero(node_active, sizeof (unsigned long) * BT_BITOUL(MD_MAXSIDES));
if ((flags & TAKE_USETAG) || (flags & TAKE_USEIT)) {
if (flags & TAKE_USETAG) {
@@ -1004,9 +1009,17 @@ meta_set_take(
continue;
if (clnt_lock_set(sd->sd_nodes[i], sp, ep)) {
+ /*
+ * Ignore any RPC errors on a force
+ * take. The set will have been taken
+ * above and we still need to continue.
+ */
+ if (flags & TAKE_FORCE)
+ continue;
rval = -1;
goto out;
}
+ BT_SET(node_active, i);
}
rb_level = 4; /* level 4 */
@@ -1017,6 +1030,14 @@ meta_set_take(
if (sd->sd_nodes[i][0] == '\0')
continue;
+ /*
+ * Only update those nodes that
+ * are active (ie those that the
+ * set is locked on).
+ */
+ if (!BT_TEST(node_active, i))
+ continue;
+
if (clnt_upd_sr_flags(sd->sd_nodes[i],
sp, (sd->sd_flags | MD_SR_MB_DEVID), ep))
goto rollback;
@@ -1032,6 +1053,10 @@ meta_set_take(
if (strcmp(mynode(), sd->sd_nodes[i]) == 0)
continue;
+ /* no point calling dead nodes */
+ if (!BT_TEST(node_active, i))
+ continue;
+
if (clnt_unlock_set(sd->sd_nodes[i], cl_sk, &xep)) {
if (rval == 0)
(void) mdstealerror(ep, &xep);
@@ -1102,6 +1127,10 @@ out:
if (strcmp(mynode(), sd->sd_nodes[i]) == 0)
continue;
+ /* no point calling dead nodes */
+ if (!BT_TEST(node_active, i))
+ continue;
+
if (clnt_unlock_set(sd->sd_nodes[i], cl_sk, &xep)) {
if (rval == 0)
(void) mdstealerror(ep, &xep);
@@ -1131,6 +1160,10 @@ rollback:
if (sd->sd_nodes[i][0] == '\0')
continue;
+ /* no point calling dead nodes */
+ if (!BT_TEST(node_active, i))
+ continue;
+
if (clnt_upd_sr_flags(sd->sd_nodes[i], sp,
(sd->sd_flags & ~MD_SR_MB_DEVID), &xep))
mdclrerror(&xep);
@@ -1147,6 +1180,10 @@ rollback:
if (strcmp(mynode(), sd->sd_nodes[i]) == 0)
continue;
+ /* no point calling dead nodes */
+ if (!BT_TEST(node_active, i))
+ continue;
+
if (clnt_unlock_set(sd->sd_nodes[i], cl_sk, &xep))
mdclrerror(&xep);
}