From 46eb122df38229dfcadadf4f5c93e62c23b3f009 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Feb 18 2014 06:48:06 +0000 Subject: clean up dead node links from discovery when reusing tpgt Resolves: #1066115 Signed-off-by: Chris Leech --- diff --git a/0146-idbw_rec_write-pick-tpgt-from-existing-record.patch b/0146-idbw_rec_write-pick-tpgt-from-existing-record.patch index d2af2fb..73966eb 100644 --- a/0146-idbw_rec_write-pick-tpgt-from-existing-record.patch +++ b/0146-idbw_rec_write-pick-tpgt-from-existing-record.patch @@ -1,4 +1,4 @@ -From cdb98072f7690cd9f5ec4aa5aa503711e552b5da Mon Sep 17 00:00:00 2001 +From ef61cd4912e90c8202598f2fa4e9f1842a5b5822 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Tue, 13 Aug 2013 12:39:07 -0700 Subject: idbw_rec_write, pick tpgt from existing record @@ -8,11 +8,11 @@ for existing new style records with tpgt before creating an old style record without. If one exists, take the tpgt from it an write an updated new style record instead. --- - usr/idbm.c | 36 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 36 insertions(+) + usr/idbm.c | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) diff --git a/usr/idbm.c b/usr/idbm.c -index cb6ffd1..5adbd95 100644 +index cb6ffd1..0410079 100644 --- a/usr/idbm.c +++ b/usr/idbm.c @@ -27,6 +27,7 @@ @@ -23,7 +23,16 @@ index cb6ffd1..5adbd95 100644 #include #include -@@ -1884,12 +1885,48 @@ static int idbm_rec_write_old(node_rec_t *rec) +@@ -162,6 +163,8 @@ static struct idbm *db; + _n++; \ + } while(0) + ++static int idbm_remove_disc_to_node_link(node_rec_t *rec, char *portal); ++ + static void + idbm_recinfo_discovery(discovery_rec_t *r, recinfo_t *ri) + { +@@ -2082,12 +2085,49 @@ static int idbm_rec_write_old(node_rec_t *rec) FILE *f; char *portal; int rc = 0; @@ -65,6 +74,7 @@ index cb6ffd1..5adbd95 100644 + if (tpgt != PORTAL_GROUP_TAG_UNKNOWN) { + log_warning("using tpgt %u from existing record", tpgt); + rec->tpgt = tpgt; ++ rc = idbm_remove_disc_to_node_link(rec, portal); + free(portal); + return idbm_rec_write_new(rec); + } @@ -73,5 +83,5 @@ index cb6ffd1..5adbd95 100644 rec->name, rec->conn[0].address, rec->conn[0].port); -- -1.8.1.4 +1.8.3.1