Blame SOURCES/0001-rec-update-disable-the-idbm_lock-in-read-write-when-.patch

e88930
From c64a92e32187d24dda44d983809f36e20d9cb92f Mon Sep 17 00:00:00 2001
e88930
From: Xiubo Li <xiubli@redhat.com>
e88930
Date: Tue, 18 Jun 2019 10:12:31 +0800
e88930
Subject: [PATCH 1/1] rec update: disable the idbm_lock in read/write when
e88930
 updating the rec
e88930
e88930
The iscsiadm is getting a file lock while writing out records, and
e88930
updates are a read-modify-write operation and currently only the
e88930
write is locked.
e88930
e88930
So the parallel requests are reading in the pre-update record and
e88930
then overwriting each other with the writes.
e88930
e88930
Fixing RHBZ#1624670
e88930
e88930
Signed-off-by: Xiubo Li <xiubli@redhat.com>
e88930
---
e88930
 usr/idbm.c     | 132 +++++++++++++++++++++++++++++++------------------
e88930
 usr/idbm.h     |  17 ++++---
e88930
 usr/iface.c    |   2 +-
e88930
 usr/iscsiadm.c |  18 +++----
e88930
 usr/iscsid.c   |   2 +-
e88930
 5 files changed, 105 insertions(+), 66 deletions(-)
e88930
e88930
diff --git a/usr/idbm.c b/usr/idbm.c
e88930
index c238cc7..ca2557f 100644
e88930
--- a/usr/idbm.c
e88930
+++ b/usr/idbm.c
e88930
@@ -1401,7 +1401,12 @@ static FILE *idbm_open_rec_r(char *portal, char *config)
e88930
 	return fopen(portal, "r");
e88930
 }
e88930
 
e88930
-static int __idbm_rec_read(node_rec_t *out_rec, char *conf)
e88930
+/*
e88930
+ * When the disable_lock param is true, the idbm_lock/idbm_unlock needs
e88930
+ * to be holt by the caller, this will avoid overwriting each other in
e88930
+ * case of updating(read-modify-write) the recs in parallel.
e88930
+ */
e88930
+static int __idbm_rec_read(node_rec_t *out_rec, char *conf, bool disable_lock)
e88930
 {
e88930
 	recinfo_t *info;
e88930
 	FILE *f;
e88930
@@ -1411,9 +1416,11 @@ static int __idbm_rec_read(node_rec_t *out_rec, char *conf)
e88930
 	if (!info)
e88930
 		return ISCSI_ERR_NOMEM;
e88930
 
e88930
-	rc = idbm_lock();
e88930
-	if (rc)
e88930
-		goto free_info;
e88930
+	if (!disable_lock) {
e88930
+		rc = idbm_lock();
e88930
+		if (rc)
e88930
+			goto free_info;
e88930
+	}
e88930
 
e88930
 	f = fopen(conf, "r");
e88930
 	if (!f) {
e88930
@@ -1430,15 +1437,21 @@ static int __idbm_rec_read(node_rec_t *out_rec, char *conf)
e88930
 	fclose(f);
e88930
 
e88930
 unlock:
e88930
-	idbm_unlock();
e88930
+	if (!disable_lock)
e88930
+		idbm_unlock();
e88930
 free_info:
e88930
 	free(info);
e88930
 	return rc;
e88930
 }
e88930
 
e88930
+/*
e88930
+ * When the disable_lock param is true, the idbm_lock/idbm_unlock needs
e88930
+ * to be holt by the caller, this will avoid overwriting each other in
e88930
+ * case of updating(read-modify-write) the recs in parallel.
e88930
+ */
e88930
 int
e88930
 idbm_rec_read(node_rec_t *out_rec, char *targetname, int tpgt,
e88930
-	      char *ip, int port, struct iface_rec *iface)
e88930
+	      char *ip, int port, struct iface_rec *iface, bool disable_lock)
e88930
 {
e88930
 	struct stat statb;
e88930
 	char *portal;
e88930
@@ -1470,7 +1483,7 @@ idbm_rec_read(node_rec_t *out_rec, char *targetname, int tpgt,
e88930
 	}
e88930
 
e88930
 read:
e88930
-	rc = __idbm_rec_read(out_rec, portal);
e88930
+	rc = __idbm_rec_read(out_rec, portal, disable_lock);
e88930
 free_portal:
e88930
 	free(portal);
e88930
 	return rc;
e88930
@@ -1526,7 +1539,7 @@ static int idbm_print_discovered(discovery_rec_t *drec, int info_level)
e88930
 	int num_found = 0;
e88930
 
e88930
 	if (info_level < 1)
e88930
-		idbm_for_each_rec(&num_found, drec, print_discovered_flat);
e88930
+		idbm_for_each_rec(&num_found, drec, print_discovered_flat, false);
e88930
 	else {
e88930
 		struct discovered_tree_info tree_info;
e88930
 		struct node_rec last_rec;
e88930
@@ -1536,7 +1549,7 @@ static int idbm_print_discovered(discovery_rec_t *drec, int info_level)
e88930
 		tree_info.drec = drec;
e88930
 		tree_info.last_rec = &last_rec;
e88930
 
e88930
-		idbm_for_each_rec(&num_found, &tree_info,							  print_discovered_tree);
e88930
+		idbm_for_each_rec(&num_found, &tree_info, print_discovered_tree, false);
e88930
 	}
e88930
 	return num_found;
e88930
 }
e88930
@@ -1708,9 +1721,9 @@ int idbm_print_all_discovery(int info_level)
e88930
  * fn should return -1 if it skipped the rec, an ISCSI_ERR error code if
e88930
  * the operation failed or 0 if fn was run successfully.
e88930
  */
e88930
-static int idbm_for_each_iface(int *found, void *data,
e88930
-				idbm_iface_op_fn *fn,
e88930
-				char *targetname, int tpgt, char *ip, int port)
e88930
+static int idbm_for_each_iface(int *found, void *data, idbm_iface_op_fn *fn,
e88930
+			       char *targetname, int tpgt, char *ip, int port,
e88930
+			       bool ruw_lock)
e88930
 {
e88930
 	DIR *iface_dirfd;
e88930
 	struct dirent *iface_dent;
e88930
@@ -1735,7 +1748,7 @@ static int idbm_for_each_iface(int *found, void *data,
e88930
 		goto free_portal;
e88930
 	}
e88930
 
e88930
-	rc = __idbm_rec_read(&rec, portal);
e88930
+	rc = __idbm_rec_read(&rec, portal, ruw_lock);
e88930
 	if (rc)
e88930
 		goto free_portal;
e88930
 
e88930
@@ -1768,7 +1781,7 @@ read_iface:
e88930
 		memset(portal, 0, PATH_MAX);
e88930
 		snprintf(portal, PATH_MAX, "%s/%s/%s,%d,%d/%s", NODE_CONFIG_DIR,
e88930
 			 targetname, ip, port, tpgt, iface_dent->d_name);
e88930
-		if (__idbm_rec_read(&rec, portal))
e88930
+		if (__idbm_rec_read(&rec, portal, ruw_lock))
e88930
 			continue;
e88930
 
e88930
 		curr_rc = fn(data, &rec);
e88930
@@ -1790,7 +1803,7 @@ free_portal:
e88930
  * The portal could be a file or dir with interfaces
e88930
  */
e88930
 int idbm_for_each_portal(int *found, void *data, idbm_portal_op_fn *fn,
e88930
-			 char *targetname)
e88930
+			 char *targetname, bool ruw_lock)
e88930
 {
e88930
 	DIR *portal_dirfd;
e88930
 	struct dirent *portal_dent;
e88930
@@ -1827,7 +1840,8 @@ int idbm_for_each_portal(int *found, void *data, idbm_portal_op_fn *fn,
e88930
 
e88930
 		curr_rc = fn(found, data, targetname,
e88930
 			tmp_tpgt ? atoi(tmp_tpgt) : -1,
e88930
-			portal_dent->d_name, atoi(tmp_port));
e88930
+			portal_dent->d_name, atoi(tmp_port),
e88930
+			ruw_lock);
e88930
 		/* less than zero means it was not a match */
e88930
 		if (curr_rc > 0 && !rc)
e88930
 			rc = curr_rc;
e88930
@@ -1838,7 +1852,7 @@ done:
e88930
 	return rc;
e88930
 }
e88930
 
e88930
-int idbm_for_each_node(int *found, void *data, idbm_node_op_fn *fn)
e88930
+int idbm_for_each_node(int *found, void *data, idbm_node_op_fn *fn, bool ruw_lock)
e88930
 {
e88930
 	DIR *node_dirfd;
e88930
 	struct dirent *node_dent;
e88930
@@ -1859,7 +1873,7 @@ int idbm_for_each_node(int *found, void *data, idbm_node_op_fn *fn)
e88930
 			continue;
e88930
 
e88930
 		log_debug(5, "searching %s", node_dent->d_name);
e88930
-		curr_rc = fn(found, data, node_dent->d_name);
e88930
+		curr_rc = fn(found, data, node_dent->d_name, ruw_lock);
e88930
 		/* less than zero means it was not a match */
e88930
 		if (curr_rc > 0 && !rc)
e88930
 			rc = curr_rc;
e88930
@@ -1877,18 +1891,30 @@ static int iface_fn(void *data, node_rec_t *rec)
e88930
 }
e88930
 
e88930
 static int portal_fn(int *found, void *data, char *targetname,
e88930
-		     int tpgt, char *ip, int port)
e88930
+		     int tpgt, char *ip, int port, bool ruw_lock)
e88930
 {
e88930
-	return idbm_for_each_iface(found, data, iface_fn, targetname,
e88930
-				   tpgt, ip, port);
e88930
+	int rc;
e88930
+
e88930
+	if (ruw_lock) {
e88930
+		rc = idbm_lock();
e88930
+		if (rc)
e88930
+			return rc;
e88930
+	}
e88930
+
e88930
+	rc = idbm_for_each_iface(found, data, iface_fn, targetname,
e88930
+			         tpgt, ip, port, ruw_lock);
e88930
+	if (ruw_lock)
e88930
+		idbm_unlock();
e88930
+
e88930
+	return rc;
e88930
 }
e88930
 
e88930
-static int node_fn(int *found, void *data, char *targetname)
e88930
+static int node_fn(int *found, void *data, char *targetname, bool ruw_lock)
e88930
 {
e88930
-	return idbm_for_each_portal(found, data, portal_fn, targetname);
e88930
+	return idbm_for_each_portal(found, data, portal_fn, targetname, ruw_lock);
e88930
 }
e88930
 
e88930
-int idbm_for_each_rec(int *found, void *data, idbm_iface_op_fn *fn)
e88930
+int idbm_for_each_rec(int *found, void *data, idbm_iface_op_fn *fn, bool ruw_lock)
e88930
 {
e88930
 	struct rec_op_data op_data;
e88930
 
e88930
@@ -1896,7 +1922,7 @@ int idbm_for_each_rec(int *found, void *data, idbm_iface_op_fn *fn)
e88930
 	op_data.data = data;
e88930
 	op_data.fn = fn;
e88930
 
e88930
-	return idbm_for_each_node(found, &op_data, node_fn);
e88930
+	return idbm_for_each_node(found, &op_data, node_fn, ruw_lock);
e88930
 }
e88930
 
e88930
 static struct {
e88930
@@ -2141,7 +2167,12 @@ free_portal:
e88930
 	return rc;
e88930
 }
e88930
 
e88930
-static int idbm_rec_write(node_rec_t *rec)
e88930
+/*
e88930
+ * When the disable_lock param is true, the idbm_lock/idbm_unlock needs
e88930
+ * to be holt by the caller, this will avoid overwriting each other in
e88930
+ * case of updating(read-modify-write) the recs in parallel.
e88930
+ */
e88930
+static int idbm_rec_write(node_rec_t *rec, bool disable_lock)
e88930
 {
e88930
 	char *portal;
e88930
 	int rc = 0;
e88930
@@ -2172,9 +2203,11 @@ static int idbm_rec_write(node_rec_t *rec)
e88930
 		}
e88930
 	}
e88930
 
e88930
-	rc = idbm_lock();
e88930
-	if (rc)
e88930
-		goto free_portal;
e88930
+	if (!disable_lock) {
e88930
+		rc = idbm_lock();
e88930
+		if (rc)
e88930
+			goto free_portal;
e88930
+	}
e88930
 
e88930
 	if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
e88930
 		/* old style portal as config */
e88930
@@ -2182,7 +2215,8 @@ static int idbm_rec_write(node_rec_t *rec)
e88930
 	else
e88930
 		rc = idbm_rec_write_new(rec);
e88930
 
e88930
-	idbm_unlock();
e88930
+	if (!disable_lock)
e88930
+		idbm_unlock();
e88930
 free_portal:
e88930
 	free(portal);
e88930
 	return rc;
e88930
@@ -2357,18 +2391,24 @@ static int setup_disc_to_node_link(char *disc_portal, node_rec_t *rec)
e88930
 int idbm_add_node(node_rec_t *newrec, discovery_rec_t *drec, int overwrite)
e88930
 {
e88930
 	node_rec_t rec;
e88930
-	char *node_portal, *disc_portal;
e88930
+	char *node_portal = NULL, *disc_portal;
e88930
 	int rc;
e88930
 
e88930
+	rc = idbm_lock();
e88930
+	if (rc)
e88930
+		return rc;
e88930
+
e88930
 	if (!idbm_rec_read(&rec, newrec->name, newrec->tpgt,
e88930
 			   newrec->conn[0].address, newrec->conn[0].port,
e88930
-			   &newrec->iface)) {
e88930
-		if (!overwrite)
e88930
-			return 0;
e88930
+			   &newrec->iface, true)) {
e88930
+		if (!overwrite) {
e88930
+			rc = 0;
e88930
+			goto unlock;
e88930
+		}
e88930
 
e88930
 		rc = idbm_delete_node(&rec);
e88930
 		if (rc)
e88930
-			return rc;
e88930
+			goto unlock;
e88930
 		log_debug(7, "overwriting existing record");
e88930
 	} else
e88930
 		log_debug(7, "adding new DB record");
e88930
@@ -2379,17 +2419,19 @@ int idbm_add_node(node_rec_t *newrec, discovery_rec_t *drec, int overwrite)
e88930
 		strcpy(newrec->disc_address, drec->address);
e88930
 	}
e88930
 
e88930
-	rc = idbm_rec_write(newrec);
e88930
+	rc = idbm_rec_write(newrec, true);
e88930
 	/*
e88930
 	 * if a old app passed in a bogus tpgt then we do not create links
e88930
 	 * since it will set a different tpgt in another iscsiadm call
e88930
 	 */
e88930
 	if (rc || !drec || newrec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
e88930
-		return rc;
e88930
+		goto unlock;
e88930
 
e88930
 	node_portal = calloc(2, PATH_MAX);
e88930
-	if (!node_portal)
e88930
-		return ISCSI_ERR_NOMEM;
e88930
+	if (!node_portal) {
e88930
+		rc = ISCSI_ERR_NOMEM;
e88930
+		goto unlock;
e88930
+	}
e88930
 
e88930
 	disc_portal = node_portal + PATH_MAX;
e88930
 	snprintf(node_portal, PATH_MAX, "%s/%s/%s,%d,%d", NODE_CONFIG_DIR,
e88930
@@ -2397,15 +2439,11 @@ int idbm_add_node(node_rec_t *newrec, discovery_rec_t *drec, int overwrite)
e88930
 		 newrec->tpgt);
e88930
 	rc = setup_disc_to_node_link(disc_portal, newrec);
e88930
 	if (rc)
e88930
-		goto free_portal;
e88930
+		goto unlock;
e88930
 
e88930
 	log_debug(7, "node addition making link from %s to %s", node_portal,
e88930
 		 disc_portal);
e88930
 
e88930
-	rc = idbm_lock();
e88930
-	if (rc)
e88930
-		goto free_portal;
e88930
-
e88930
 	if (symlink(node_portal, disc_portal)) {
e88930
 		if (errno == EEXIST)
e88930
 			log_debug(7, "link from %s to %s exists", node_portal,
e88930
@@ -2417,8 +2455,8 @@ int idbm_add_node(node_rec_t *newrec, discovery_rec_t *drec, int overwrite)
e88930
 				 strerror(errno));
e88930
 		}
e88930
 	}
e88930
+unlock:
e88930
 	idbm_unlock();
e88930
-free_portal:
e88930
 	free(node_portal);
e88930
 	return rc;
e88930
 }
e88930
@@ -2657,7 +2695,7 @@ static int idbm_remove_disc_to_node_link(node_rec_t *rec,
e88930
 		 rec->name, rec->conn[0].address, rec->conn[0].port, rec->tpgt,
e88930
 		 rec->iface.name);
e88930
 
e88930
-	rc = __idbm_rec_read(tmprec, portal);
e88930
+	rc = __idbm_rec_read(tmprec, portal, false);
e88930
 	if (rc) {
e88930
 		/* old style recs will not have tpgt or a link so skip */
e88930
 		rc = 0;
e88930
@@ -2884,7 +2922,7 @@ int idbm_node_set_param(void *data, node_rec_t *rec)
e88930
 	if (rc)
e88930
 		return rc;
e88930
 
e88930
-	return idbm_rec_write(rec);
e88930
+	return idbm_rec_write(rec, true);
e88930
 }
e88930
 
e88930
 int idbm_discovery_set_param(void *data, discovery_rec_t *rec)
e88930
diff --git a/usr/idbm.h b/usr/idbm.h
e88930
index 411dd82..8571a8c 100644
e88930
--- a/usr/idbm.h
e88930
+++ b/usr/idbm.h
e88930
@@ -23,6 +23,7 @@
e88930
 #define IDBM_H
e88930
 
e88930
 #include <stdio.h>
e88930
+#include <stdbool.h>
e88930
 #include <sys/types.h>
e88930
 #include "initiator.h"
e88930
 #include "config.h"
e88930
@@ -91,22 +92,22 @@ struct user_param {
e88930
 };
e88930
 
e88930
 typedef int (idbm_iface_op_fn)(void *data, node_rec_t *rec);
e88930
-typedef int (idbm_portal_op_fn)(int *found,  void *data,
e88930
-				char *targetname, int tpgt, char *ip, int port);
e88930
+typedef int (idbm_portal_op_fn)(int *found,  void *data, char *targetname,
e88930
+				int tpgt, char *ip, int port, bool ruw_lock);
e88930
 typedef int (idbm_node_op_fn)(int *found, void *data,
e88930
-			      char *targetname);
e88930
+			      char *targetname, bool ruw_lock);
e88930
 
e88930
 struct rec_op_data {
e88930
 	void *data;
e88930
 	node_rec_t *match_rec;
e88930
 	idbm_iface_op_fn *fn;
e88930
 };
e88930
-extern int idbm_for_each_portal(int *found, void *data,
e88930
-				idbm_portal_op_fn *fn, char *targetname);
e88930
+extern int idbm_for_each_portal(int *found, void *data, idbm_portal_op_fn *fn,
e88930
+				char *targetname, bool ruw_lock);
e88930
 extern int idbm_for_each_node(int *found, void *data,
e88930
-			      idbm_node_op_fn *fn);
e88930
+			      idbm_node_op_fn *fn, bool ruw_lock);
e88930
 extern int idbm_for_each_rec(int *found, void *data,
e88930
-			     idbm_iface_op_fn *fn);
e88930
+			     idbm_iface_op_fn *fn, bool ruw_lock);
e88930
 
e88930
 
e88930
 typedef int (idbm_drec_op_fn)(void *data, discovery_rec_t *drec);
e88930
@@ -145,7 +146,7 @@ extern int idbm_discovery_read(discovery_rec_t *rec, int type, char *addr,
e88930
 				int port);
e88930
 extern int idbm_rec_read(node_rec_t *out_rec, char *target_name,
e88930
 			 int tpgt, char *addr, int port,
e88930
-			 struct iface_rec *iface);
e88930
+			 struct iface_rec *iface, bool disable_lock);
e88930
 extern int idbm_node_set_rec_from_param(struct list_head *params,
e88930
 					node_rec_t *rec, int verify);
e88930
 extern int idbm_node_set_param(void *data, node_rec_t *rec);
e88930
diff --git a/usr/iface.c b/usr/iface.c
e88930
index 74e63f6..b2e6db6 100644
e88930
--- a/usr/iface.c
e88930
+++ b/usr/iface.c
e88930
@@ -855,7 +855,7 @@ int iface_print_tree(void *data, struct iface_rec *iface)
e88930
 	print_data.match_iface = iface;
e88930
 	print_data.last_rec = &last_rec;
e88930
 
e88930
-	idbm_for_each_rec(&num_found, &print_data, iface_print_nodes);
e88930
+	idbm_for_each_rec(&num_found, &print_data, iface_print_nodes, false);
e88930
 	return 0;
e88930
 }
e88930
 
e88930
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
e88930
index 6245e89..c2b047e 100644
e88930
--- a/usr/iscsiadm.c
e88930
+++ b/usr/iscsiadm.c
e88930
@@ -398,7 +398,7 @@ __logout_by_startup(void *data, struct list_head *list,
e88930
 	memset(&rec, 0, sizeof(node_rec_t));
e88930
 	if (idbm_rec_read(&rec, info->targetname, info->tpgt,
e88930
 			  info->persistent_address,
e88930
-			  info->persistent_port, &info->iface)) {
e88930
+			  info->persistent_port, &info->iface, false)) {
e88930
 		/*
e88930
 		 * this is due to a HW driver or some other driver
e88930
 		 * not hooked in
e88930
@@ -515,7 +515,7 @@ login_by_startup(char *mode)
e88930
 	startup.mode = mode;
e88930
 	INIT_LIST_HEAD(&startup.all_logins);
e88930
 	INIT_LIST_HEAD(&startup.leading_logins);
e88930
-	err = idbm_for_each_rec(&nr_found, &startup, link_startup_recs);
e88930
+	err = idbm_for_each_rec(&nr_found, &startup, link_startup_recs, false);
e88930
 	if (err && (!list_empty(&startup.all_logins) ||
e88930
 		    !list_empty(&startup.leading_logins)))
e88930
 		/* log msg and try to log into what we found */
e88930
@@ -662,7 +662,7 @@ static int __for_each_matched_rec(int verbose, struct node_rec *rec,
e88930
 	op_data.match_rec = rec;
e88930
 	op_data.fn = fn;
e88930
 
e88930
-	rc = idbm_for_each_rec(&nr_found, &op_data, rec_match_fn);
e88930
+	rc = idbm_for_each_rec(&nr_found, &op_data, rec_match_fn, true);
e88930
 	if (rc) {
e88930
 		if (verbose)
e88930
 			log_error("Could not execute operation on all "
e88930
@@ -915,8 +915,8 @@ done:
e88930
 	return rc;
e88930
 }
e88930
 
e88930
-static int add_static_portal(int *found, void *data,
e88930
-			     char *targetname, int tpgt, char *ip, int port)
e88930
+static int add_static_portal(int *found, void *data, char *targetname,
e88930
+			     int tpgt, char *ip, int port, bool ruw_lock)
e88930
 {
e88930
 	node_rec_t *rec = data;
e88930
 
e88930
@@ -932,7 +932,7 @@ static int add_static_portal(int *found, void *data,
e88930
 }
e88930
 
e88930
 static int add_static_node(int *found, void *data,
e88930
-			  char *targetname)
e88930
+			  char *targetname, bool ruw_lock)
e88930
 {
e88930
 	node_rec_t *rec = data;
e88930
 
e88930
@@ -950,14 +950,14 @@ static int add_static_node(int *found, void *data,
e88930
 			      rec->conn[0].port, &rec->iface);
e88930
 search:
e88930
 	return idbm_for_each_portal(found, data, add_static_portal,
e88930
-				    targetname);
e88930
+				    targetname, false);
e88930
 }
e88930
 
e88930
 static int add_static_recs(struct node_rec *rec)
e88930
 {
e88930
 	int rc, nr_found = 0;
e88930
 
e88930
-	rc = idbm_for_each_node(&nr_found, rec, add_static_node);
e88930
+	rc = idbm_for_each_node(&nr_found, rec, add_static_node, false);
e88930
 	if (rc)
e88930
 		goto done;
e88930
 	/* success */
e88930
@@ -1048,7 +1048,7 @@ exec_disc_op_on_recs(discovery_rec_t *drec, struct list_head *rec_list,
e88930
 
e88930
 	/* clean up node db */
e88930
 	if (op & OP_DELETE)
e88930
-		idbm_for_each_rec(&found, rec_list, delete_stale_rec);
e88930
+		idbm_for_each_rec(&found, rec_list, delete_stale_rec, false);
e88930
 
e88930
 	if (op & OP_NEW || op & OP_UPDATE) {
e88930
 		/* now add/update records */
e88930
diff --git a/usr/iscsid.c b/usr/iscsid.c
e88930
index f0017e5..01b90c9 100644
e88930
--- a/usr/iscsid.c
e88930
+++ b/usr/iscsid.c
e88930
@@ -233,7 +233,7 @@ static int sync_session(void *data, struct session_info *info)
e88930
 
e88930
 	if (idbm_rec_read(&rec, info->targetname, info->tpgt,
e88930
 			  info->persistent_address, info->persistent_port,
e88930
-			  &info->iface)) {
e88930
+			  &info->iface, false)) {
e88930
 		log_warning("Could not read data from db. Using default and "
e88930
 			    "currently negotiated values");
e88930
 		setup_rec_from_negotiated_values(&rec, info);
e88930
-- 
e88930
2.21.0
e88930