diff --git a/WHATS_NEW b/WHATS_NEW index 9ababd342..2645b535c 100644 --- 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). diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c index 43960f842..ff15b73aa 100644 --- a/lib/mirror/mirrored.c +++ b/lib/mirror/mirrored.c @@ -28,6 +28,8 @@ #include "sharedlib.h" #include "str_list.h" +#include + #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; diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 4a25330d0..21aa79462 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -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; }