- Update to latest upstream and remove patches upstream has taken

This commit is contained in:
Doug Ledford 2007-10-19 16:38:10 +00:00
parent b8f70183b9
commit 7fd02eb529
10 changed files with 21 additions and 273 deletions

View File

@ -7,3 +7,4 @@ mdadm-2.5.4.tgz
mdadm-2.6.tgz mdadm-2.6.tgz
mdadm-2.6.1.tgz mdadm-2.6.1.tgz
mdadm-2.6.2.tgz mdadm-2.6.2.tgz
mdadm-2.6.4.tgz

View File

@ -1,18 +1,23 @@
--- mdadm-2.6.1/Makefile.build 2007-04-11 11:12:46.000000000 -0400 --- mdadm-2.6.4/Makefile.build 2007-10-19 12:32:03.000000000 -0400
+++ mdadm-2.6.1/Makefile 2007-04-11 11:18:54.000000000 -0400 +++ mdadm-2.6.4/Makefile 2007-10-19 12:32:17.000000000 -0400
@@ -100,9 +100,11 @@ mdadm.static : $(OBJS) $(STATICOBJS) @@ -102,13 +102,15 @@ mdadm.static : $(OBJS) $(STATICOBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS) $(CC) $(CFLAGS) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS)
mdadm.tcc : $(SRCS) mdadm.h mdadm.tcc : $(SRCS) mdadm.h
+ rm -f $(OBJS) + rm -f $(OBJS) $(STATICOBJS)
$(TCC) -o mdadm.tcc $(SRCS) $(TCC) -o mdadm.tcc $(SRCS)
mdadm.uclibc : $(SRCS) mdadm.h dadm.uclibc : $(SRCS) mdadm.h
+ rm -f $(OBJS) $(STATICOBJS) + rm -f $(OBJS) $(STATICOBJS)
$(UCLIBC_GCC) -DUCLIBC -DHAVE_STDINT_H -o mdadm.uclibc $(SRCS) $(STATICSRC) $(UCLIBC_GCC) -DUCLIBC -DHAVE_STDINT_H -o mdadm.uclibc $(SRCS) $(STATICSRC)
mdadm.klibc : $(SRCS) mdadm.h mdadm.klibc : $(SRCS) mdadm.h
@@ -113,15 +115,15 @@ test_stripe : restripe.c mdadm.h - rm -f $(OBJS)
+ rm -f $(OBJS) $(STATICOBJS)
gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS)
mdadm.Os : $(SRCS) mdadm.h
@@ -121,15 +123,15 @@ test_stripe : restripe.c mdadm.h
$(CC) $(CXFLAGS) $(LDFLAGS) -o test_stripe -DMAIN restripe.c $(CC) $(CXFLAGS) $(LDFLAGS) -o test_stripe -DMAIN restripe.c
mdassemble : $(ASSEMBLE_SRCS) mdadm.h mdassemble : $(ASSEMBLE_SRCS) mdadm.h
@ -34,7 +39,7 @@
$(UCLIBC_GCC) $(ASSEMBLE_FLAGS) -DUCLIBC -DHAVE_STDINT_H -static -o mdassemble.uclibc $(ASSEMBLE_SRCS) $(STATICSRC) $(UCLIBC_GCC) $(ASSEMBLE_FLAGS) -DUCLIBC -DHAVE_STDINT_H -static -o mdassemble.uclibc $(ASSEMBLE_SRCS) $(STATICSRC)
# This doesn't work # This doesn't work
@@ -164,10 +166,10 @@ install-klibc : mdadm.klibc install-man @@ -172,10 +174,10 @@ install-klibc : mdadm.klibc install-man
$(INSTALL) -D -m 755 mdadm.klibc $(DESTDIR)$(BINDIR)/mdadm $(INSTALL) -D -m 755 mdadm.klibc $(DESTDIR)$(BINDIR)/mdadm
install-man: mdadm.8 mdassemble.8 md.4 mdadm.conf.5 install-man: mdadm.8 mdassemble.8 md.4 mdadm.conf.5

View File

@ -1,88 +0,0 @@
--- mdadm-2.6.2/super1.c.ver1 2007-05-21 00:25:40.000000000 -0400
+++ mdadm-2.6.2/super1.c 2007-07-09 14:19:50.000000000 -0400
@@ -152,9 +152,17 @@ static void examine_super1(void *sbv, ch
char *c;
int l = homehost ? strlen(homehost) : 0;
int layout;
+ unsigned long long sb_offset;
printf(" Magic : %08x\n", __le32_to_cpu(sb->magic));
- printf(" Version : %02d\n", 1);
+ printf(" Version : 1");
+ sb_offset = __le64_to_cpu(sb->super_offset);
+ if (sb_offset <= 4)
+ printf(".1\n");
+ else if (sb_offset <= 8)
+ printf(".2\n");
+ else
+ printf(".0\n");
printf(" Feature Map : 0x%x\n", __le32_to_cpu(sb->feature_map));
printf(" Array UUID : ");
for (i=0; i<16; i++) {
@@ -337,6 +345,7 @@ static void brief_examine_super1(void *s
{
struct mdp_superblock_1 *sb = sbv;
int i;
+ unsigned long long sb_offset;
char *nm;
char *c=map_num(pers, __le32_to_cpu(sb->level));
@@ -348,9 +357,15 @@ static void brief_examine_super1(void *s
else
nm = "??";
- printf("ARRAY /dev/md/%s level=%s metadata=1 num-devices=%d UUID=",
- nm,
- c?c:"-unknown-", __le32_to_cpu(sb->raid_disks));
+ printf("ARRAY /dev/md/%s level=%s ", nm, c?c:"-unknown-");
+ sb_offset = __le64_to_cpu(sb->super_offset);
+ if (sb_offset <= 4)
+ printf("metadata=1.1 ");
+ else if (sb_offset <= 8)
+ printf("metadata=1.2 ");
+ else
+ printf("metadata=1.0 ");
+ printf("num-devices=%d UUID=", __le32_to_cpu(sb->raid_disks));
for (i=0; i<16; i++) {
if ((i&3)==0 && i != 0) printf(":");
printf("%02x", sb->set_uuid[i]);
@@ -975,7 +990,7 @@ static int load_super1(struct supertype
struct misc_dev_info *misc;
- if (st->ss == NULL) {
+ if (st->ss == NULL || st->minor_version == -1) {
int bestvers = -1;
__u64 bestctime = 0;
/* guess... choose latest ctime */
@@ -1123,9 +1138,7 @@ static struct supertype *match_metadata_
st->ss = &super1;
st->max_devs = 384;
- if (strcmp(arg, "1") == 0 ||
- strcmp(arg, "1.0") == 0 ||
- strcmp(arg, "default/large") == 0) {
+ if (strcmp(arg, "1.0") == 0) {
st->minor_version = 0;
return st;
}
@@ -1137,6 +1150,11 @@ static struct supertype *match_metadata_
st->minor_version = 2;
return st;
}
+ if (strcmp(arg, "1") == 0 ||
+ strcmp(arg, "default/large") == 0) {
+ st->minor_version = -1;
+ return st;
+ }
free(st);
return NULL;
@@ -1154,6 +1172,7 @@ static __u64 avail_size1(struct supertyp
devsize -= choose_bm_space(devsize);
switch(st->minor_version) {
+ case -1:
case 0:
/* at end */
return ((devsize - 8*2 ) & ~(4*2-1));

View File

@ -1,26 +0,0 @@
--- mdadm-2.6.2/Create.c.info 2007-07-03 10:18:38.000000000 -0400
+++ mdadm-2.6.2/Create.c 2007-07-03 11:06:23.000000000 -0400
@@ -81,6 +81,14 @@ int Create(struct supertype *st, char *m
if (vers < 9000) {
fprintf(stderr, Name ": Create requires md driver version 0.90.0 or later\n");
return 1;
+ } else {
+ mdu_array_info_t inf;
+ memset(&inf, 0, sizeof(inf));
+ ioctl(mdfd, GET_ARRAY_INFO, &inf);
+ if (inf.working_disks != 0) {
+ fprintf(stderr, Name ": another array by this name already running.\n");
+ return 1;
+ }
}
if (level == UnSet) {
fprintf(stderr,
@@ -225,7 +233,7 @@ int Create(struct supertype *st, char *m
}
if (st->ss->major != 0 ||
st->minor_version != 90)
- fprintf(stderr, Name ": Defaulting to verion %d.%d metadata\n",
+ fprintf(stderr, Name ": Defaulting to version %d.%d metadata\n",
st->ss->major,
st->minor_version);
}

View File

@ -1,33 +0,0 @@
--- mdadm-2.6.2/Monitor.c.leak 2007-07-06 12:20:05.000000000 -0400
+++ mdadm-2.6.2/Monitor.c 2007-07-06 12:21:44.000000000 -0400
@@ -234,6 +234,7 @@ int Monitor(mddev_dev_t devlist,
*/ st->err=1;
continue;
}
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
if (ioctl(fd, GET_ARRAY_INFO, &array)<0) {
if (!st->err)
alert("DeviceDisappeared", dev, NULL,
--- mdadm-2.6.2/mdstat.c.leak 2006-12-18 21:35:17.000000000 -0500
+++ mdadm-2.6.2/mdstat.c 2007-07-06 12:19:55.000000000 -0400
@@ -114,6 +114,8 @@ struct mdstat_ent *mdstat_read(int hold,
f = fopen("/proc/mdstat", "r");
if (f == NULL)
return NULL;
+ else
+ fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
all = NULL;
end = &all;
@@ -221,8 +223,10 @@ struct mdstat_ent *mdstat_read(int hold,
end = &ent->next;
}
}
- if (hold && mdstat_fd == -1)
+ if (hold && mdstat_fd == -1) {
mdstat_fd = dup(fileno(f));
+ fcntl(mdstat_fd, F_SETFD, FD_CLOEXEC);
+ }
fclose(f);
/* If we might want to start array,

View File

@ -1,50 +0,0 @@
--- mdadm-2.6.2/mdadm.h.manage 2007-07-03 15:37:10.000000000 -0400
+++ mdadm-2.6.2/mdadm.h 2007-07-03 15:37:53.000000000 -0400
@@ -155,6 +155,7 @@ enum mode {
};
extern char short_options[];
+extern char short_bitmap_options[];
extern char short_bitmap_auto_options[];
extern struct option long_options[];
extern char Version[], Usage[], Help[], OptionHelp[],
--- mdadm-2.6.2/mdadm.c.manage 2007-07-03 13:21:40.000000000 -0400
+++ mdadm-2.6.2/mdadm.c 2007-07-03 15:35:54.000000000 -0400
@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
switch(opt) {
case '@': /* just incase they say --manage */
newmode = MANAGE;
- shortopt = short_bitmap_auto_options;
+ shortopt = short_bitmap_options;
break;
case 'a':
case 'r':
@@ -188,7 +188,7 @@ int main(int argc, char *argv[])
case ReAdd: /* re-add */
if (!mode) {
newmode = MANAGE;
- shortopt = short_bitmap_auto_options;
+ shortopt = short_bitmap_options;
}
break;
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
case 'B': newmode = BUILD; shortopt = short_bitmap_auto_options; break;
case 'C': newmode = CREATE; shortopt = short_bitmap_auto_options; break;
case 'F': newmode = MONITOR;break;
- case 'G': newmode = GROW; shortopt = short_bitmap_auto_options; break;
+ case 'G': newmode = GROW; shortopt = short_bitmap_options; break;
case 'I': newmode = INCREMENTAL; break;
case AutoDetect:
newmode = AUTODETECT; break;
--- mdadm-2.6.2/ReadMe.c.manage 2007-07-03 15:37:35.000000000 -0400
+++ mdadm-2.6.2/ReadMe.c 2007-07-03 15:36:00.000000000 -0400
@@ -87,6 +87,8 @@ char Version[] = Name " - v2.6.2 - 21st
*/
char short_options[]="-ABCDEFGIQhVXWvqbc:i:l:p:m:n:x:u:c:d:z:U:sarfRSow1tye:";
+char short_bitmap_options[]=
+ "-ABCDEFGIQhVXWvqb:c:i:l:p:m:n:x:u:c:d:z:U:sarfRSow1tye:";
char short_bitmap_auto_options[]=
"-ABCDEFGIQhVXWvqb:c:i:l:p:m:n:x:u:c:d:z:U:sa:rfRSow1tye:";

View File

@ -1,53 +0,0 @@
--- mdadm-2.6.2/Monitor.c.raid4 2007-07-03 12:10:34.000000000 -0400
+++ mdadm-2.6.2/Monitor.c 2007-07-03 12:28:30.000000000 -0400
@@ -244,8 +244,10 @@ int Monitor(mddev_dev_t devlist,
close(fd);
continue;
}
- if (array.level != 1 && array.level != 5 && array.level != -4 &&
- array.level != 6 && array.level != 10) {
+ /* It's much easier to list what array levels can't
+ * have a device disappear than all of them that can
+ */
+ if (array.level == 0 || array.level == -1) {
if (!st->err)
alert("DeviceDisappeared", dev, "Wrong-Level",
mailaddr, mailfrom, alert_cmd, dosyslog);
@@ -399,9 +401,8 @@ int Monitor(mddev_dev_t devlist,
struct mdstat_ent *mse;
for (mse=mdstat; mse; mse=mse->next)
if (mse->devnum != MAXINT &&
- (strcmp(mse->level, "raid1")==0 ||
- strcmp(mse->level, "raid5")==0 ||
- strcmp(mse->level, "multipath")==0)
+ (strcmp(mse->level, "raid0")!=0 &&
+ strcmp(mse->level, "linear")!=0)
) {
struct state *st = malloc(sizeof *st);
mdu_array_info_t array;
--- mdadm-2.6.2/Create.c.raid4 2007-07-03 11:47:26.000000000 -0400
+++ mdadm-2.6.2/Create.c 2007-07-03 11:47:26.000000000 -0400
@@ -313,12 +313,13 @@ int Create(struct supertype *st, char *m
}
}
- /* If this is raid5, we want to configure the last active slot
+ /* If this is raid4/5, we want to configure the last active slot
* as missing, so that a reconstruct happens (faster than re-parity)
* FIX: Can we do this for raid6 as well?
*/
if (assume_clean==0 && force == 0 && first_missing >= raiddisks) {
switch ( level ) {
+ case 4:
case 5:
insert_point = raiddisks-1;
sparedisks++;
@@ -343,7 +344,7 @@ int Create(struct supertype *st, char *m
array.md_minor = minor(stb.st_rdev);
array.not_persistent = 0;
/*** FIX: Need to do something about RAID-6 here ***/
- if ( ( (level == 5) &&
+ if ( ( (level == 4 || level == 5) &&
(insert_point < raiddisks || first_missing < raiddisks) )
||
( level == 6 && missing_disks == 2)

View File

@ -1,7 +1,7 @@
Summary: The mdadm program controls Linux md devices (software RAID arrays) Summary: The mdadm program controls Linux md devices (software RAID arrays)
Name: mdadm Name: mdadm
Version: 2.6.2 Version: 2.6.4
Release: 5%{?dist} Release: 1%{?dist}
Source: http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz Source: http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz
Source1: mdmonitor.init Source1: mdmonitor.init
Patch1: mdadm-2.5.2-s390-build.patch Patch1: mdadm-2.5.2-s390-build.patch
@ -9,11 +9,6 @@ Patch2: mdadm-2.5.2-static.patch
Patch3: mdadm-2.2-nodiet.patch Patch3: mdadm-2.2-nodiet.patch
Patch4: mdadm-2.5.2-cflags.patch Patch4: mdadm-2.5.2-cflags.patch
Patch5: mdadm-2.6.1-build.patch Patch5: mdadm-2.6.1-build.patch
Patch6: mdadm-2.6.2-file-leak.patch
Patch7: mdadm-2.6.2-assemble-ver1-superblock.patch
Patch8: mdadm-2.6.2-create.patch
Patch9: mdadm-2.6.2-raid4.patch
Patch10: mdadm-2.6.2-manage.patch
URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/ URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/
License: GPL License: GPL
Group: System Environment/Base Group: System Environment/Base
@ -37,11 +32,6 @@ file can be used to help with some common tasks.
%patch3 -p1 -b .nodiet %patch3 -p1 -b .nodiet
%patch4 -p1 -b .cflags %patch4 -p1 -b .cflags
%patch5 -p1 -b .build %patch5 -p1 -b .build
%patch6 -p1 -b .leak
%patch7 -p1 -b .ver1
%patch8 -p1 -b .create
%patch9 -p1 -b .raid4
%patch10 -p1 -b .manage
%build %build
make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" SYSCONFDIR="%{_sysconfdir}" MDASSEMBLE_AUTO=1 mdassemble.static mdassemble mdadm.static mdadm make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" SYSCONFDIR="%{_sysconfdir}" MDASSEMBLE_AUTO=1 mdassemble.static mdassemble mdadm.static mdadm
@ -89,6 +79,9 @@ fi
%attr(0700,root,root) %dir /var/run/mdadm %attr(0700,root,root) %dir /var/run/mdadm
%changelog %changelog
* Fri Oct 19 2007 Doug Ledford <dledford@redhat.com> - 2.6.4-1
- Update to latest upstream and remove patches upstream has taken
* Tue Aug 28 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.6.2-5 * Tue Aug 28 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.6.2-5
- Rebuild for selinux ppc32 issue. - Rebuild for selinux ppc32 issue.

View File

@ -48,6 +48,7 @@ start ()
checkpid `cat $PIDFILE` && return 0 checkpid `cat $PIDFILE` && return 0
fi fi
echo -n $"Starting $prog: " echo -n $"Starting $prog: "
cd /
daemon --user=root mdadm ${OPTIONS} daemon --user=root mdadm ${OPTIONS}
ret=$? ret=$?
[ $ret -eq "0" ] && touch /var/lock/subsys/$prog [ $ret -eq "0" ] && touch /var/lock/subsys/$prog
@ -82,9 +83,7 @@ case "$1" in
status) status mdadm; RETVAL=$? ;; status) status mdadm; RETVAL=$? ;;
restart) restart; RETVAL=$? ;; restart) restart; RETVAL=$? ;;
reload) RETVAL=3 ;; reload) RETVAL=3 ;;
condrestart) condrestart; RETVAL=$? ;; condrestart|try-restart|force-reload) condrestart; RETVAL=$? ;;
try-restart) condrestart; RETVAL=$? ;;
force-reload) condrestart; RETVAL=$? ;;
*) usage ; RETVAL=2 ;; *) usage ; RETVAL=2 ;;
esac esac

View File

@ -1 +1 @@
e34d2590523d679895966c4111670450 mdadm-2.6.2.tgz 4235fc330c9d51e6e613a6eee7ebca76 mdadm-2.6.4.tgz