Re: EVMS + kernel 2.6.17 & Re: Enabling DM Input
Brad Allen <[email protected]>
| Newsgroups | gmane.linux.evms.devel |
|---|---|
| Message-ID | <[email protected]> |
Found problem:
Oops. My testing forgot to look at EVMS libraries loaded during
running (I forgot to do an effective ldconfig; I was trying to debug
in the source tree without installing and forgot to set LD loading for
that). The disk geometry problem is the problem.
The patch on the mailing list works for me. I'll try to update my
Gentoo wiki EVMS entry to include solution, but right now that wiki is
going slow so I might not have time. I include all the patches here,
though. Here is the zero division patch within my EVMS tree at:
/etc/portage/sys-fs/evms/files/2.5.5/2.5.5_fpe_localdskmgr.c.patch
===================== /etc/portage/sys-fs/evms/files/2.5.5/2.5.5_fpe_localdskmgr.c.patch
--- evms-2.5.5/plugins/disk/localdskmgr.c.~1~ 2006-11-08 04:13:57.000000000 -0800
+++ evms-2.5.5/plugins/disk/localdskmgr.c 2006-11-08 04:14:18.000000000 -0800
@@ -1655,6 +1655,22 @@
get_kernel_geometry(disk);
}
+ if (disk->geometry.heads == 0) {
+ LOG_DEBUG("Disk %s: Heads is zero. Resetting to 255.\n",
+ disk->name);
+ disk->geometry.heads = 255;
+ }
+ if (disk->geometry.sectors_per_track == 0) {
+ LOG_DEBUG("Disk %s: Sectors-per-track is zero. Resetting to 63.\n",
+ disk->name);
+ disk->geometry.sectors_per_track = 63;
+ }
+ if (disk->geometry.bytes_per_sector == 0) {
+ LOG_DEBUG("Disk %s: Sector-size is zero. Resetting to 512.\n",
+ disk->name);
+ disk->geometry.bytes_per_sector = EVMS_VSECTOR_SIZE;
+ }
+
disk->geometry.cylinders = disk->size /
(disk->geometry.heads *
disk->geometry.sectors_per_track *
=====================
Here is the ebuild patch for 2.5.5-r1 for both the FPE and :
=======================================
--- /etc/portage/sys-fs/evms/evms-2.5.5-r1.ebuild.~1~ 2006-05-02 01:14:30.000000000 -0700
+++ /etc/portage/sys-fs/evms/evms-2.5.5-r1.ebuild 2006-11-08 05:12:22.000000000 -0800
@@ -11,7 +11,7 @@
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ia64 ~ppc ~sparc ~x86"
-IUSE="ncurses gtk"
+IUSE="ncurses gtk evmsdminput"
#EVMS uses libuuid from e2fsprogs
DEPEND="virtual/libc
@@ -27,6 +27,8 @@
cd ${S}
epatch ${FILESDIR}/${PV}/raid5_degrade_fix.patch
epatch ${FILESDIR}/${PV}/md_super_fix.patch
+ use evmsdminput && epatch ${FILESDIR}/${PV}/dev_mapper_input.patch
+ epatch ${FILESDIR}/${PV}/2.5.5_fpe_localdskmgr.c.patch
}
src_compile() {
@@ -43,6 +45,7 @@
--libdir=/$(get_libdir) \
--sbindir=/sbin \
--includedir=/usr/include \
+ $(use_enable nls) \
${excluded_interfaces} || die "Failed configure"
emake || die "Failed emake"
}
=======================================
and for 2.5.5-r2 (note: I tested -r1, not -r2):
================================
--- /etc/portage/sys-fs/evms/evms-2.5.5-r2.ebuild.~1~ 2006-06-01 14:31:03.000000000 -0700
+++ /etc/portage/sys-fs/evms/evms-2.5.5-r2.ebuild 2006-11-08 05:08:19.000000000 -0800
@@ -11,7 +11,7 @@
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
-IUSE="ncurses gtk nls"
+IUSE="ncurses gtk nls evmsdminput"
#EVMS uses libuuid from e2fsprogs
RDEPEND="virtual/libc
@@ -30,6 +30,8 @@
epatch ${FILESDIR}/${PV}/raid5_remove_spare_fix.patch
epatch ${FILESDIR}/${PV}/raid5_remove_spare_fix_2.patch
epatch ${FILESDIR}/evms-2.5.5-as-needed.patch
+ use evmsdminput && epatch ${FILESDIR}/${PV}/dev_mapper_input.patch
+ epatch ${FILESDIR}/${PV}/2.5.5_fpe_localdskmgr.c.patch
}
src_compile() {
================================
Message-ID: <[email protected]>
Date: Wed, 08 Nov 2006 12:58:59 +0100
From: Clemens Ender <[email protected]>
Organization: IBV Fallast
To: Brad Allen <[email protected]>
Subject: Re: EVMS + kernel 2.6.17
References: <[email protected]>
In-Reply-To: <[email protected]>
Brad Allen schrieb:
> I am also getting EVMS SIGFPE when moving from Linux kernel 2.6.16
> to 2.6.18. I might be forgetting that it also happened for me for
> 2.6.17 (which of course would cause me not to use it, since I have
> it in my boot scripts).
>
> Did you ever resolve this?
>
No. Unfortunately not. I kicked EVMS... using "plain" LVM2 now.
cheers,
Clemens
================================
Date: Wed, 8 Nov 2006 04:27:07 -0800
Message-Id: <[email protected]>
To: Tony Davies <[email protected]>
Subject: Re: [Evms-devel] Enabling DM Input
from: Brad Allen <[email protected]>
reply-to: Brad Allen <[email protected]>
cc: Brad Allen <[email protected]>
Which version of EVMS are you using?
With Linux kernel 2.6.16, EVMS 2.5.5, my patch works. Do you have
that?
I am having floating point exception problems with kernel 2.6.18, and
perhaps with 2.6.17 too. Have you tried kernel 2.6.16?
Have you tried kernel 2.6.16 with whatever version of EVMS you are
using with that patch?
My floating point exception problem is not the geometry problem
mentioned in the mailing list.
Sincerely,
Brad Allen
<[email protected]>
======================================
/etc/portage/sys-fs/evms/files/2.5.5/dev_mapper_input.patch :
========================================
Comments from original patch for 2.5.3:
from URL http://marc.theaimsgroup.com/?l=evms-devel&m=112887246404441&w=2
<head><title>'[Evms-devel] [PATCH] 2.5.3 device-mapper input' - MARC</title></head>
<META NAME="robots" CONTENT="noarchive">
<body bgcolor="#000000" text="#ffffff" link="#ffffff" vlink="#ddddff">
<pre><b>[<a href="?l=evms-devel&m=112853428509330&w=2">prev in list</a>] [<a href="?l=evms-devel&m=112888799008508&w=2">next in list</a>] [<font color="#c0c0c0">prev in thread</font>] [<font color="#c0c0c0">next in thread</font>] </b>
<b><font size=+1>
List: <a href="?l=evms-devel&r=1&w=2">evms-devel</a>
Subject: [Evms-devel] [PATCH] 2.5.3 device-mapper input
From: <a href="?a=108404336000003&r=1&w=2"><garlicbread () ntlworld ! com></a>
Date: <a href="?l=evms-devel&r=1&w=2&b=200510">2005-10-09 15:22:10</a>
Message-ID: <a href="?i=20051009142313.TJFF8556.aamta10-winn.ispmail.ntl.com%20()%20smtp%20!%20ntlworld%20!%20com">20051009142313.TJFF8556.aamta10-winn.ispmail.ntl.com () smtp ! ntlworld ! com</a></font>
[<a href="?l=evms-devel&m=112887246404441&q=raw">Download message RAW</a>]</b>
Hi, Some of you may find this interesting
a patch against evms 2.5.3 to enable device-mapper devices for input into evms
This is useful for things such as layering evms on top of dmraid and dm-crypt without \
the need for loop back devices (I've tried this with dmraid and I think this should \
also work for dm-crypt) I'm posting this from a web-mail system at the moment so I \
hope the patch gets through okay
a better approach would probably be to have a seperate plugin to control the aspects \
of device-mapper raid / crypt within evms perhaps as some form of region layer but at \
the moment I'm trying to see if I can write a reiser4 plugin
only device mapper targets stated in the new config section will be picked up (no \
wildcards) devices will show up with a prefix of dm/<dm target>
it's best to specify the entire disk target and let evms determine the seperate \
partitions for itself
it may even be possible to layer an evms volume on top of another evms volume \
(assuming your crazy enough to try) but I wouldn't advise it :)
-----------------------------------------
Email sent from <a href="http://www.ntlworld.com">www.ntlworld.com</a>
Virus-checked using McAfee(R) Software
Visit <a href="http://www.ntlworld.com/security">www.ntlworld.com/security</a> for more information
<a href="?l=evms-devel&m=112887246404441&q=p3"><b>["evms-2.5.3-userdm-0.1.patch" (text/x-patch)]</b></a>
[... then the patch followed ...]
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. <a href="http://solutions.newsforge.com/ibmarch.tmpl">http://solutions.newsforge.com/ibmarch.tmpl</a>
_______________________________________________
Evms-devel mailing list
[email protected]
To subscribe/unsubscribe, please visit:
<a href="https://lists.sourceforge.net/lists/listinfo/evms-devel">https://lists.sourceforge.net/lists/listinfo/evms-devel</a>
<b>[<a href="?l=evms-devel&m=112853428509330&w=2">prev in list</a>] [<a href="?l=evms-devel&m=112888799008508&w=2">next in list</a>] [<font color="#c0c0c0">prev in thread</font>] [<font color="#c0c0c0">next in thread</font>] </b>
</pre>
</pre><br><center>
<a href="?q=configure">Configure</a> |
<a href="?q=about">About MARC</a> |
<a href="?q=about#Begware">Support MARC</a> |
<a href="mailto:[email protected]?subject=Add a list to MARC">Got a list to add?</a> |
Sponsored by <a href="http://www.10East.com/">10East</a> and <a href="http://www.korelogic.com/">KoreLogic</a>
</center>
</body>
</html>
Here is the patch: I assigned it USE flag "evmsdminput" in Gentoo -u
diff -x'*~' -Nru /usr/src/evms/compare/evms-2.5.5/doc/evms.conf evms-2.5.5/doc/evms.conf
--- /usr/src/evms/compare/evms-2.5.5/doc/evms.conf 2006-02-23 07:49:43.000000000 -0800
+++ evms-2.5.5/doc/evms.conf 2006-03-05 12:20:26.485719200 -0800
@@ -251,6 +251,25 @@
device_size_prompt = yes
}
+# User devmapper section
+# This allows us to use a device-mapper device directly as a disk
+# without the need for loopback
+# Be careful not to specify any targets that are created by evms
+# This can be useful for any devices created via dmraid or other means
+
+# In order for this to work "dm*" has to be in the list of includes
+
+devmapper {
+ # This needs to be set to yes to enable
+ #dm_user = yes
+
+ # List of targets to discover as disks
+ # These are the target names as seen with "dmsetup ls"
+ # only specific targets can be used
+ # we need to avoid evms created targets
+ #dm_user_targets = [ raid1_device raid0_device ]
+}
+
# MD plugin section
md {
diff -x'*~' -Nru /usr/src/evms/compare/evms-2.5.5/engine/dm-targets.c evms-2.5.5/engine/dm-targets.c
--- /usr/src/evms/compare/evms-2.5.5/engine/dm-targets.c 2005-11-07 07:46:41.000000000 -0800
+++ evms-2.5.5/engine/dm-targets.c 2006-03-05 12:30:13.348119613 -0800
@@ -762,7 +762,7 @@
* A mirror string has the form:
* <log_type> <num_log_params> [<log_params>]* <num_mirrors> [<major>:<minor> <start_lba>]{2,}
*
- * Currently, log_type will always be "core", num_log_params is 1, and
+ * Currently, log_type will always be "core", num_log_params is 1 or 2, and
* log_params is chunk-size (in sectors).
**/
static int mirror_build_params(dm_target_t *target)
@@ -807,21 +807,32 @@
{
dm_target_mirror_t *mirror = target->data.mirror;
char *params = target->params;
- int i, rc;
+ int i, rc, num_opts;
LOG_PROC_ENTRY();
- /* Skip "core 1" at the start of the string. */
- params = next_token(params);
+ /* Skip "core" at the start of the string. */
params = next_token(params);
- rc = sscanf(params, "%u %u", &mirror->chunk_size, &mirror->num_mirrors);
+ /* get the number of options for core and the chunk size */
+ rc = sscanf(params, "%u %u", &num_opts, &mirror->chunk_size);
if (rc != 2) {
rc = EINVAL;
goto out;
}
-
params = next_token(params);
+
+ /* skip the options for core based on num_opts */
+ for (i = 0; i < num_opts; i++) {
+ params = next_token(params);
+ }
+
+ /* get the number of mirrors */
+ rc = sscanf(params, "%u", &mirror->num_mirrors);
+ if (rc != 1) {
+ rc = EINVAL;
+ goto out;
+ }
params = next_token(params);
for (i = 0; i < mirror->num_mirrors; i++) {
@@ -855,13 +866,33 @@
static int mirror_pretranslate_params(char *params, u_int32_t *num_devs,
u_int32_t *num_groups)
{
- int rc;
+ int rc, i, num_opts = 0;
+ char *num_devs_point;
LOG_PROC_ENTRY();
- rc = sscanf(params, "%*s %*d %*u %u", num_devs);
+ /* The mirror target can have more than 1 option
+ this affects the location of the number of member disks */
+
+ rc = sscanf(params, "%*s %u", &num_opts);
+ if (rc != 1) {
+ rc = EINVAL;
+ goto out;
+ }
+
+ /* skip "core <num_opts>" */
+ num_devs_point = next_token(params);
+ num_devs_point = next_token(params);
+
+ /* skip the options for core based on num_opts */
+ for (i = 0; i < num_opts; i++) {
+ num_devs_point = next_token(params);
+ }
+
+ rc = sscanf(num_devs_point, "%u", num_devs);
rc = (rc != 1) ? EINVAL : 0;
+out:
LOG_PROC_EXIT_INT(rc);
return rc;
}
diff -x'*~' -Nru /usr/src/evms/compare/evms-2.5.5/plugins/disk/localdskmgr.c evms-2.5.5/plugins/disk/localdskmgr.c
--- /usr/src/evms/compare/evms-2.5.5/plugins/disk/localdskmgr.c 2006-02-24 11:53:21.000000000 -0800
+++ evms-2.5.5/plugins/disk/localdskmgr.c 2006-03-05 12:36:27.728621485 -0800
@@ -1335,13 +1335,14 @@
rc = EngFncs->dm_get_targets(disk, &targets);
if (rc) {
LOG_ERROR("Error getting DM mapping for disk %s.\n", disk->name);
+ rc=0;
goto out;
}
/* Reject all non-multipath devices. */
if (targets->type != DM_TARGET_MULTIPATH) {
LOG_DEBUG("Disk %s is not a multipath device.\n", disk->name);
- rc = EINVAL;
+ //rc = EINVAL;
goto out;
}
@@ -1541,6 +1542,98 @@
}
/**
+ * check_user_devicemapper
+ *
+ * Check if this disk is a User created DM device.
+ **/
+static int check_user_devicemapper(storage_object_t * disk)
+{
+ dm_device_list_t * dm_list, * dm_entry;
+ dm_target_t * targets = NULL;
+ local_disk_t * ld = disk->private_data;
+ int rc = 0, dm_user_targets_count = 0, i, dmup_len;
+ boolean user_dm_enable;
+ const char * const * dm_user_targets;
+ char * dm_user_prefix = "dm/";
+
+ LOG_ENTRY();
+
+ /* Get the list of active DM devices. */
+ dm_list = get_dm_device_list();
+ if (!dm_list) {
+ LOG_WARNING("Cannot get list of DM devices.\n");
+ goto out;
+ }
+
+ /* Search the DM list for an entry that matches this disk. */
+ dm_entry = find_disk_in_dm_devices(disk, dm_list);
+ if (!dm_entry) {
+ LOG_DEBUG("Disk %s is not a DM device.\n", disk->name);
+ goto out;
+ }
+
+ user_dm_enable = FALSE;
+ EngFncs->get_config_bool("devmapper.dm_user", &user_dm_enable);
+
+ EngFncs->get_config_string_array("devmapper.dm_user_targets",
+ &dm_user_targets_count, &dm_user_targets);
+
+ if (user_dm_enable == FALSE) {
+ LOG_DEBUG("devmapper.dm_user not enabled.\n");
+ rc = EINVAL;
+ goto out;
+ }
+
+ /* search the named targets in the config for the DM name*/
+ user_dm_enable = FALSE;
+ for (i = 0; i < dm_user_targets_count; i++) {
+ if (strncmp(dm_user_targets[i], dm_entry->name, EVMS_NAME_SIZE) == 0) {
+ user_dm_enable = TRUE;
+ }
+ }
+
+ if (user_dm_enable == FALSE) {
+ LOG_DEBUG("%s not found in devmapper.dm_user_targets.\n", dm_entry->name);
+ rc = EINVAL;
+ goto out;
+ }
+
+ /* Get the DM mapping for this disk. */
+ /* we can use this in the future if we need to, and it's good to check */
+ strncpy(disk->name, dm_entry->name, EVMS_NAME_SIZE);
+ rc = EngFncs->dm_get_targets(disk, &targets);
+ if (rc) {
+ LOG_ERROR("Error getting DM mapping for disk %s.\n", disk->name);
+ goto out;
+ }
+
+ /* Copy the DM name to this disk. */
+ dmup_len = strlen(dm_user_prefix);
+ LOG_DEBUG("Changing disk name from %s to %s%s.\n",
+ disk->name, dm_user_prefix ,dm_entry->name);
+
+ strncpy(disk->name, dm_user_prefix, dmup_len);
+ strncpy((disk->name)+dmup_len, dm_entry->name, EVMS_NAME_SIZE-dmup_len);
+
+ /* Reject all multipath devices that
+ * were created by other EVMS plugins.
+ */
+ rc = check_multipath_name(disk);
+ if (rc) {
+ LOG_DEBUG("Multipath disk %s belongs to another EVMS plugin.\n",
+ disk->name);
+ goto out;
+ }
+
+ ld->flags |= LD_FLAG_USERDM;
+
+out:
+ /*EngFncs->dm_deallocate_targets(targets); */
+ LOG_EXIT_INT(rc);
+ return rc;
+}
+
+/**
* get_geometry
*
* First try to get the geometry from the partition table (if it exists).
@@ -1834,6 +1927,13 @@
/* Get the disk's hard-sector-size. */
get_hardsector_size(&working_disk);
+ /* Check for User created DM devices. */
+ rc = check_user_devicemapper(&working_disk);
+ if (rc) {
+ close_dev(&working_disk);
+ continue;
+ }
+
/* Get the disk's geometry. */
get_geometry(&working_disk);
diff -x'*~' -Nru /usr/src/evms/compare/evms-2.5.5/plugins/disk/localdskmgr.h evms-2.5.5/plugins/disk/localdskmgr.h
--- /usr/src/evms/compare/evms-2.5.5/plugins/disk/localdskmgr.h 2006-02-24 09:00:44.000000000 -0800
+++ evms-2.5.5/plugins/disk/localdskmgr.h 2006-03-05 12:36:46.917967652 -0800
@@ -93,6 +93,7 @@
#define LD_FLAG_MULTIPATH (1 << 0)
#define LD_FLAG_IDE (1 << 1)
#define LD_FLAG_SCSI (1 << 2)
+#define LD_FLAG_USERDM (1 << 3)
extern engine_functions_t *EngFncs;
extern plugin_record_t *my_plugin_record;
========================================
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Evms-devel mailing list
[email protected]
To subscribe/unsubscribe, please visit:
https://lists.sourceforge.net/lists/listinfo/evms-devel