]> sourceware.org Git - lvm2.git/commitdiff
Choose between clustered log versions based on kernel version.
authorAlasdair Kergon <agk@redhat.com>
Mon, 24 May 2010 17:46:47 +0000 (17:46 +0000)
committerAlasdair Kergon <agk@redhat.com>
Mon, 24 May 2010 17:46:47 +0000 (17:46 +0000)
Add fixmes for broken strcmp.

WHATS_NEW
lib/mirror/mirrored.c
libdm/libdm-deptree.c

index 9ababd3420e13695db4ee2ead11862a65bd28a36..2645b535c33b2052b26f2836465d8cdf38dd0702 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,6 @@
 Version 2.02.67 -
 ===============================
-  Update clustered log kernel module name to log-userspace.
+  Update clustered log kernel module name to log-userspace for 2.6.31 onwards.
   Activate only first head of Replicator for vgchange -ay.
   Add Replicators' LVs to dtree for activation.
   Avoid print activation message if there is a missing VG (Replicator).
index 43960f84299ca9c84691cb6d6828d2fa8a224d8d..ff15b73aa3ee8c81f0b24602ca0a29aa31286fa1 100644 (file)
@@ -28,6 +28,8 @@
 #include "sharedlib.h"
 #include "str_list.h"
 
+#include <sys/utsname.h>
+
 #ifdef DMEVENTD
 #  include "libdevmapper-event.h"
 #endif
@@ -471,6 +473,7 @@ static int _mirrored_target_present(struct cmd_context *cmd,
        uint32_t maj, min, patchlevel;
        unsigned maj2, min2, patchlevel2;
        char vsn[80];
+       struct utsname uts;
 
        if (!_mirrored_checked) {
                _mirrored_present = target_present(cmd, "mirror", 1);
@@ -503,8 +506,18 @@ static int _mirrored_target_present(struct cmd_context *cmd,
         * FIXME: Fails incorrectly if cmirror was built into kernel.
         */
        if (attributes) {
-               if (!_mirror_attributes && module_present(cmd, "log-userspace"))
-                       _mirror_attributes |= MIRROR_LOG_CLUSTERED;
+               if (!_mirror_attributes) {
+                       /*
+                        * The dm-log-userspace module was added to the
+                        * 2.6.31 kernel.
+                        */
+                       /* FIXME Replace the broken string comparison! */
+                       if (!uname(&uts) && strncmp(uts.release, "2.6.31", 6) < 0) {
+                               if (module_present(cmd, "log-clustered"))
+                                       _mirror_attributes |= MIRROR_LOG_CLUSTERED;
+                       } else if (module_present(cmd, "log-userspace"))
+                               _mirror_attributes |= MIRROR_LOG_CLUSTERED;
+               }
                *attributes = _mirror_attributes;
        }
        _mirrored_checked = 1;
index 4a25330d011fd0e0106f21c9f0825b0bedc9b742..21aa7946216606d7a22eac632fa2582bf9f13452 100644 (file)
@@ -1575,6 +1575,7 @@ static int _mirror_emit_segment_line(struct dm_task *dmt, uint32_t major,
                 * The dm-log-userspace module was added to the
                 * 2.6.31 kernel.
                 */
+               /* FIXME Replace the broken string comparison! */
                if (strncmp(uts.release, "2.6.31", 6) >= 0)
                        dm_log_userspace = 1;
        }
This page took 0.04257 seconds and 5 git commands to generate.