public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW lib/mirror/mirrored.c libdm/l ...
Date: Mon, 24 May 2010 17:46:00 -0000	[thread overview]
Message-ID: <20100524174648.10784.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-05-24 17:46:48

Modified files:
	.              : WHATS_NEW 
	lib/mirror     : mirrored.c 
	libdm          : libdm-deptree.c 

Log message:
	Choose between clustered log versions based on kernel version.
	Add fixmes for broken strcmp.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1595&r2=1.1596
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.69&r2=1.70
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80

--- LVM2/WHATS_NEW	2010/05/24 16:30:15	1.1595
+++ LVM2/WHATS_NEW	2010/05/24 17:46:47	1.1596
@@ -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).
--- LVM2/lib/mirror/mirrored.c	2010/05/24 16:30:16	1.69
+++ LVM2/lib/mirror/mirrored.c	2010/05/24 17:46:47	1.70
@@ -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 @@
 	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 @@
 	 * 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;
--- LVM2/libdm/libdm-deptree.c	2010/05/24 09:04:27	1.79
+++ LVM2/libdm/libdm-deptree.c	2010/05/24 17:46:47	1.80
@@ -1575,6 +1575,7 @@
 		 * 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;
 	}


                 reply	other threads:[~2010-05-24 17:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100524174648.10784.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).