Update to latest upstream version

Resolves: bz714083
This commit is contained in:
Milan Broz 2011-06-28 19:24:00 +02:00
parent 430833937e
commit 6a0405ae85
6 changed files with 197 additions and 188 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ clog
*.src.rpm
*/
/mdadm-3.2.1.tar.bz2
/mdadm-3.2.2.tar.bz2

View File

@ -1,165 +0,0 @@
--- mdadm-3.2.1/sysfs.c.param 2011-03-28 11:28:13.599402233 -0400
+++ mdadm-3.2.1/sysfs.c 2011-03-28 11:48:02.593714836 -0400
@@ -418,7 +418,7 @@ int sysfs_set_num(struct mdinfo *sra, st
int sysfs_uevent(struct mdinfo *sra, char *event)
{
char fname[50];
- int n;
+ unsigned int n;
int fd;
sprintf(fname, "/sys/block/%s/uevent",
@@ -428,6 +428,11 @@ int sysfs_uevent(struct mdinfo *sra, cha
return -1;
n = write(fd, event, strlen(event));
close(fd);
+ if (n != strlen(event)) {
+ dprintf(Name ": failed to write '%s' to '%s' (%s)\n",
+ event, fname, strerror(errno));
+ return -1;
+ }
return 0;
}
--- mdadm-3.2.1/mdadm.c.param 2011-03-28 10:38:12.035258787 -0400
+++ mdadm-3.2.1/mdadm.c 2011-03-28 10:39:33.346082070 -0400
@@ -103,7 +103,9 @@ int main(int argc, char *argv[])
char *shortopt = short_options;
int dosyslog = 0;
int rebuild_map = 0;
+#if 0
int auto_update_home = 0;
+#endif
char *subarray = NULL;
char *remove_path = NULL;
char *udev_filename = NULL;
@@ -1325,11 +1327,13 @@ int main(int argc, char *argv[])
cnt++;
acnt++;
}
+#if 0
if (rv2 == 1)
/* found something so even though assembly failed we
* want to avoid auto-updates
*/
auto_update_home = 0;
+#endif
} while (rv2!=2);
/* Incase there are stacked devices, we need to go around again */
} while (acnt);
--- mdadm-3.2.1/mdmon.c.param 2011-03-28 11:29:41.128681560 -0400
+++ mdadm-3.2.1/mdmon.c 2011-03-28 11:30:54.514946394 -0400
@@ -513,6 +513,9 @@ static int mdmon(char *devname, int devn
ignore = dup(0);
#endif
+ if (ignore)
+ ignore++;
+
do_manager(container);
exit(0);
--- mdadm-3.2.1/Grow.c.param 2011-03-28 10:38:12.038259001 -0400
+++ mdadm-3.2.1/Grow.c 2011-03-28 10:45:28.174500010 -0400
@@ -1312,7 +1312,6 @@ int Grow_reshape(char *devname, int fd,
char *subarray = NULL;
int frozen;
- int changed = 0;
char *container = NULL;
char container_buf[20];
int cfd = -1;
@@ -1479,7 +1478,6 @@ int Grow_reshape(char *devname, int fd,
if (!quiet)
fprintf(stderr, Name ": component size of %s has been set to %lluK\n",
devname, size);
- changed = 1;
} else if (array.level != LEVEL_CONTAINER) {
size = get_component_size(fd)/2;
if (size == 0)
--- mdadm-3.2.1/Query.c.param 2011-03-28 10:38:12.040259145 -0400
+++ mdadm-3.2.1/Query.c 2011-03-28 10:41:19.272668999 -0400
@@ -35,7 +35,7 @@ int Query(char *dev)
int fd = open(dev, O_RDONLY);
int vers;
int ioctlerr;
- int superror, superrno;
+ int superror;
struct mdinfo info;
mdu_array_info_t array;
struct supertype *st = NULL;
@@ -84,7 +84,6 @@ int Query(char *dev)
st = guess_super(fd);
if (st) {
superror = st->ss->load_super(st, fd, dev);
- superrno = errno;
} else
superror = -1;
close(fd);
--- mdadm-3.2.1/super1.c.param 2011-03-28 10:38:12.043259360 -0400
+++ mdadm-3.2.1/super1.c 2011-03-28 10:53:14.423905054 -0400
@@ -111,7 +111,6 @@ static unsigned int calc_sb_1_csum(struc
unsigned long long newcsum;
int size = sizeof(*sb) + __le32_to_cpu(sb->max_dev)*2;
unsigned int *isuper = (unsigned int*)sb;
- int i;
/* make sure I can count... */
if (offsetof(struct mdp_superblock_1,data_offset) != 128 ||
@@ -123,7 +122,7 @@ static unsigned int calc_sb_1_csum(struc
disk_csum = sb->sb_csum;
sb->sb_csum = 0;
newcsum = 0;
- for (i=0; size>=4; size -= 4 ) {
+ for (; size>=4; size -= 4 ) {
newcsum += __le32_to_cpu(*isuper);
isuper++;
}
@@ -387,15 +386,11 @@ static void examine_super1(struct supert
printf(" Array State : ");
for (d=0; d<__le32_to_cpu(sb->raid_disks) + delta_extra; d++) {
int cnt = 0;
- int me = 0;
unsigned int i;
for (i=0; i< __le32_to_cpu(sb->max_dev); i++) {
unsigned int role = __le16_to_cpu(sb->dev_roles[i]);
- if (role == d) {
- if (i == __le32_to_cpu(sb->dev_number))
- me = 1;
+ if (role == d)
cnt++;
- }
}
if (cnt > 1) printf("?");
else if (cnt == 1) printf("A");
--- mdadm-3.2.1/Incremental.c.param 2011-03-28 10:38:12.045259502 -0400
+++ mdadm-3.2.1/Incremental.c 2011-03-28 11:31:41.924347665 -0400
@@ -707,7 +707,7 @@ static int count_active(struct supertype
int cnt = 0;
__u64 max_events = 0;
char *avail = NULL;
- int *best;
+ int *best = NULL;
char *devmap = NULL;
int numdevs = 0;
int devnum;
--- mdadm-3.2.1/super-intel.c.param 2011-03-28 10:38:12.048259718 -0400
+++ mdadm-3.2.1/super-intel.c 2011-03-28 11:33:53.898816208 -0400
@@ -6164,7 +6164,7 @@ static int apply_takeover_update(struct
{
struct imsm_dev *dev = NULL;
struct intel_dev *dv;
- struct imsm_dev *dev_new;
+ struct imsm_dev *dev_new = NULL;
struct imsm_map *map;
struct dl *dm, *du;
int i;
@@ -7008,7 +7008,7 @@ static int imsm_create_metadata_update_f
int update_memory_size = 0;
struct imsm_update_reshape *u = NULL;
struct mdinfo *spares = NULL;
- int i;
+ int i = -1;
int delta_disks = 0;
struct mdinfo *dev;

View File

@ -1,24 +1,24 @@
--- mdadm-3.2.1.old/super-intel.c 2011-06-05 07:45:46.000000000 +0200
+++ mdadm-3.2.1/super-intel.c 2011-06-05 08:00:46.267901743 +0200
@@ -7317,7 +7317,7 @@ static int imsm_reshape_super(struct sup
*/
struct intel_super *super = st->sb;
struct intel_dev *dev = super->devlist;
- int change, devnum;
+ int change, devnum = 0;
dprintf("imsm: info: Volume operation\n");
/* find requested device */
while (dev) {
--- mdadm-3.2.1.old/util.c 2011-03-28 04:31:20.000000000 +0200
+++ mdadm-3.2.1/util.c 2011-06-05 07:59:03.741904751 +0200
@@ -154,8 +154,8 @@ int get_linux_version()
--- a/util.c
+++ b/util.c
@@ -146,16 +146,16 @@ int get_linux_version()
{
struct utsname name;
char *cp;
- int a,b,c;
+ int a = 0, b = 0,c = 0;
if (uname(&name) <0)
return -1;
cp = name.release;
a = strtoul(cp, &cp, 10);
if (*cp != '.') return -1;
b = strtoul(cp+1, &cp, 10);
- if (*cp != '.') return -1;
- b = strtoul(cp+1, &cp, 10);
- if (*cp != '.') return -1;
- c = strtoul(cp+1, NULL, 10);
+ if (*cp != '.' && a <= 2) return -1;
+ c = (*cp == '.') ? strtoul(cp+1, NULL, 10) : 0;
+ if (*cp == '.')
+ b = strtoul(cp+1, &cp, 10);
+ if (*cp == '.')
+ c = strtoul(cp+1, &cp, 10);
return (a*1000000)+(b*1000)+c;
}

169
mdadm-3.2.2-man.patch Normal file
View File

@ -0,0 +1,169 @@
--- a/mdadm.8.in
+++ b/mdadm.8.in
@@ -706,7 +706,7 @@ facts the operator knows.
When an array is resized to a larger size with
.B "\-\-grow \-\-size="
the new space is normally resynced in that same way that the whole
-array is resynced at creation. From Linux version 2.6.40,
+array is resynced at creation. From Linux version 3.0,
.B \-\-assume\-clean
can be used with that command to avoid the automatic resync.
@@ -811,6 +811,11 @@ number, and there is no entry in /dev for that number and with a
non-standard name. Names that are not in 'standard' format are only
allowed in "/dev/md/".
+This is meaningful with
+.B \-\-create
+or
+.BR \-\-build .
+
.ig XX
.\".TP
.\".BR \-\-symlink = no
@@ -835,6 +840,28 @@ allowed in "/dev/md/".
.\"
.XX
+.TP
+.BR \-a ", " "\-\-add"
+This option can be used in Grow mode in two cases.
+
+If the target array is a Linear array, then
+.B \-\-add
+can be used to add one or more devices to the array. They
+are simply catenated on to the end of the array. Once added, the
+devices cannot be removed.
+
+If the
+.B \-\-raid\-disks
+option is being used to increase the number of devices in an array,
+then
+.B \-\-add
+can be used to add some extra devices to be included in the array.
+In most cases this is not needed as the extra devices can be added as
+spares first, and then the number of raid-disks can be changed.
+However for RAID0, it is not possible to add spares. So to increase
+the number of devices in a RAID0, it is necessary to set the new
+number of devices, and to add the new devices, in the same command.
+
.SH For assemble:
.TP
@@ -912,28 +939,6 @@ not as reliable as you would like.
See this option under Create and Build options.
.TP
-.BR \-a ", " "\-\-add"
-This option can be used in Grow mode in two cases.
-
-If the target array is a Linear array, then
-.B \-\-add
-can be used to add one or more devices to the array. They
-are simply catenated on to the end of the array. Once added, the
-devices cannot be removed.
-
-If the
-.B \-\-raid\-disks
-option is being used to increase the number of devices in an array,
-then
-.B \-\-add
-can be used to add some extra devices to be included in the array.
-In most cases this is not needed as the extra devices can be added as
-spares first, and then the number of raid-disks can be changed.
-However for RAID0, it is not possible to add spares. So to increase
-the number of devices in a RAID0, it is necessary to set the new
-number of devices, and to add the new devices, in the same command.
-
-.TP
.BR \-b ", " \-\-bitmap=
Specify the bitmap file that was given when the array was created. If
an array has an
@@ -1491,7 +1496,7 @@ the first device given is the md device.
In the second usage example, all devices listed are treated as md
devices and assembly is attempted.
In the third (where no devices are listed) all md devices that are
-listed in the configuration file are assembled. If not arrays are
+listed in the configuration file are assembled. If no arrays are
described by the configuration file, then any arrays that
can be found on unused devices will be assembled.
@@ -1600,7 +1605,7 @@ and no devices are listed,
will first attempt to assemble all the arrays listed in the config
file.
-In no array at listed in the config (other than those marked
+If no arrays are listed in the config (other than those marked
.BR <ignore> )
it will look through the available devices for possible arrays and
will try to assemble anything that it finds. Arrays which are tagged
@@ -2200,11 +2205,11 @@ change the "size" attribute for RAID1, RAID4, RAID5 and RAID6.
.IP \(bu 4
increase or decrease the "raid\-devices" attribute of RAID0, RAID1, RAID4,
RAID5, and RAID6.
-.IP \bu 4
+.IP \(bu 4
change the chunk-size and layout of RAID0, RAID4, RAID5 and RAID6.
-.IP \bu 4
+.IP \(bu 4
convert between RAID1 and RAID5, between RAID5 and RAID6, between
-RAID0, RAID5, and RAID5, and between RAID0 and RAID10 (in the near-2 mode).
+RAID0, RAID4, and RAID5, and between RAID0 and RAID10 (in the near-2 mode).
.IP \(bu 4
add a write-intent bitmap to any array which supports these bitmaps, or
remove a write-intent bitmap from such an array.
@@ -2250,7 +2255,7 @@ space to start being used. If the size is increased in this way, a
are synchronised.
Note that when an array changes size, any filesystem that may be
-stored in the array will not automatically grow for shrink to use or
+stored in the array will not automatically grow or shrink to use or
vacate the space. The
filesystem will need to be explicitly told to use the extra space
after growing, or to reduce its size
@@ -2259,7 +2264,7 @@ to shrinking the array.
Also the size of an array cannot be changed while it has an active
bitmap. If an array has a bitmap, it must be removed before the size
-can be changed. Once the change it complete a new bitmap can be created.
+can be changed. Once the change is complete a new bitmap can be created.
.SS RAID\-DEVICES CHANGES
@@ -2435,8 +2440,8 @@ must match one of the names or patterns in a
line.
.IP +
-Does the device have a valid md superblock. If a specific metadata
-version is request with
+Does the device have a valid md superblock? If a specific metadata
+version is requested with
.B \-\-metadata
or
.B \-e
@@ -2467,6 +2472,7 @@ is not able to positively identify the array as belonging to the
current host, the device will be rejected.
..
+.PP
.I mdadm
keeps a list of arrays that it has partially assembled in
.B /var/run/mdadm/map
@@ -2639,7 +2645,7 @@ can be started.
Any devices which are components of /dev/md4 will be marked as faulty
and then remove from the array.
-.B " mdadm --grow /dev/md4 --level=6 --backup-file=/root/backup-md4
+.B " mdadm --grow /dev/md4 --level=6 --backup-file=/root/backup-md4"
.br
The array
.B /dev/md4
@@ -2787,7 +2793,7 @@ configuration file at all.
For further information on mdadm usage, MD and the various levels of
RAID, see:
.IP
-.B http://linux\-raid.osdl.org/
+.B http://raid.wiki.kernel.org/
.PP
(based upon Jakob \(/Ostergaard's Software\-RAID.HOWTO)
.\".PP

View File

@ -1,14 +1,14 @@
Summary: The mdadm program controls Linux md devices (software RAID arrays)
Name: mdadm
Version: 3.2.1
Release: 5%{?dist}
Version: 3.2.2
Release: 1%{?dist}
Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.bz2
Source1: mdmonitor.init
Source2: raid-check
Source3: mdadm.rules
Source4: mdadm-raid-check-sysconfig
Source5: mdadm-cron
Patch0: mdadm-3.1.5-unused-param.patch
Patch0: mdadm-3.2.2-man.patch
Patch1: mdadm-3.2.1-version.patch
Patch19: mdadm-3.1.3-udev.patch
Patch20: mdadm-2.5.2-static.patch
@ -31,7 +31,7 @@ file can be used to help with some common tasks.
%prep
%setup -q
%patch0 -p1 -b .param
%patch0 -p1 -b .man
%patch1 -p1 -b .version
%patch19 -p1 -b .udev
%patch20 -p1 -b .static
@ -81,6 +81,10 @@ fi
%ghost %attr(0700,root,root) %dir /var/run/mdadm
%changelog
* Tue Jun 28 2011 Milan Broz <mbroz@redhat.com> - 3.2.2-1
- Update to latest upstream version
- Resolves: bz714083
* Tue Jun 14 2011 Doug Ledford <dledford@redhat.com> - 3.2.1-5
- Fix for bz710646

View File

@ -1 +1 @@
d1e2549202bd79d9e99f1498d1109530 mdadm-3.2.1.tar.bz2
12ee2fbf3beddb60601fb7a4c4905651 mdadm-3.2.2.tar.bz2