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

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