From 5c9eca7bccc37094611f4ef24625f372430f3890 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 17:31:49 +0000 Subject: Apply patch 0002-idmb_rec_write-check-for-tpgt-first.patch patch_name: 0002-idmb_rec_write-check-for-tpgt-first.patch present_in_specfile: true location_in_specfile: 2 --- diff --git a/usr/idbm.c b/usr/idbm.c index 42c2699..e6ede85 100644 --- a/usr/idbm.c +++ b/usr/idbm.c @@ -2178,6 +2178,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) 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 *rec, bool disable_lock) * 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)) {