1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-15 03:43:53 +02:00
openwrt-packages/net/open-iscsi/patches/0002-idmb_rec_write-check-for-tpgt-first.patch
Rosen Penev 9f217ae3f9
open-iscsi: update to 2.1.3
pass CC to configure. host CC flags can leak in the build system,
preventing compilation.

Deleted upstream backports.

Refreshed patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-12-19 21:54:58 -08:00

51 lines
1.5 KiB
Diff

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