rpms/dmraid/devel format-handler-dos.patch, NONE, 1.1 metadata-stride.patch, NONE, 1.1 dmraid.spec, 1.46, 1.47
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Fri Jul 7 17:41:42 UTC 2006
Author: heinzm
Update of /cvs/dist/rpms/dmraid/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv10121
Modified Files:
dmraid.spec
Added Files:
format-handler-dos.patch metadata-stride.patch
Log Message:
Dos partition discovery fix
format-handler-dos.patch:
dos.c | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
--- NEW FILE format-handler-dos.patch ---
--- dmraid/1.0.0.rc11/lib/format/partition/dos.c 2006-01-18 13:55:09.000000000 +0100
+++ dmraid/current/lib/format/partition/dos.c 2006-07-07 16:50:12.000000000 +0200
@@ -143,6 +143,17 @@ static struct raid_set *_alloc_raid_set(
return rs;
}
+/* Check sector vs. RAID device end */
+static int rd_check_end(struct lib_context *lc,
+ struct raid_dev *rd, uint64_t sector)
+{
+ if (sector > rd->di->sectors)
+ LOG_ERR(lc, 1, "%s: partition address past end of RAID device",
+ handler);
+
+ return 0;
+}
+
/*
* Allocate a DOS RAID device and a set.
* Set the device up and add it to the set.
@@ -173,7 +184,9 @@ static int _create_rs_and_rd(struct lib_
r->offset = get_part_start(raw_part, sector);
r->sectors = (uint64_t) raw_part->length;
- if (!(rs = _alloc_raid_set(lc, r)))
+ if (rd_check_end(lc, rd, r->offset) ||
+ rd_check_end(lc, rd, r->offset + r->sectors) ||
+ !(rs = _alloc_raid_set(lc, r)))
goto free_di;
list_add_tail(&r->devs, &rs->devs);
@@ -238,13 +251,13 @@ static int group_rd_extended(struct lib_
* An entry pointing to the present logical partition.
* It is an offset from the present partition table location.
*/
- p1 = &dos->partitions[0];
+ p1 = dos->partitions;
/*
* An entry pointing to the next logical partition table.
* It is an offset from the main extended partition start.
*/
- p2 = &dos->partitions[1];
+ p2 = dos->partitions + 1;
/* If it is a partition, add it to the set */
if (is_partition(p1, start_sector) &&
@@ -301,8 +314,12 @@ static int group_rd(struct lib_context *
part_end = part_start + raw_table_entry->length;
/* Avoid infinite recursion (mostly). */
- if (part_start == start_sector ||
- part_end > rd->sectors)
+ if (part_start == start_sector)
+ continue;
+
+ /* Check bogus partition starts + ends */
+ if (rd_check_end(lc, rd, part_start) ||
+ rd_check_end(lc, rd, part_end))
continue;
/*
@@ -365,7 +382,7 @@ static struct dmraid_format dos_format =
.check = dos_check,
.events = NULL, /* Not supported */
#ifdef DMRAID_NATIVE_LOG
- .log = NULL, /* Not supported */
+ .log = NULL, /* Not supported; use fdisk and friends */
#endif
};
metadata-stride.patch:
metadata.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE metadata-stride.patch ---
--- dmraid/1.0.0.rc11/lib/metadata/metadata.c 2006-03-28 16:03:13.000000000 +0200
+++ dmraid/current/lib/metadata/metadata.c 2006-07-06 17:56:52.000000000 +0200
@@ -120,7 +120,7 @@ const char *get_status(struct lib_contex
static uint64_t add_sectors(struct raid_set *rs, uint64_t sectors,
uint64_t add)
{
- add = round_down(add, rs->stride);
+ add = rs->stride ? round_down(add, rs->stride) : add;
if (T_RAID1(rs)) {
if (!sectors || sectors > add)
Index: dmraid.spec
===================================================================
RCS file: /cvs/dist/rpms/dmraid/devel/dmraid.spec,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- dmraid.spec 16 May 2006 17:14:40 -0000 1.46
+++ dmraid.spec 7 Jul 2006 17:41:38 -0000 1.47
@@ -7,13 +7,15 @@
Summary: dmraid (Device-mapper RAID tool and library)
Name: dmraid
Version: 1.0.0.rc11
-Release: FC6
+Release: FC6.1
License: GPL
Group: System Environment/Base
URL: http://people.redhat.com/heinzm/sw/dmraid
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: device-mapper >= 1.02.02-2, libselinux-devel, libsepol-devel
Source: ftp://people.redhat.com/heinzm/sw/dmraid/src/dmraid-%{version}.tar.bz2
+Patch0: metadata-stride.patch
+Patch1: format-handler-dos.patch
ExcludeArch: s390
ExcludeArch: s390x
@@ -33,7 +35,10 @@
RAID set activation and display of properties for ATARAID volumes.
%prep
+
%setup -q -n dmraid/%{version}
+%patch0 -p1
+%patch1 -p1
%build
%configure --prefix=${RPM_BUILD_ROOT}/usr --sbindir=${RPM_BUILD_ROOT}/sbin --libdir=${RPM_BUILD_ROOT}/%{_libdir} --mandir=${RPM_BUILD_ROOT}/%{_mandir} --includedir=${RPM_BUILD_ROOT}/%{_includedir} --enable-debug --enable-libselinux --enable-libsepol --enable-static_link
@@ -89,6 +94,9 @@
%endif
%changelog
+* Tue July 7 2006 Heinz Mauelshagen <jheinzm at redhat.com> - 1.0.0.rc11-FC6.1
+- rebuilt for FC6 with dos partition discovery fix (#197573)
+
* Tue May 16 2006 Heinz Mauelshagen <jheinzm at redhat.com> - 1.0.0.rc11-FC6
- rebuilt for FC6 with better tag
More information about the fedora-cvs-commits
mailing list