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

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