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

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