Blame SOURCES/0002-idmb_rec_write-check-for-tpgt-first.patch

a02209
From 45878c9461298c9da68a626d990dc4ef99e01baa Mon Sep 17 00:00:00 2001
a02209
From: Chris Leech <cleech@redhat.com>
a02209
Date: Tue, 13 Aug 2013 10:59:44 -0700
a02209
Subject: [PATCH] idmb_rec_write, check for tpgt first
a02209
a02209
Factor out the check for a tpgt to a single place, before going crazy on
a02209
the rec files.  Makes flow of this function easier to follow, and preps
a02209
for splitting it up.
a02209
---
a02209
 usr/idbm.c | 18 +++++-------------
a02209
 1 file changed, 5 insertions(+), 13 deletions(-)
a02209
a02209
diff --git a/usr/idbm.c b/usr/idbm.c
a02209
index 42c2699..e6ede85 100644
a02209
--- a/usr/idbm.c
a02209
+++ b/usr/idbm.c
a02209
@@ -2178,6 +2178,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock)
a02209
 			goto free_portal;
a02209
 	}
a02209
 
a02209
+	if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
a02209
+		/* drop down to old style portal as config */
a02209
+		goto open_conf;
a02209
+
a02209
 	rc = stat(portal, &statb);
a02209
 	if (rc) {
a02209
 		rc = 0;
a02209
@@ -2186,22 +2190,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock)
a02209
 		 * set the tgpt. In new versions you must pass all the info in
a02209
 		 * from the start
a02209
 		 */
a02209
-		if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
a02209
-			/* drop down to old style portal as config */
a02209
-			goto open_conf;
a02209
-		else
a02209
-			goto mkdir_portal;
a02209
+		goto mkdir_portal;
a02209
 	}
a02209
 
a02209
 	if (!S_ISDIR(statb.st_mode)) {
a02209
-		/*
a02209
-		 * older iscsiadm versions had you create the config then set
a02209
-		 * set the tgpt. In new versions you must pass all the info in
a02209
-		 * from the start
a02209
-		 */
a02209
-		if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
a02209
-			/* drop down to old style portal as config */
a02209
-			goto open_conf;
a02209
 		/*
a02209
 		 * Old style portal as a file, but with tpgt. Let's update it.
a02209
 		 */
a02209
-- 
a02209
2.26.2
a02209