From b28f83bc4b714ecab43a42689eb7a16c183464ac665320efe6ec8321dd40e41c Mon Sep 17 00:00:00 2001 From: Hendrik Vogelsang Date: Mon, 24 Aug 2009 21:46:06 +0000 Subject: [PATCH 1/4] Copy from home:hennevogel:branches:Base:System/dmraid via accept of submit request 18597 Request was accepted with message: OBS-URL: https://build.opensuse.org/package/show/Base:System/dmraid?expand=0&rev=4 --- dmraid.changes | 8 ++++++++ dmraid.spec | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/dmraid.changes b/dmraid.changes index 15d20ea..5ef21a3 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Aug 24 21:28:51 UTC 2009 - hvogel@novell.com + +- Fix activation of isw raid sets when the disks have serialnumber + longer then 16 characters +- Add patch adding --rm_partitions cmdline option and functionality +- Fix mismatch between BIOS and dmraid's view of ISW raid 10 sets + ------------------------------------------------------------------- Sun Aug 2 18:50:22 UTC 2009 - jansimon.moeller@opensuse.org diff --git a/dmraid.spec b/dmraid.spec index db7f2bc..bc4c10c 100644 --- a/dmraid.spec +++ b/dmraid.spec @@ -43,6 +43,10 @@ Patch4: dmraid-1.0.0.rc13-geometry.patch Patch6: dmraid-1.0.0.rc15-fix_macro.patch Patch10: dmraid-1.0.0.rc14-fixup_lsi1068e.patch Patch11: dmraid-1.0.0.rc15-scsi_serial_remove_ws.patch +Patch13: dmraid-1.0.0.rc15-isw-raid10.patch +Patch14: dmraid-1.0.0.rc15-rm_partitions.patch +Patch15: dmraid-1.0.0.rc15-isw-serial.patch + Patch500: ARM_libdmraid_ldflags.diff # libdmraid-events Patch50: libdmraid-events.dif @@ -114,6 +118,10 @@ Authors: %patch6 -p1 %patch10 -p1 %patch11 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 + pushd libdmraid* %patch50 %patch500 -p1 From 233d28ff0dd4ef8eb5e8d1a94f17899485b8b172376b1717e5db8511ed2f71dd Mon Sep 17 00:00:00 2001 From: Hendrik Vogelsang Date: Wed, 26 Aug 2009 13:17:00 +0000 Subject: [PATCH 2/4] add missing patches OBS-URL: https://build.opensuse.org/package/show/Base:System/dmraid?expand=0&rev=5 --- dmraid-1.0.0.rc15-isw-raid10.patch | 12 ++ dmraid-1.0.0.rc15-isw-serial.patch | 88 ++++++++++ dmraid-1.0.0.rc15-rm_partitions.patch | 222 ++++++++++++++++++++++++++ 3 files changed, 322 insertions(+) create mode 100644 dmraid-1.0.0.rc15-isw-raid10.patch create mode 100644 dmraid-1.0.0.rc15-isw-serial.patch create mode 100644 dmraid-1.0.0.rc15-rm_partitions.patch diff --git a/dmraid-1.0.0.rc15-isw-raid10.patch b/dmraid-1.0.0.rc15-isw-raid10.patch new file mode 100644 index 0000000..70b4a42 --- /dev/null +++ b/dmraid-1.0.0.rc15-isw-raid10.patch @@ -0,0 +1,12 @@ +diff -up 1.0.0.rc15/lib/format/ataraid/isw.c~ 1.0.0.rc15/lib/format/ataraid/isw.c +--- 1.0.0.rc15/lib/format/ataraid/isw.c~ 2008-09-17 08:58:52.000000000 -0400 ++++ 1.0.0.rc15/lib/format/ataraid/isw.c 2009-02-05 07:04:35.576126020 -0500 +@@ -155,7 +155,7 @@ name(struct lib_context *lc, struct raid + + while (i--) { + if (disk == isw->disk + i) { +- id = i % 2; ++ id = i / 2; + goto ok; + } + } diff --git a/dmraid-1.0.0.rc15-isw-serial.patch b/dmraid-1.0.0.rc15-isw-serial.patch new file mode 100644 index 0000000..3e2050d --- /dev/null +++ b/dmraid-1.0.0.rc15-isw-serial.patch @@ -0,0 +1,88 @@ +diff -up 1.0.0.rc15/lib/format/ataraid/isw.c~ 1.0.0.rc15/lib/format/ataraid/isw.c +--- 1.0.0.rc15/lib/format/ataraid/isw.c~ 2009-04-10 14:12:14.000000000 +0200 ++++ 1.0.0.rc15/lib/format/ataraid/isw.c 2009-04-10 14:38:56.000000000 +0200 +@@ -81,15 +81,43 @@ is_raid10(struct isw_dev *dev) + } + + /* Find a disk table slot by serial number. */ ++static const char *dev_info_serial_to_isw(const char *di_serial) ++{ ++ static char isw_serial[1024]; ++ ++ int i, isw_serial_len = 0; ++ ++ for (i = 0; di_serial[i] && isw_serial_len < 1023; i++) { ++ if (((unsigned char)di_serial[i]) > 0x20) { ++ /* ':' is reserved for use in placeholder serial ++ * numbers for missing disks */ ++ if (di_serial[i] == ':') ++ isw_serial[isw_serial_len] = ';'; ++ else ++ isw_serial[isw_serial_len] = di_serial[i]; ++ isw_serial_len++; ++ } ++ } ++ isw_serial[isw_serial_len] = 0; ++ ++ if (isw_serial_len > MAX_RAID_SERIAL_LEN) ++ memmove(isw_serial, ++ isw_serial + (isw_serial_len - MAX_RAID_SERIAL_LEN), ++ MAX_RAID_SERIAL_LEN); ++ ++ return isw_serial; ++} ++ + static struct isw_disk * + _get_disk(struct isw *isw, struct dev_info *di) + { + if (di->serial) { + int i = isw->num_disks; + struct isw_disk *disk = isw->disk; ++ const char *isw_serial = dev_info_serial_to_isw(di->serial); + + while (i--) { +- if (!strncmp(di->serial, (const char *) disk[i].serial, ++ if (!strncmp(isw_serial, (const char *) disk[i].serial, + MAX_RAID_SERIAL_LEN)) + return disk + i; + } +@@ -866,7 +894,8 @@ rd_by_serial(struct raid_set *rs, const + + list_for_each_entry(rd, &rs->devs, devs) { + if (rd->di && +- !strncmp(rd->di->serial, serial, MAX_RAID_SERIAL_LEN)) ++ !strncmp(dev_info_serial_to_isw(rd->di->serial), serial, ++ MAX_RAID_SERIAL_LEN)) + return rd; + } + +@@ -1297,7 +1326,8 @@ isw_config_disks(struct lib_context *lc, + struct raid_dev *rd; + + list_for_each_entry(rd, &rs->devs, devs) { +- strncpy((char *) disk[i].serial, rd->di->serial, ++ strncpy((char *) disk[i].serial, ++ dev_info_serial_to_isw(rd->di->serial), + MAX_RAID_SERIAL_LEN); + disk[i].totalBlocks = rd->di->sectors; + +@@ -2421,7 +2451,8 @@ update_metadata(struct lib_context *lc, + while (i--) { + /* Check if the disk is listed. */ + list_for_each_entry(di, LC_DI(lc), list) { +- if (!strncmp(di->serial, (const char *) disk[i].serial, ++ if (!strncmp(dev_info_serial_to_isw(di->serial), ++ (const char *) disk[i].serial, + MAX_RAID_SERIAL_LEN)) + goto goon; + } +@@ -2517,7 +2548,8 @@ update_metadata(struct lib_context *lc, + new_disk->status = CONFIG_ON_DISK | + DISK_SMART_EVENT_SUPPORTED | + CLAIMED_DISK | DETECTED_DISK | USABLE_DISK | CONFIGURED_DISK; +- strncpy((char *) new_disk->serial, di->serial, MAX_RAID_SERIAL_LEN); ++ strncpy((char *) new_disk->serial, dev_info_serial_to_isw(di->serial), ++ MAX_RAID_SERIAL_LEN); + + /* build new isw_disk array */ + for (i = 0; i < isw->num_disks; i++) { diff --git a/dmraid-1.0.0.rc15-rm_partitions.patch b/dmraid-1.0.0.rc15-rm_partitions.patch new file mode 100644 index 0000000..0ad9ceb --- /dev/null +++ b/dmraid-1.0.0.rc15-rm_partitions.patch @@ -0,0 +1,222 @@ +diff -up 1.0.0.rc15/include/dmraid/lib_context.h.rmparts 1.0.0.rc15/include/dmraid/lib_context.h +--- 1.0.0.rc15/include/dmraid/lib_context.h.rmparts 2008-06-20 16:17:35.000000000 +0200 ++++ 1.0.0.rc15/include/dmraid/lib_context.h 2009-02-13 12:03:57.000000000 +0100 +@@ -169,6 +169,7 @@ enum action { + PARTCHAR = 0x20000000, + + #endif ++ RMPARTITIONS = 0x40000000, + }; + + /* Arguments allowed ? */ +diff -up 1.0.0.rc15/lib/Makefile.in.rmparts 1.0.0.rc15/lib/Makefile.in +--- 1.0.0.rc15/lib/Makefile.in.rmparts 2008-06-11 15:07:04.000000000 +0200 ++++ 1.0.0.rc15/lib/Makefile.in 2009-02-13 12:03:57.000000000 +0100 +@@ -12,6 +12,7 @@ SOURCES=\ + activate/activate.c \ + activate/devmapper.c \ + device/ata.c \ ++ device/partition.c \ + device/scan.c \ + device/scsi.c \ + display/display.c \ +diff -up 1.0.0.rc15/lib/device/dev-io.h.rmparts 1.0.0.rc15/lib/device/dev-io.h +--- 1.0.0.rc15/lib/device/dev-io.h.rmparts 2008-06-12 12:54:32.000000000 +0200 ++++ 1.0.0.rc15/lib/device/dev-io.h 2009-02-13 12:03:57.000000000 +0100 +@@ -19,5 +19,6 @@ + + int discover_devices(struct lib_context *lc, char **devnodes); + int removable_device(struct lib_context *lc, char *dev_path); ++int remove_device_partitions(struct lib_context *lc, void *rs, int dummy); + + #endif +diff -up /dev/null 1.0.0.rc15/lib/device/partition.c +--- /dev/null 2009-02-13 08:38:43.364262886 +0100 ++++ 1.0.0.rc15/lib/device/partition.c 2009-02-13 12:03:57.000000000 +0100 +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2009 Hans de Goede , Red Hat Inc. ++ * All rights reserved. ++ * ++ * See file LICENSE at the top of this source tree for license information. ++ */ ++#include ++#include ++#include ++#include ++#include "internal.h" ++ ++static int ++_remove_subset_partitions(struct lib_context *lc, struct raid_set *rs) ++{ ++ struct raid_dev *rd; ++ struct blkpg_partition part = { 0, }; ++ struct blkpg_ioctl_arg io = { ++ .op = BLKPG_DEL_PARTITION, ++ .datalen = sizeof(part), ++ .data = &part, ++ }; ++ ++ list_for_each_entry(rd, &rs->devs, devs) { ++ int fd = open(rd->di->path, O_RDWR); ++ if (fd < 0) ++ LOG_ERR(lc, 0, "opening %s: %s\n", rd->di->path, ++ strerror(errno)); ++ ++ /* There is no way to enumerate partitions */ ++ for (part.pno = 1; part.pno <= 256; part.pno++) { ++ if (ioctl(fd, BLKPG, &io) < 0 && errno != ENXIO && ++ (part.pno < 16 || errno != EINVAL)) ++ LOG_ERR(lc, 0, ++ "removing part %d from %s: %s\n", ++ part.pno, rd->di->path, ++ strerror(errno)); ++ } ++ } ++ return 1; ++} ++ ++/* Remove the partition block devices (ie sda1) from block devices (ie sda) ++ used in the set, so that things like hal / blkid won't try to access the ++ disks directly */ ++int ++remove_device_partitions(struct lib_context *lc, void *v, int dummy) ++{ ++ struct raid_set *subset, *rs = v; ++ ++ /* Recursively walk down the chain of stacked RAID sets */ ++ list_for_each_entry(subset, &rs->sets, list) { ++ /* Remove partitions from devices of set below this one */ ++ if (!T_GROUP(rs) && !remove_device_partitions(lc, subset, 0)) ++ return 0; ++ } ++ ++ return _remove_subset_partitions(lc, rs); ++} +diff -up 1.0.0.rc15/lib/metadata/metadata.c.rmparts 1.0.0.rc15/lib/metadata/metadata.c +--- 1.0.0.rc15/lib/metadata/metadata.c.rmparts 2008-09-17 14:58:31.000000000 +0200 ++++ 1.0.0.rc15/lib/metadata/metadata.c 2009-02-13 12:03:57.000000000 +0100 +@@ -2147,6 +2147,9 @@ lib_perform(struct lib_context *lc, enum + if (get_metadata(lc, action, p, argv)) + ret = p->post(lc, p->pre ? p->pre(p->arg) : p->arg); + ++ if (ret && (RMPARTITIONS & action)) ++ process_sets(lc, remove_device_partitions, 0, SETS); ++ + if (LOCK == p->lock) + unlock_resource(lc, NULL); + +diff -up 1.0.0.rc15/man/dmraid.8.rmparts 1.0.0.rc15/man/dmraid.8 +--- 1.0.0.rc15/man/dmraid.8.rmparts 2008-06-11 15:07:20.000000000 +0200 ++++ 1.0.0.rc15/man/dmraid.8 2009-02-13 12:10:11.000000000 +0100 +@@ -8,6 +8,7 @@ dmraid \- discover, configure and activa + [-f|--format FORMAT[,FORMAT...]] + [{-P|--partchar} CHAR] + [-p|--no_partitions] ++ [-Z|--rm_partitions] + [--separator SEPARATOR] + [-t|--test] + [RAID-set...] +@@ -110,7 +111,11 @@ In case metadata format handlers are cho + Useful if devices have multiple metadata signatures. + When activating RAID sets, + .B -p +-disables the activation of partitions on them. ++disables the activation of partitions on them, and ++.B -Z ++will make dmraid tell the kernel to remove the partitions from the disks ++underlying the set, ie if sda is part of the set, remove sda1, sda2, etc. ++This prevents applications from directly accessiong the disks bypassing dmraid. + RAID set names given on command line don't need to be fully specified + (eg, "dmraid -ay sil" would activate all discovered Silicon Image Medley + RAID sets). +diff -up 1.0.0.rc15/tools/commands.c.rmparts 1.0.0.rc15/tools/commands.c +--- 1.0.0.rc15/tools/commands.c.rmparts 2008-06-20 22:25:33.000000000 +0200 ++++ 1.0.0.rc15/tools/commands.c 2009-02-13 12:03:57.000000000 +0100 +@@ -38,7 +38,7 @@ static char const *short_opts = "a:hipP: + #endif + "rR:s::tv" + #endif +- "VC:S::"; ++ "VC:S::Z"; + + #ifdef HAVE_GETOPTLONG + static struct option long_opts[] = { +@@ -73,6 +73,7 @@ static struct option long_opts[] = { + {"version", no_argument, NULL, 'V'}, + {"create", required_argument, NULL, 'C'}, + {"spare", optional_argument, NULL, 'S'}, ++ {"rm_partitions", no_argument, NULL, 'Z'}, + {NULL, no_argument, NULL, 0} + }; + #endif /* #ifdef HAVE_GETOPTLONG */ +@@ -209,6 +210,7 @@ help(struct lib_context *lc, int arg) + "\t[-f|--format FORMAT[,FORMAT...]]\n" + "\t[-P|--partchar CHAR]\n" + "\t[-p|--no_partitions]\n" ++ "\t[-Z|--rm_partitions]\n" + "\t[--separator SEPARATOR]\n" "\t[RAID-set...]\n", c); + log_print(lc, "%s\t{-h|--help}\n", c); + log_print(lc, "%s\t{-V/--version}\n", c); +@@ -221,7 +223,7 @@ help(struct lib_context *lc, int arg) + "\t[-f|--format FORMAT[,FORMAT...]]\n" + "\t[-P|--partchar CHAR]\n" "\t[-p|--no_partitions]\n" + "\t[--separator SEPARATOR]\n" "\t[-t|--test]\n" +- "\t[RAID-set...]\n", c); ++ "\t[-Z|--rm_partitions] [RAID-set...]\n", c); + log_print(lc, + "%s\t{-b|--block_devices} *\n" + "\t[-c|--display_columns][FIELD[,FIELD...]]...\n" +@@ -274,7 +276,7 @@ static struct actions actions[] = { + UNDEF, /* Set in check_activate() by mandatory option argument. */ + UNDEF, + ACTIVATE | DEACTIVATE | FORMAT | HELP | IGNORELOCKING | NOPARTITIONS | +- SEPARATOR ++ SEPARATOR | RMPARTITIONS + #ifndef DMRAID_MINI + | DBG | TEST | VERBOSE + #endif +@@ -293,7 +295,8 @@ static struct actions actions[] = { + # endif + | RAID_DEVICES | RAID_SETS, + ACTIVE | INACTIVE | COLUMN | DBG | DUMP | DMERASE | GROUP | HELP | +- IGNORELOCKING | NOPARTITIONS | SEPARATOR | TEST | VERBOSE ++ IGNORELOCKING | NOPARTITIONS | SEPARATOR | TEST | VERBOSE | ++ RMPARTITIONS + #else + , UNDEF + #endif +@@ -310,7 +313,7 @@ static struct actions actions[] = { + {'P', + PARTCHAR, + ACTIVATE | DEACTIVATE, +- FORMAT | HELP | IGNORELOCKING | SEPARATOR ++ FORMAT | HELP | IGNORELOCKING | SEPARATOR | RMPARTITIONS + #ifndef DMRAID_MINI + | DBG | TEST | VERBOSE + #endif +@@ -323,7 +326,7 @@ static struct actions actions[] = { + {'p', + NOPARTITIONS, + ACTIVATE | DEACTIVATE, +- FORMAT | HELP | IGNORELOCKING | SEPARATOR ++ FORMAT | HELP | IGNORELOCKING | SEPARATOR | RMPARTITIONS + #ifndef DMRAID_MINI + | DBG | TEST | VERBOSE + #endif +@@ -573,6 +576,15 @@ static struct actions actions[] = { + check_spare_argument, + LC_HOT_SPARE_SET, + }, ++ {'Z', ++ RMPARTITIONS, ++ ACTIVATE, /* We cannot undo this on DEACTIVATE ! */ ++ DBG | FORMAT | HELP | IGNORELOCKING | NOPARTITIONS | VERBOSE | ++ SEPARATOR, ++ ARGS, ++ NULL, ++ 0, ++ }, + }; + + /* From 7be71eb4e0c73aaaa342e249fe449baeceb62ee87a9afe13264dee1eb890002c Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Wed, 26 Aug 2009 15:16:17 +0000 Subject: [PATCH 3/4] checked in OBS-URL: https://build.opensuse.org/package/show/Base:System/dmraid?expand=0&rev=6 --- dmraid-1.0.0.rc15-isw-raid10.patch | 12 -- dmraid-1.0.0.rc15-isw-serial.patch | 88 ---------- dmraid-1.0.0.rc15-rm_partitions.patch | 222 -------------------------- dmraid.changes | 8 - dmraid.spec | 8 - 5 files changed, 338 deletions(-) delete mode 100644 dmraid-1.0.0.rc15-isw-raid10.patch delete mode 100644 dmraid-1.0.0.rc15-isw-serial.patch delete mode 100644 dmraid-1.0.0.rc15-rm_partitions.patch diff --git a/dmraid-1.0.0.rc15-isw-raid10.patch b/dmraid-1.0.0.rc15-isw-raid10.patch deleted file mode 100644 index 70b4a42..0000000 --- a/dmraid-1.0.0.rc15-isw-raid10.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up 1.0.0.rc15/lib/format/ataraid/isw.c~ 1.0.0.rc15/lib/format/ataraid/isw.c ---- 1.0.0.rc15/lib/format/ataraid/isw.c~ 2008-09-17 08:58:52.000000000 -0400 -+++ 1.0.0.rc15/lib/format/ataraid/isw.c 2009-02-05 07:04:35.576126020 -0500 -@@ -155,7 +155,7 @@ name(struct lib_context *lc, struct raid - - while (i--) { - if (disk == isw->disk + i) { -- id = i % 2; -+ id = i / 2; - goto ok; - } - } diff --git a/dmraid-1.0.0.rc15-isw-serial.patch b/dmraid-1.0.0.rc15-isw-serial.patch deleted file mode 100644 index 3e2050d..0000000 --- a/dmraid-1.0.0.rc15-isw-serial.patch +++ /dev/null @@ -1,88 +0,0 @@ -diff -up 1.0.0.rc15/lib/format/ataraid/isw.c~ 1.0.0.rc15/lib/format/ataraid/isw.c ---- 1.0.0.rc15/lib/format/ataraid/isw.c~ 2009-04-10 14:12:14.000000000 +0200 -+++ 1.0.0.rc15/lib/format/ataraid/isw.c 2009-04-10 14:38:56.000000000 +0200 -@@ -81,15 +81,43 @@ is_raid10(struct isw_dev *dev) - } - - /* Find a disk table slot by serial number. */ -+static const char *dev_info_serial_to_isw(const char *di_serial) -+{ -+ static char isw_serial[1024]; -+ -+ int i, isw_serial_len = 0; -+ -+ for (i = 0; di_serial[i] && isw_serial_len < 1023; i++) { -+ if (((unsigned char)di_serial[i]) > 0x20) { -+ /* ':' is reserved for use in placeholder serial -+ * numbers for missing disks */ -+ if (di_serial[i] == ':') -+ isw_serial[isw_serial_len] = ';'; -+ else -+ isw_serial[isw_serial_len] = di_serial[i]; -+ isw_serial_len++; -+ } -+ } -+ isw_serial[isw_serial_len] = 0; -+ -+ if (isw_serial_len > MAX_RAID_SERIAL_LEN) -+ memmove(isw_serial, -+ isw_serial + (isw_serial_len - MAX_RAID_SERIAL_LEN), -+ MAX_RAID_SERIAL_LEN); -+ -+ return isw_serial; -+} -+ - static struct isw_disk * - _get_disk(struct isw *isw, struct dev_info *di) - { - if (di->serial) { - int i = isw->num_disks; - struct isw_disk *disk = isw->disk; -+ const char *isw_serial = dev_info_serial_to_isw(di->serial); - - while (i--) { -- if (!strncmp(di->serial, (const char *) disk[i].serial, -+ if (!strncmp(isw_serial, (const char *) disk[i].serial, - MAX_RAID_SERIAL_LEN)) - return disk + i; - } -@@ -866,7 +894,8 @@ rd_by_serial(struct raid_set *rs, const - - list_for_each_entry(rd, &rs->devs, devs) { - if (rd->di && -- !strncmp(rd->di->serial, serial, MAX_RAID_SERIAL_LEN)) -+ !strncmp(dev_info_serial_to_isw(rd->di->serial), serial, -+ MAX_RAID_SERIAL_LEN)) - return rd; - } - -@@ -1297,7 +1326,8 @@ isw_config_disks(struct lib_context *lc, - struct raid_dev *rd; - - list_for_each_entry(rd, &rs->devs, devs) { -- strncpy((char *) disk[i].serial, rd->di->serial, -+ strncpy((char *) disk[i].serial, -+ dev_info_serial_to_isw(rd->di->serial), - MAX_RAID_SERIAL_LEN); - disk[i].totalBlocks = rd->di->sectors; - -@@ -2421,7 +2451,8 @@ update_metadata(struct lib_context *lc, - while (i--) { - /* Check if the disk is listed. */ - list_for_each_entry(di, LC_DI(lc), list) { -- if (!strncmp(di->serial, (const char *) disk[i].serial, -+ if (!strncmp(dev_info_serial_to_isw(di->serial), -+ (const char *) disk[i].serial, - MAX_RAID_SERIAL_LEN)) - goto goon; - } -@@ -2517,7 +2548,8 @@ update_metadata(struct lib_context *lc, - new_disk->status = CONFIG_ON_DISK | - DISK_SMART_EVENT_SUPPORTED | - CLAIMED_DISK | DETECTED_DISK | USABLE_DISK | CONFIGURED_DISK; -- strncpy((char *) new_disk->serial, di->serial, MAX_RAID_SERIAL_LEN); -+ strncpy((char *) new_disk->serial, dev_info_serial_to_isw(di->serial), -+ MAX_RAID_SERIAL_LEN); - - /* build new isw_disk array */ - for (i = 0; i < isw->num_disks; i++) { diff --git a/dmraid-1.0.0.rc15-rm_partitions.patch b/dmraid-1.0.0.rc15-rm_partitions.patch deleted file mode 100644 index 0ad9ceb..0000000 --- a/dmraid-1.0.0.rc15-rm_partitions.patch +++ /dev/null @@ -1,222 +0,0 @@ -diff -up 1.0.0.rc15/include/dmraid/lib_context.h.rmparts 1.0.0.rc15/include/dmraid/lib_context.h ---- 1.0.0.rc15/include/dmraid/lib_context.h.rmparts 2008-06-20 16:17:35.000000000 +0200 -+++ 1.0.0.rc15/include/dmraid/lib_context.h 2009-02-13 12:03:57.000000000 +0100 -@@ -169,6 +169,7 @@ enum action { - PARTCHAR = 0x20000000, - - #endif -+ RMPARTITIONS = 0x40000000, - }; - - /* Arguments allowed ? */ -diff -up 1.0.0.rc15/lib/Makefile.in.rmparts 1.0.0.rc15/lib/Makefile.in ---- 1.0.0.rc15/lib/Makefile.in.rmparts 2008-06-11 15:07:04.000000000 +0200 -+++ 1.0.0.rc15/lib/Makefile.in 2009-02-13 12:03:57.000000000 +0100 -@@ -12,6 +12,7 @@ SOURCES=\ - activate/activate.c \ - activate/devmapper.c \ - device/ata.c \ -+ device/partition.c \ - device/scan.c \ - device/scsi.c \ - display/display.c \ -diff -up 1.0.0.rc15/lib/device/dev-io.h.rmparts 1.0.0.rc15/lib/device/dev-io.h ---- 1.0.0.rc15/lib/device/dev-io.h.rmparts 2008-06-12 12:54:32.000000000 +0200 -+++ 1.0.0.rc15/lib/device/dev-io.h 2009-02-13 12:03:57.000000000 +0100 -@@ -19,5 +19,6 @@ - - int discover_devices(struct lib_context *lc, char **devnodes); - int removable_device(struct lib_context *lc, char *dev_path); -+int remove_device_partitions(struct lib_context *lc, void *rs, int dummy); - - #endif -diff -up /dev/null 1.0.0.rc15/lib/device/partition.c ---- /dev/null 2009-02-13 08:38:43.364262886 +0100 -+++ 1.0.0.rc15/lib/device/partition.c 2009-02-13 12:03:57.000000000 +0100 -@@ -0,0 +1,59 @@ -+/* -+ * Copyright (C) 2009 Hans de Goede , Red Hat Inc. -+ * All rights reserved. -+ * -+ * See file LICENSE at the top of this source tree for license information. -+ */ -+#include -+#include -+#include -+#include -+#include "internal.h" -+ -+static int -+_remove_subset_partitions(struct lib_context *lc, struct raid_set *rs) -+{ -+ struct raid_dev *rd; -+ struct blkpg_partition part = { 0, }; -+ struct blkpg_ioctl_arg io = { -+ .op = BLKPG_DEL_PARTITION, -+ .datalen = sizeof(part), -+ .data = &part, -+ }; -+ -+ list_for_each_entry(rd, &rs->devs, devs) { -+ int fd = open(rd->di->path, O_RDWR); -+ if (fd < 0) -+ LOG_ERR(lc, 0, "opening %s: %s\n", rd->di->path, -+ strerror(errno)); -+ -+ /* There is no way to enumerate partitions */ -+ for (part.pno = 1; part.pno <= 256; part.pno++) { -+ if (ioctl(fd, BLKPG, &io) < 0 && errno != ENXIO && -+ (part.pno < 16 || errno != EINVAL)) -+ LOG_ERR(lc, 0, -+ "removing part %d from %s: %s\n", -+ part.pno, rd->di->path, -+ strerror(errno)); -+ } -+ } -+ return 1; -+} -+ -+/* Remove the partition block devices (ie sda1) from block devices (ie sda) -+ used in the set, so that things like hal / blkid won't try to access the -+ disks directly */ -+int -+remove_device_partitions(struct lib_context *lc, void *v, int dummy) -+{ -+ struct raid_set *subset, *rs = v; -+ -+ /* Recursively walk down the chain of stacked RAID sets */ -+ list_for_each_entry(subset, &rs->sets, list) { -+ /* Remove partitions from devices of set below this one */ -+ if (!T_GROUP(rs) && !remove_device_partitions(lc, subset, 0)) -+ return 0; -+ } -+ -+ return _remove_subset_partitions(lc, rs); -+} -diff -up 1.0.0.rc15/lib/metadata/metadata.c.rmparts 1.0.0.rc15/lib/metadata/metadata.c ---- 1.0.0.rc15/lib/metadata/metadata.c.rmparts 2008-09-17 14:58:31.000000000 +0200 -+++ 1.0.0.rc15/lib/metadata/metadata.c 2009-02-13 12:03:57.000000000 +0100 -@@ -2147,6 +2147,9 @@ lib_perform(struct lib_context *lc, enum - if (get_metadata(lc, action, p, argv)) - ret = p->post(lc, p->pre ? p->pre(p->arg) : p->arg); - -+ if (ret && (RMPARTITIONS & action)) -+ process_sets(lc, remove_device_partitions, 0, SETS); -+ - if (LOCK == p->lock) - unlock_resource(lc, NULL); - -diff -up 1.0.0.rc15/man/dmraid.8.rmparts 1.0.0.rc15/man/dmraid.8 ---- 1.0.0.rc15/man/dmraid.8.rmparts 2008-06-11 15:07:20.000000000 +0200 -+++ 1.0.0.rc15/man/dmraid.8 2009-02-13 12:10:11.000000000 +0100 -@@ -8,6 +8,7 @@ dmraid \- discover, configure and activa - [-f|--format FORMAT[,FORMAT...]] - [{-P|--partchar} CHAR] - [-p|--no_partitions] -+ [-Z|--rm_partitions] - [--separator SEPARATOR] - [-t|--test] - [RAID-set...] -@@ -110,7 +111,11 @@ In case metadata format handlers are cho - Useful if devices have multiple metadata signatures. - When activating RAID sets, - .B -p --disables the activation of partitions on them. -+disables the activation of partitions on them, and -+.B -Z -+will make dmraid tell the kernel to remove the partitions from the disks -+underlying the set, ie if sda is part of the set, remove sda1, sda2, etc. -+This prevents applications from directly accessiong the disks bypassing dmraid. - RAID set names given on command line don't need to be fully specified - (eg, "dmraid -ay sil" would activate all discovered Silicon Image Medley - RAID sets). -diff -up 1.0.0.rc15/tools/commands.c.rmparts 1.0.0.rc15/tools/commands.c ---- 1.0.0.rc15/tools/commands.c.rmparts 2008-06-20 22:25:33.000000000 +0200 -+++ 1.0.0.rc15/tools/commands.c 2009-02-13 12:03:57.000000000 +0100 -@@ -38,7 +38,7 @@ static char const *short_opts = "a:hipP: - #endif - "rR:s::tv" - #endif -- "VC:S::"; -+ "VC:S::Z"; - - #ifdef HAVE_GETOPTLONG - static struct option long_opts[] = { -@@ -73,6 +73,7 @@ static struct option long_opts[] = { - {"version", no_argument, NULL, 'V'}, - {"create", required_argument, NULL, 'C'}, - {"spare", optional_argument, NULL, 'S'}, -+ {"rm_partitions", no_argument, NULL, 'Z'}, - {NULL, no_argument, NULL, 0} - }; - #endif /* #ifdef HAVE_GETOPTLONG */ -@@ -209,6 +210,7 @@ help(struct lib_context *lc, int arg) - "\t[-f|--format FORMAT[,FORMAT...]]\n" - "\t[-P|--partchar CHAR]\n" - "\t[-p|--no_partitions]\n" -+ "\t[-Z|--rm_partitions]\n" - "\t[--separator SEPARATOR]\n" "\t[RAID-set...]\n", c); - log_print(lc, "%s\t{-h|--help}\n", c); - log_print(lc, "%s\t{-V/--version}\n", c); -@@ -221,7 +223,7 @@ help(struct lib_context *lc, int arg) - "\t[-f|--format FORMAT[,FORMAT...]]\n" - "\t[-P|--partchar CHAR]\n" "\t[-p|--no_partitions]\n" - "\t[--separator SEPARATOR]\n" "\t[-t|--test]\n" -- "\t[RAID-set...]\n", c); -+ "\t[-Z|--rm_partitions] [RAID-set...]\n", c); - log_print(lc, - "%s\t{-b|--block_devices} *\n" - "\t[-c|--display_columns][FIELD[,FIELD...]]...\n" -@@ -274,7 +276,7 @@ static struct actions actions[] = { - UNDEF, /* Set in check_activate() by mandatory option argument. */ - UNDEF, - ACTIVATE | DEACTIVATE | FORMAT | HELP | IGNORELOCKING | NOPARTITIONS | -- SEPARATOR -+ SEPARATOR | RMPARTITIONS - #ifndef DMRAID_MINI - | DBG | TEST | VERBOSE - #endif -@@ -293,7 +295,8 @@ static struct actions actions[] = { - # endif - | RAID_DEVICES | RAID_SETS, - ACTIVE | INACTIVE | COLUMN | DBG | DUMP | DMERASE | GROUP | HELP | -- IGNORELOCKING | NOPARTITIONS | SEPARATOR | TEST | VERBOSE -+ IGNORELOCKING | NOPARTITIONS | SEPARATOR | TEST | VERBOSE | -+ RMPARTITIONS - #else - , UNDEF - #endif -@@ -310,7 +313,7 @@ static struct actions actions[] = { - {'P', - PARTCHAR, - ACTIVATE | DEACTIVATE, -- FORMAT | HELP | IGNORELOCKING | SEPARATOR -+ FORMAT | HELP | IGNORELOCKING | SEPARATOR | RMPARTITIONS - #ifndef DMRAID_MINI - | DBG | TEST | VERBOSE - #endif -@@ -323,7 +326,7 @@ static struct actions actions[] = { - {'p', - NOPARTITIONS, - ACTIVATE | DEACTIVATE, -- FORMAT | HELP | IGNORELOCKING | SEPARATOR -+ FORMAT | HELP | IGNORELOCKING | SEPARATOR | RMPARTITIONS - #ifndef DMRAID_MINI - | DBG | TEST | VERBOSE - #endif -@@ -573,6 +576,15 @@ static struct actions actions[] = { - check_spare_argument, - LC_HOT_SPARE_SET, - }, -+ {'Z', -+ RMPARTITIONS, -+ ACTIVATE, /* We cannot undo this on DEACTIVATE ! */ -+ DBG | FORMAT | HELP | IGNORELOCKING | NOPARTITIONS | VERBOSE | -+ SEPARATOR, -+ ARGS, -+ NULL, -+ 0, -+ }, - }; - - /* diff --git a/dmraid.changes b/dmraid.changes index 5ef21a3..15d20ea 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,11 +1,3 @@ -------------------------------------------------------------------- -Mon Aug 24 21:28:51 UTC 2009 - hvogel@novell.com - -- Fix activation of isw raid sets when the disks have serialnumber - longer then 16 characters -- Add patch adding --rm_partitions cmdline option and functionality -- Fix mismatch between BIOS and dmraid's view of ISW raid 10 sets - ------------------------------------------------------------------- Sun Aug 2 18:50:22 UTC 2009 - jansimon.moeller@opensuse.org diff --git a/dmraid.spec b/dmraid.spec index bc4c10c..db7f2bc 100644 --- a/dmraid.spec +++ b/dmraid.spec @@ -43,10 +43,6 @@ Patch4: dmraid-1.0.0.rc13-geometry.patch Patch6: dmraid-1.0.0.rc15-fix_macro.patch Patch10: dmraid-1.0.0.rc14-fixup_lsi1068e.patch Patch11: dmraid-1.0.0.rc15-scsi_serial_remove_ws.patch -Patch13: dmraid-1.0.0.rc15-isw-raid10.patch -Patch14: dmraid-1.0.0.rc15-rm_partitions.patch -Patch15: dmraid-1.0.0.rc15-isw-serial.patch - Patch500: ARM_libdmraid_ldflags.diff # libdmraid-events Patch50: libdmraid-events.dif @@ -118,10 +114,6 @@ Authors: %patch6 -p1 %patch10 -p1 %patch11 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 - pushd libdmraid* %patch50 %patch500 -p1 From fd18ffd36ee4e6721509e99a5565d44da3c4263e60cfc76fcb9771ec0b66c451 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Wed, 26 Aug 2009 15:16:18 +0000 Subject: [PATCH 4/4] Updating link to change in openSUSE:Factory/dmraid revision 24.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/dmraid?expand=0&rev=4b64dd49a32df5cd73a05705b37ebcb1 --- dmraid-1.0.0.rc15-isw-raid10.patch | 12 ++ dmraid-1.0.0.rc15-isw-serial.patch | 88 ++++++++++ dmraid-1.0.0.rc15-rm_partitions.patch | 222 ++++++++++++++++++++++++++ dmraid.changes | 8 + dmraid.spec | 8 +- 5 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 dmraid-1.0.0.rc15-isw-raid10.patch create mode 100644 dmraid-1.0.0.rc15-isw-serial.patch create mode 100644 dmraid-1.0.0.rc15-rm_partitions.patch diff --git a/dmraid-1.0.0.rc15-isw-raid10.patch b/dmraid-1.0.0.rc15-isw-raid10.patch new file mode 100644 index 0000000..70b4a42 --- /dev/null +++ b/dmraid-1.0.0.rc15-isw-raid10.patch @@ -0,0 +1,12 @@ +diff -up 1.0.0.rc15/lib/format/ataraid/isw.c~ 1.0.0.rc15/lib/format/ataraid/isw.c +--- 1.0.0.rc15/lib/format/ataraid/isw.c~ 2008-09-17 08:58:52.000000000 -0400 ++++ 1.0.0.rc15/lib/format/ataraid/isw.c 2009-02-05 07:04:35.576126020 -0500 +@@ -155,7 +155,7 @@ name(struct lib_context *lc, struct raid + + while (i--) { + if (disk == isw->disk + i) { +- id = i % 2; ++ id = i / 2; + goto ok; + } + } diff --git a/dmraid-1.0.0.rc15-isw-serial.patch b/dmraid-1.0.0.rc15-isw-serial.patch new file mode 100644 index 0000000..3e2050d --- /dev/null +++ b/dmraid-1.0.0.rc15-isw-serial.patch @@ -0,0 +1,88 @@ +diff -up 1.0.0.rc15/lib/format/ataraid/isw.c~ 1.0.0.rc15/lib/format/ataraid/isw.c +--- 1.0.0.rc15/lib/format/ataraid/isw.c~ 2009-04-10 14:12:14.000000000 +0200 ++++ 1.0.0.rc15/lib/format/ataraid/isw.c 2009-04-10 14:38:56.000000000 +0200 +@@ -81,15 +81,43 @@ is_raid10(struct isw_dev *dev) + } + + /* Find a disk table slot by serial number. */ ++static const char *dev_info_serial_to_isw(const char *di_serial) ++{ ++ static char isw_serial[1024]; ++ ++ int i, isw_serial_len = 0; ++ ++ for (i = 0; di_serial[i] && isw_serial_len < 1023; i++) { ++ if (((unsigned char)di_serial[i]) > 0x20) { ++ /* ':' is reserved for use in placeholder serial ++ * numbers for missing disks */ ++ if (di_serial[i] == ':') ++ isw_serial[isw_serial_len] = ';'; ++ else ++ isw_serial[isw_serial_len] = di_serial[i]; ++ isw_serial_len++; ++ } ++ } ++ isw_serial[isw_serial_len] = 0; ++ ++ if (isw_serial_len > MAX_RAID_SERIAL_LEN) ++ memmove(isw_serial, ++ isw_serial + (isw_serial_len - MAX_RAID_SERIAL_LEN), ++ MAX_RAID_SERIAL_LEN); ++ ++ return isw_serial; ++} ++ + static struct isw_disk * + _get_disk(struct isw *isw, struct dev_info *di) + { + if (di->serial) { + int i = isw->num_disks; + struct isw_disk *disk = isw->disk; ++ const char *isw_serial = dev_info_serial_to_isw(di->serial); + + while (i--) { +- if (!strncmp(di->serial, (const char *) disk[i].serial, ++ if (!strncmp(isw_serial, (const char *) disk[i].serial, + MAX_RAID_SERIAL_LEN)) + return disk + i; + } +@@ -866,7 +894,8 @@ rd_by_serial(struct raid_set *rs, const + + list_for_each_entry(rd, &rs->devs, devs) { + if (rd->di && +- !strncmp(rd->di->serial, serial, MAX_RAID_SERIAL_LEN)) ++ !strncmp(dev_info_serial_to_isw(rd->di->serial), serial, ++ MAX_RAID_SERIAL_LEN)) + return rd; + } + +@@ -1297,7 +1326,8 @@ isw_config_disks(struct lib_context *lc, + struct raid_dev *rd; + + list_for_each_entry(rd, &rs->devs, devs) { +- strncpy((char *) disk[i].serial, rd->di->serial, ++ strncpy((char *) disk[i].serial, ++ dev_info_serial_to_isw(rd->di->serial), + MAX_RAID_SERIAL_LEN); + disk[i].totalBlocks = rd->di->sectors; + +@@ -2421,7 +2451,8 @@ update_metadata(struct lib_context *lc, + while (i--) { + /* Check if the disk is listed. */ + list_for_each_entry(di, LC_DI(lc), list) { +- if (!strncmp(di->serial, (const char *) disk[i].serial, ++ if (!strncmp(dev_info_serial_to_isw(di->serial), ++ (const char *) disk[i].serial, + MAX_RAID_SERIAL_LEN)) + goto goon; + } +@@ -2517,7 +2548,8 @@ update_metadata(struct lib_context *lc, + new_disk->status = CONFIG_ON_DISK | + DISK_SMART_EVENT_SUPPORTED | + CLAIMED_DISK | DETECTED_DISK | USABLE_DISK | CONFIGURED_DISK; +- strncpy((char *) new_disk->serial, di->serial, MAX_RAID_SERIAL_LEN); ++ strncpy((char *) new_disk->serial, dev_info_serial_to_isw(di->serial), ++ MAX_RAID_SERIAL_LEN); + + /* build new isw_disk array */ + for (i = 0; i < isw->num_disks; i++) { diff --git a/dmraid-1.0.0.rc15-rm_partitions.patch b/dmraid-1.0.0.rc15-rm_partitions.patch new file mode 100644 index 0000000..0ad9ceb --- /dev/null +++ b/dmraid-1.0.0.rc15-rm_partitions.patch @@ -0,0 +1,222 @@ +diff -up 1.0.0.rc15/include/dmraid/lib_context.h.rmparts 1.0.0.rc15/include/dmraid/lib_context.h +--- 1.0.0.rc15/include/dmraid/lib_context.h.rmparts 2008-06-20 16:17:35.000000000 +0200 ++++ 1.0.0.rc15/include/dmraid/lib_context.h 2009-02-13 12:03:57.000000000 +0100 +@@ -169,6 +169,7 @@ enum action { + PARTCHAR = 0x20000000, + + #endif ++ RMPARTITIONS = 0x40000000, + }; + + /* Arguments allowed ? */ +diff -up 1.0.0.rc15/lib/Makefile.in.rmparts 1.0.0.rc15/lib/Makefile.in +--- 1.0.0.rc15/lib/Makefile.in.rmparts 2008-06-11 15:07:04.000000000 +0200 ++++ 1.0.0.rc15/lib/Makefile.in 2009-02-13 12:03:57.000000000 +0100 +@@ -12,6 +12,7 @@ SOURCES=\ + activate/activate.c \ + activate/devmapper.c \ + device/ata.c \ ++ device/partition.c \ + device/scan.c \ + device/scsi.c \ + display/display.c \ +diff -up 1.0.0.rc15/lib/device/dev-io.h.rmparts 1.0.0.rc15/lib/device/dev-io.h +--- 1.0.0.rc15/lib/device/dev-io.h.rmparts 2008-06-12 12:54:32.000000000 +0200 ++++ 1.0.0.rc15/lib/device/dev-io.h 2009-02-13 12:03:57.000000000 +0100 +@@ -19,5 +19,6 @@ + + int discover_devices(struct lib_context *lc, char **devnodes); + int removable_device(struct lib_context *lc, char *dev_path); ++int remove_device_partitions(struct lib_context *lc, void *rs, int dummy); + + #endif +diff -up /dev/null 1.0.0.rc15/lib/device/partition.c +--- /dev/null 2009-02-13 08:38:43.364262886 +0100 ++++ 1.0.0.rc15/lib/device/partition.c 2009-02-13 12:03:57.000000000 +0100 +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2009 Hans de Goede , Red Hat Inc. ++ * All rights reserved. ++ * ++ * See file LICENSE at the top of this source tree for license information. ++ */ ++#include ++#include ++#include ++#include ++#include "internal.h" ++ ++static int ++_remove_subset_partitions(struct lib_context *lc, struct raid_set *rs) ++{ ++ struct raid_dev *rd; ++ struct blkpg_partition part = { 0, }; ++ struct blkpg_ioctl_arg io = { ++ .op = BLKPG_DEL_PARTITION, ++ .datalen = sizeof(part), ++ .data = &part, ++ }; ++ ++ list_for_each_entry(rd, &rs->devs, devs) { ++ int fd = open(rd->di->path, O_RDWR); ++ if (fd < 0) ++ LOG_ERR(lc, 0, "opening %s: %s\n", rd->di->path, ++ strerror(errno)); ++ ++ /* There is no way to enumerate partitions */ ++ for (part.pno = 1; part.pno <= 256; part.pno++) { ++ if (ioctl(fd, BLKPG, &io) < 0 && errno != ENXIO && ++ (part.pno < 16 || errno != EINVAL)) ++ LOG_ERR(lc, 0, ++ "removing part %d from %s: %s\n", ++ part.pno, rd->di->path, ++ strerror(errno)); ++ } ++ } ++ return 1; ++} ++ ++/* Remove the partition block devices (ie sda1) from block devices (ie sda) ++ used in the set, so that things like hal / blkid won't try to access the ++ disks directly */ ++int ++remove_device_partitions(struct lib_context *lc, void *v, int dummy) ++{ ++ struct raid_set *subset, *rs = v; ++ ++ /* Recursively walk down the chain of stacked RAID sets */ ++ list_for_each_entry(subset, &rs->sets, list) { ++ /* Remove partitions from devices of set below this one */ ++ if (!T_GROUP(rs) && !remove_device_partitions(lc, subset, 0)) ++ return 0; ++ } ++ ++ return _remove_subset_partitions(lc, rs); ++} +diff -up 1.0.0.rc15/lib/metadata/metadata.c.rmparts 1.0.0.rc15/lib/metadata/metadata.c +--- 1.0.0.rc15/lib/metadata/metadata.c.rmparts 2008-09-17 14:58:31.000000000 +0200 ++++ 1.0.0.rc15/lib/metadata/metadata.c 2009-02-13 12:03:57.000000000 +0100 +@@ -2147,6 +2147,9 @@ lib_perform(struct lib_context *lc, enum + if (get_metadata(lc, action, p, argv)) + ret = p->post(lc, p->pre ? p->pre(p->arg) : p->arg); + ++ if (ret && (RMPARTITIONS & action)) ++ process_sets(lc, remove_device_partitions, 0, SETS); ++ + if (LOCK == p->lock) + unlock_resource(lc, NULL); + +diff -up 1.0.0.rc15/man/dmraid.8.rmparts 1.0.0.rc15/man/dmraid.8 +--- 1.0.0.rc15/man/dmraid.8.rmparts 2008-06-11 15:07:20.000000000 +0200 ++++ 1.0.0.rc15/man/dmraid.8 2009-02-13 12:10:11.000000000 +0100 +@@ -8,6 +8,7 @@ dmraid \- discover, configure and activa + [-f|--format FORMAT[,FORMAT...]] + [{-P|--partchar} CHAR] + [-p|--no_partitions] ++ [-Z|--rm_partitions] + [--separator SEPARATOR] + [-t|--test] + [RAID-set...] +@@ -110,7 +111,11 @@ In case metadata format handlers are cho + Useful if devices have multiple metadata signatures. + When activating RAID sets, + .B -p +-disables the activation of partitions on them. ++disables the activation of partitions on them, and ++.B -Z ++will make dmraid tell the kernel to remove the partitions from the disks ++underlying the set, ie if sda is part of the set, remove sda1, sda2, etc. ++This prevents applications from directly accessiong the disks bypassing dmraid. + RAID set names given on command line don't need to be fully specified + (eg, "dmraid -ay sil" would activate all discovered Silicon Image Medley + RAID sets). +diff -up 1.0.0.rc15/tools/commands.c.rmparts 1.0.0.rc15/tools/commands.c +--- 1.0.0.rc15/tools/commands.c.rmparts 2008-06-20 22:25:33.000000000 +0200 ++++ 1.0.0.rc15/tools/commands.c 2009-02-13 12:03:57.000000000 +0100 +@@ -38,7 +38,7 @@ static char const *short_opts = "a:hipP: + #endif + "rR:s::tv" + #endif +- "VC:S::"; ++ "VC:S::Z"; + + #ifdef HAVE_GETOPTLONG + static struct option long_opts[] = { +@@ -73,6 +73,7 @@ static struct option long_opts[] = { + {"version", no_argument, NULL, 'V'}, + {"create", required_argument, NULL, 'C'}, + {"spare", optional_argument, NULL, 'S'}, ++ {"rm_partitions", no_argument, NULL, 'Z'}, + {NULL, no_argument, NULL, 0} + }; + #endif /* #ifdef HAVE_GETOPTLONG */ +@@ -209,6 +210,7 @@ help(struct lib_context *lc, int arg) + "\t[-f|--format FORMAT[,FORMAT...]]\n" + "\t[-P|--partchar CHAR]\n" + "\t[-p|--no_partitions]\n" ++ "\t[-Z|--rm_partitions]\n" + "\t[--separator SEPARATOR]\n" "\t[RAID-set...]\n", c); + log_print(lc, "%s\t{-h|--help}\n", c); + log_print(lc, "%s\t{-V/--version}\n", c); +@@ -221,7 +223,7 @@ help(struct lib_context *lc, int arg) + "\t[-f|--format FORMAT[,FORMAT...]]\n" + "\t[-P|--partchar CHAR]\n" "\t[-p|--no_partitions]\n" + "\t[--separator SEPARATOR]\n" "\t[-t|--test]\n" +- "\t[RAID-set...]\n", c); ++ "\t[-Z|--rm_partitions] [RAID-set...]\n", c); + log_print(lc, + "%s\t{-b|--block_devices} *\n" + "\t[-c|--display_columns][FIELD[,FIELD...]]...\n" +@@ -274,7 +276,7 @@ static struct actions actions[] = { + UNDEF, /* Set in check_activate() by mandatory option argument. */ + UNDEF, + ACTIVATE | DEACTIVATE | FORMAT | HELP | IGNORELOCKING | NOPARTITIONS | +- SEPARATOR ++ SEPARATOR | RMPARTITIONS + #ifndef DMRAID_MINI + | DBG | TEST | VERBOSE + #endif +@@ -293,7 +295,8 @@ static struct actions actions[] = { + # endif + | RAID_DEVICES | RAID_SETS, + ACTIVE | INACTIVE | COLUMN | DBG | DUMP | DMERASE | GROUP | HELP | +- IGNORELOCKING | NOPARTITIONS | SEPARATOR | TEST | VERBOSE ++ IGNORELOCKING | NOPARTITIONS | SEPARATOR | TEST | VERBOSE | ++ RMPARTITIONS + #else + , UNDEF + #endif +@@ -310,7 +313,7 @@ static struct actions actions[] = { + {'P', + PARTCHAR, + ACTIVATE | DEACTIVATE, +- FORMAT | HELP | IGNORELOCKING | SEPARATOR ++ FORMAT | HELP | IGNORELOCKING | SEPARATOR | RMPARTITIONS + #ifndef DMRAID_MINI + | DBG | TEST | VERBOSE + #endif +@@ -323,7 +326,7 @@ static struct actions actions[] = { + {'p', + NOPARTITIONS, + ACTIVATE | DEACTIVATE, +- FORMAT | HELP | IGNORELOCKING | SEPARATOR ++ FORMAT | HELP | IGNORELOCKING | SEPARATOR | RMPARTITIONS + #ifndef DMRAID_MINI + | DBG | TEST | VERBOSE + #endif +@@ -573,6 +576,15 @@ static struct actions actions[] = { + check_spare_argument, + LC_HOT_SPARE_SET, + }, ++ {'Z', ++ RMPARTITIONS, ++ ACTIVATE, /* We cannot undo this on DEACTIVATE ! */ ++ DBG | FORMAT | HELP | IGNORELOCKING | NOPARTITIONS | VERBOSE | ++ SEPARATOR, ++ ARGS, ++ NULL, ++ 0, ++ }, + }; + + /* diff --git a/dmraid.changes b/dmraid.changes index 15d20ea..5ef21a3 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Aug 24 21:28:51 UTC 2009 - hvogel@novell.com + +- Fix activation of isw raid sets when the disks have serialnumber + longer then 16 characters +- Add patch adding --rm_partitions cmdline option and functionality +- Fix mismatch between BIOS and dmraid's view of ISW raid 10 sets + ------------------------------------------------------------------- Sun Aug 2 18:50:22 UTC 2009 - jansimon.moeller@opensuse.org diff --git a/dmraid.spec b/dmraid.spec index db7f2bc..39e813e 100644 --- a/dmraid.spec +++ b/dmraid.spec @@ -28,7 +28,7 @@ Group: System/Base AutoReqProv: on Summary: A Device-Mapper Software RAID Support Tool Version: 1.0.0.rc15 -Release: 6 +Release: 7 Source: ftp://people.redhat.com/heinzm/sw/dmraid/src/dmraid-%{version}.tar.bz2 Source1: sysconfig.dmraid Source2: boot.dmraid @@ -43,6 +43,9 @@ Patch4: dmraid-1.0.0.rc13-geometry.patch Patch6: dmraid-1.0.0.rc15-fix_macro.patch Patch10: dmraid-1.0.0.rc14-fixup_lsi1068e.patch Patch11: dmraid-1.0.0.rc15-scsi_serial_remove_ws.patch +Patch13: dmraid-1.0.0.rc15-isw-raid10.patch +Patch14: dmraid-1.0.0.rc15-rm_partitions.patch +Patch15: dmraid-1.0.0.rc15-isw-serial.patch Patch500: ARM_libdmraid_ldflags.diff # libdmraid-events Patch50: libdmraid-events.dif @@ -114,6 +117,9 @@ Authors: %patch6 -p1 %patch10 -p1 %patch11 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 pushd libdmraid* %patch50 %patch500 -p1