[dm-devel] [PATCH 06/10] multipath: set cookie before using it.

Benjamin Marzinski bmarzins at redhat.com
Sat Oct 29 02:55:22 UTC 2016


dm_task_set_cookie() expects the cookie to be initialized when it is
called, but dm_rename() didn't initialized it, causing renames to fail
some of the time.

Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
 libmultipath/devmapper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index ee61ff0..546e227 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -1424,7 +1424,7 @@ dm_rename (const char * old, char * new, char *delim, int skip_kpartx)
 {
 	int r = 0;
 	struct dm_task *dmt;
-	uint32_t cookie;
+	uint32_t cookie = 0;
 	uint16_t udev_flags = DM_UDEV_DISABLE_LIBRARY_FALLBACK | ((skip_kpartx == SKIP_KPARTX_ON)? MPATH_UDEV_NO_KPARTX_FLAG : 0);
 
 	if (dm_rename_partmaps(old, new, delim))
-- 
1.8.3.1




More information about the dm-devel mailing list