[iscsi-initiator-utils: 109/109] clean up dead node links from discovery when reusing tpgt

Chris Leech cleech at fedoraproject.org
Tue Dec 10 21:28:28 UTC 2013


commit 5d97fd1468d5975d3127f057d76b686d4028664c
Author: Chris Leech <cleech at redhat.com>
Date:   Tue Dec 10 13:12:01 2013 -0800

    clean up dead node links from discovery when reusing tpgt

 ..._rec_write-pick-tpgt-from-existing-record.patch |   22 ++++++++++++++-----
 iscsi-initiator-utils.spec                         |    3 +-
 2 files changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/0046-idbw_rec_write-pick-tpgt-from-existing-record.patch b/0046-idbw_rec_write-pick-tpgt-from-existing-record.patch
index d2af2fb..f69cef9 100644
--- a/0046-idbw_rec_write-pick-tpgt-from-existing-record.patch
+++ b/0046-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 <cleech at redhat.com>
 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 <sys/stat.h>
  #include <sys/file.h>
  
-@@ -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)
+ {
+@@ -1884,12 +1887,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
 
diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec
index 231b7e7..ef0c707 100644
--- a/iscsi-initiator-utils.spec
+++ b/iscsi-initiator-utils.spec
@@ -297,8 +297,9 @@ fi
 %{_includedir}/libiscsi.h
 
 %changelog
-* Fri Dec 06 2013 Chris Leech <cleech at redhat.com> - 6.2.0.873-17
+* Tue Dec 10 2013 Chris Leech <cleech at redhat.com> - 6.2.0.873-17
 - fix regression in glob use, inappropriate error code escape
+- clean up dead node links from discovery when reusing tpgt
 
 * Mon Nov 25 2013 Chris Leech <cleech at redhat.com> - 6.2.0.873-16
 - fix iscsiuio socket activation


More information about the scm-commits mailing list