Subject: EVMS regions are not deactivated prior to container deportation
Package: evms
Version: 2.5.1-1
Severity: normal
Tags: patch

EVMS 2.5.1 does not deactivate MD regions prior to deporting containers, which can cause the system to hang at shutdown or during cluster failover.

I reported this bug upstream and it was acknowledged by an EVMS developer:

  http://marc.theaimsgroup.com/?l=evms-devel&m=111272068321285&w=2

The patch from Steve Dobbelstein is attached. I tested it on the Debian/sarge computer where I first noticed the problem.


-- System Information: Debian Release: 3.1 APT prefers testing APT policy: (990, 'testing'), (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.10-1-686 Locale: LANG=en_CA, LC_CTYPE=en_CA (charmap=ISO-8859-1_

Versions of packages evms depends on:
ii   libc6                 2.3.2.ds1-20
ii   libevms-2.5           2.5.1-1

-- no deconf information
Mark all deleted volumes as needing to be deactivated.

diff -u evms-2.5.1/engine/common.c evms-2.5.1-fix/engine/common.c
--- evms-2.5.1/engine/common.c  2004-12-06 11:05:04.000000000 -0600
+++ evms-2.5.1-fix/engine/common.c      2005-04-05 09:32:22.000000000 -0500
@@ -1156,6 +1156,9 @@
 
                                                        if 
(!(obj->volume->flags & VOLFLAG_NEW)) {
                                                                /* Put it on 
the volume_delete_list. */
+                                                               if 
(obj->volume->flags & VOLFLAG_ACTIVE) {
+                                                                       
obj->volume->flags |= VOLFLAG_NEEDS_DEACTIVATE;
+                                                               }
                                                                el = 
insert_thing(&volume_delete_list,
                                                                                
  obj->volume,
                                                                                
  INSERT_AFTER,
diff -u evms-2.5.1/engine/internalAPI.c evms-2.5.1-fix/engine/internalAPI.c
--- evms-2.5.1/engine/internalAPI.c     2005-01-05 17:38:58.000000000 -0600
+++ evms-2.5.1-fix/engine/internalAPI.c 2005-04-05 09:46:07.000000000 -0500
@@ -2614,6 +2614,9 @@
                        list_element_t el;
 
                        LOG_DEBUG("Volume exists.  Put it on the delete 
list.\n");
+                       if (vol->flags & VOLFLAG_ACTIVE) {
+                               vol->flags |= VOLFLAG_NEEDS_DEACTIVATE;
+                       }
                        el = insert_thing(&volume_delete_list,
                                          vol,
                                          INSERT_AFTER,
Only in evms-2.5.1-fix/engine/: internalAPI.c~
diff -u evms-2.5.1/engine/volume.c evms-2.5.1-fix/engine/volume.c
--- evms-2.5.1/engine/volume.c  2005-01-05 17:40:00.000000000 -0600
+++ evms-2.5.1-fix/engine/volume.c      2005-04-05 09:29:10.000000000 -0500
@@ -2174,6 +2174,9 @@
                        vol->flags &= ~VOLFLAG_UNMKFS;
 
                        /* Delete the old volume. */
+                       if (vol->flags & VOLFLAG_ACTIVE) {
+                               vol->flags |= VOLFLAG_NEEDS_DEACTIVATE;
+                       }
                        el = insert_thing(&volume_delete_list,
                                          vol,
                                          INSERT_AFTER,
@@ -2438,6 +2441,11 @@
                                 */
                                rc = 
vol->object->plugin->functions.plugin->add_sectors_to_kill_list(vol->object, 
vol->object->size - (EVMS_FEATURE_HEADER_SECTORS * 2), 
EVMS_FEATURE_HEADER_SECTORS * 2);
 
+                               /* Deactivate the volume if it is active. */
+                               if (vol->flags & VOLFLAG_ACTIVE) {
+                                       vol->flags |= VOLFLAG_NEEDS_DEACTIVATE;
+                               }
+
                        } else {
                                /*
                                 * The old volume was not inserted into the
Common subdirectories: evms-2.5.1/engine/worker and evms-2.5.1-fix/engine/worker

Reply via email to