From b9584195340ab2a785d71c0d6e12710c28bf43b6 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Tue, 15 Feb 2011 10:12:24 +0800 Subject: [PATCH] storage: Create enough volumes for mpath pool "virStorageBackendCreateVols": "names->next" serves as condition expression for "do...while", however, "names" was shifted before, it then results in one less loop, and thus, one less volume will be created for mpath pool, the patch is to fix it. * src/storage/storage_backend_mpath.c --- src/storage/storage_backend_mpath.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c index be4db78785..2e85561708 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -212,6 +212,7 @@ virStorageBackendCreateVols(virStoragePoolObjPtr pool, int retval = -1, is_mpath = 0; char *map_device = NULL; uint32_t minor = -1; + uint32_t next; do { is_mpath = virStorageBackendIsMultipath(names->name); @@ -243,9 +244,10 @@ virStorageBackendCreateVols(virStoragePoolObjPtr pool, /* Given the way libdevmapper returns its data, I don't see * any way to avoid this series of casts. */ - names = (struct dm_names *)(((char *)names) + names->next); + next = names->next; + names = (struct dm_names *)(((char *)names) + next); - } while (names->next); + } while (next); retval = 0; out: