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