-Changes Prior to 1.0.0 reease
+Changes Prior to this release
+ - Round off MB/GiB etc values instead of round down.
+ - Add --sparc2.2 option to examine to shift superblock around
+ and --sparc2.2update to rewrite the superblock
+
+Changes Prior to 1.0.0 release
- Allow --config with Misc mode (for --examine --scan)
- Add $(CXFLAGS) to end of CFLAGS in makefile
- When making an N disk raid5 array, the Nth drive
#endif
#include "md_u.h"
#include "md_p.h"
-int Examine(mddev_dev_t devlist, int brief, int scan)
+int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust)
{
/* Read the raid superblock from a device and
printf(" Checksum : %x - correct\n", super.sb_csum);
else
printf(" Checksum : %x - expected %x\n", super.sb_csum, calc_sb_csum(&super));
+ if (SparcAdjust) {
+ /* 2.2 sparc put the events in the wrong place
+ * So we copy the tail of the superblock
+ * up 4 bytes before continuing
+ */
+ __u32 *sb32 = (__u32*)&super;
+ memcpy(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
+ sb32+MD_SB_GENERIC_CONSTANT_WORDS+7+1,
+ MD_SB_WORDS - (MD_SB_GENERIC_CONSTANT_WORDS+7+1));
+ printf (" --- adjusting superblock for 2.2/sparc compatability ---\n");
+ }
printf(" Events : %d.%d\n", super.events_hi, super.events_lo);
printf("\n");
if (super.level == 5) {
printf("\n");
}
}
+ if (SparcAdjust == 2) {
+ printf(" ----- updating superblock on device ----\n");
+ fd = open(devlist->devname, O_RDWR);
+ if (fd < 0) {
+ fprintf(stderr, Name ": cannot open %s to update superblock: %s\n",
+ devlist->devname, strerror(errno));
+ err = 1;
+ } else {
+ super.sb_csum = calc_sb_csum(&super);
+ if (store_super(fd, &super)) {
+ fprintf(stderr, Name ": Count not re-write superblock on %s\n",
+ devlist->devname);
+ err = 1;
+ }
+ close(fd);
+ }
+ }
}
if (brief) {
struct array *ap;
#include "mdadm.h"
-char Version[] = Name " - v1.0.0 - 10 May 2002\n";
+char Version[] = Name " - v1.0.1 - 20 May 2002\n";
/*
* File: ReadMe.c
*
/* For Detail/Examine */
{"brief", 0, 0, 'b'},
+ {"sparc2.2", 0, 0, 22},
+ {"sparc2.2update", 0, 0, 23},
/* For Follow/monitor */
{"mail", 1, 0, 'm'},
will also be monitored.
The result of monitoring the arrays is the generation of events.
-These events are passed to a separate program (is specified) and may
+These events are passed to a separate program (if specified) and may
be mailed to a given E-mail address.
+When passing event to program, the program is run once for each event
+and is given 2 or 3 command-line arguements. The first is the
+name of the event (see below). The second is the name of the
+md device which is affected, and the third is the name of a related
+device if relevant, such as a component device that has failed.
If
.B --scan
char devmode = 0;
int runstop = 0;
int readonly = 0;
+ int SparcAdjust = 0;
mddev_dev_t devlist = NULL;
mddev_dev_t *devlistend = & devlist;
mddev_dev_t dv;
devmode = opt;
continue;
+ case O(MISC, 22):
+ if (devmode != 'E') {
+ fprintf(stderr, Name ": --sparc2.2 only allowed with --examine\n");
+ exit(2);
+ }
+ SparcAdjust = 1;
+ continue;
+ case O(MISC,23):
+ if (devmode != 'E') {
+ fprintf(stderr, Name ": --sparc2.2update only allowed with --examine\n");
+ exit(2);
+ }
+ SparcAdjust = 2;
+ continue;
}
/* We have now processed all the valid options. Anything else is
* an error
fprintf(stderr, Name ": No devices listed in %s\n", configfile?configfile:DefaultConfFile);
exit(1);
}
- rv = Examine(devlist, scan?!verbose:brief, scan);
+ rv = Examine(devlist, scan?!verbose:brief, scan, SparcAdjust);
} else {
if (devlist == NULL) {
if ((devmode == 'S' ||devmode=='D') && scan) {
extern int Detail(char *dev, int brief);
extern int Query(char *dev);
-extern int Examine(mddev_dev_t devlist, int brief, int scan);
+extern int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust);
extern int Monitor(mddev_dev_t devlist,
char *mailaddr, char *alert_cmd,
int period, int scan,
Summary: mdadm is used for controlling Linux md devices (aka RAID arrays)
Name: mdadm
-Version: 1.0.0
+Version: 1.0.1
Release: 1
Source: http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz
URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/
else if (bytes < 2*1024LL*1024LL*1024LL)
sprintf(buf, " (%ld.%02ld MiB %ld.%02ld MB)",
(long)(bytes>>20),
- (long)(bytes&0xfffff)/(0x100000/100),
+ (long)((bytes&0xfffff)+0x100000/200)/(0x100000/100),
(long)(bytes/1000/1000),
- (long)((bytes%1000000)/10000)
+ (long)(((bytes%1000000)+5000)/10000)
);
else
sprintf(buf, " (%ld.%02ld GiB %ld.%02ld GB)",
(long)(bytes>>30),
- (long)((bytes>>10)&0xfffff)/(0x100000/100),
+ (long)(((bytes>>10)&0xfffff)+0x100000/200)/(0x100000/100),
(long)(bytes/1000LL/1000LL/1000LL),
- (long)(((bytes/1000)%1000000)/10000)
+ (long)((((bytes/1000)%1000000)+50000)/10000)
);
return buf;
}
if (bytes < 5000*1024)
sprintf(buf, "%ld.%02ldKiB",
- (long)(bytes>>10), (long)((bytes&1023)*100/1024)
+ (long)(bytes>>10), (long)(((bytes&1023)*100+512)/1024)
);
else if (bytes < 2*1024LL*1024LL*1024LL)
sprintf(buf, "%ld.%02ldMiB",
(long)(bytes>>20),
- (long)(bytes&0xfffff)/(0x100000/100)
+ (long)((bytes&0xfffff)+0x100000/200)/(0x100000/100)
);
else
sprintf(buf, "%ld.%02ldGiB",
(long)(bytes>>30),
- (long)((bytes>>10)&0xfffff)/(0x100000/100)
+ (long)(((bytes>>10)&0xfffff)+0x100000/200)/(0x100000/100)
);
return buf;
}