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

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