Blame SOURCES/open-iscsi-2.0.873-fix-device-path-canonicalization-by-using-libmount-c.patch

6cc97b
From b6c9ebe86c45d0a318ec9bb42a6373b4f77a1ba7 Mon Sep 17 00:00:00 2001
6cc97b
From: Chris Leech <cleech@redhat.com>
6cc97b
Date: Tue, 21 Jul 2015 16:15:30 -0700
6cc97b
Subject: [PATCH 1/1] fix device path canonicalization by using libmount cache
6cc97b
6cc97b
---
6cc97b
 usr/initiator.c | 9 +++++++--
6cc97b
 1 file changed, 7 insertions(+), 2 deletions(-)
6cc97b
6cc97b
diff --git a/usr/initiator.c b/usr/initiator.c
6cc97b
index 3b39c5d..0519d46 100644
6cc97b
--- a/usr/initiator.c
6cc97b
+++ b/usr/initiator.c
6cc97b
@@ -2141,12 +2141,14 @@ static int session_unbind(struct iscsi_session *session)
6cc97b
 }
6cc97b
 
6cc97b
 static struct libmnt_table *mtab, *swaps;
6cc97b
+static struct libmnt_cache *mntcache;
6cc97b
 
6cc97b
 static void libmount_cleanup(void)
6cc97b
 {
6cc97b
 	mnt_free_table(mtab);
6cc97b
 	mnt_free_table(swaps);
6cc97b
-	mtab = swaps = NULL;
6cc97b
+	mnt_free_cache(mntcache);
6cc97b
+	mtab = swaps = mntcache = NULL;
6cc97b
 }
6cc97b
 
6cc97b
 static int libmount_init(void)
6cc97b
@@ -2154,10 +2156,13 @@ static int libmount_init(void)
6cc97b
 	mnt_init_debug(0);
6cc97b
 	mtab = mnt_new_table();
6cc97b
 	swaps = mnt_new_table();
6cc97b
-	if (!mtab || !swaps) {
6cc97b
+	mntcache = mnt_new_cache();
6cc97b
+	if (!mtab || !swaps || !mntcache) {
6cc97b
 		libmount_cleanup();
6cc97b
 		return -ENOMEM;
6cc97b
 	}
6cc97b
+	mnt_table_set_cache(mtab, mntcache);
6cc97b
+	mnt_table_set_cache(swaps, mntcache);
6cc97b
 	mnt_table_parse_mtab(mtab, NULL);
6cc97b
 	mnt_table_parse_swaps(swaps, NULL);
6cc97b
 	return 0;
6cc97b
-- 
6cc97b
2.1.0
6cc97b