rpms/mdadm/devel mdadm-2.6.4-incremental.patch, NONE, 1.1 mdadm.spec, 1.52, 1.53

Bill Nottingham (notting) fedora-extras-commits at redhat.com
Thu Apr 17 16:28:11 UTC 2008


Author: notting

Update of /cvs/extras/rpms/mdadm/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3851

Modified Files:
	mdadm.spec 
Added Files:
	mdadm-2.6.4-incremental.patch 
Log Message:
- make /dev/md if necessary in incremental mode (#429604)
- open RAID devices with O_EXCL to avoid racing against other --incremental processes (#433932)


mdadm-2.6.4-incremental.patch:

--- NEW FILE mdadm-2.6.4-incremental.patch ---
diff -ru mdadm-2.6.4/mdopen.c mdadm-2.6.4-fixed/mdopen.c
--- mdadm-2.6.4/mdopen.c	2007-10-16 05:47:25.000000000 -0400
+++ mdadm-2.6.4-fixed/mdopen.c	2008-04-16 19:04:08.000000000 -0400
@@ -302,6 +302,7 @@
 	 */
 	int major_num, minor_num;
 	struct stat stb;
+	int i;
 
 	if (devname)
 		strcpy(chosen_name, devname);
@@ -333,11 +334,22 @@
 			return -1;
 		}
 	} else {
+		if (strncmp(chosen_name, "/dev/md/", 8) == 0) {
+			mkdir("/dev/md", 0755);
+		}
 		if (mknod(chosen_name, S_IFBLK | 0600,
 			  makedev(major_num, minor_num)) != 0) {
 			return -1;
 		}
 		/* FIXME chown/chmod ?? */
 	}
-	return open(chosen_name, O_RDWR);
+	for (i = 0; i < 25 ; i++) {
+		int fd;
+			
+		fd = open(chosen_name, O_RDWR|O_EXCL);
+		if (fd >= 0)
+			return fd;
+		usleep(200000);
+	}
+	return -1;
 }


Index: mdadm.spec
===================================================================
RCS file: /cvs/extras/rpms/mdadm/devel/mdadm.spec,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- mdadm.spec	1 Feb 2008 22:03:04 -0000	1.52
+++ mdadm.spec	17 Apr 2008 16:27:33 -0000	1.53
@@ -1,7 +1,7 @@
 Summary:     The mdadm program controls Linux md devices (software RAID arrays)
 Name:        mdadm
 Version:     2.6.4
-Release:     3%{?dist}
+Release:     4%{?dist}
 Source:      http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz
 Source1:     mdmonitor.init
 Source2:     mdadm.rules
@@ -10,6 +10,7 @@
 Patch3:      mdadm-2.2-nodiet.patch
 Patch4:      mdadm-2.5.2-cflags.patch
 Patch5:      mdadm-2.6.1-build.patch
+Patch6:	     mdadm-2.6.4-incremental.patch
 URL:         http://www.cse.unsw.edu.au/~neilb/source/mdadm/
 License:     GPL
 Group:       System Environment/Base
@@ -33,6 +34,7 @@
 %patch3 -p1 -b .nodiet
 %patch4 -p1 -b .cflags
 %patch5 -p1 -b .build
+%patch6 -p1 -b .incremental
 
 %build
 make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" SYSCONFDIR="%{_sysconfdir}" MDASSEMBLE_AUTO=1 mdassemble.static mdassemble mdadm.static mdadm
@@ -83,7 +85,11 @@
 %attr(0700,root,root) %dir /var/run/mdadm
 
 %changelog
-* Fri Feb  1 2008 Bill Nottingham <notting at redht.com> - 2.6.4-3
+* Thu Apr 17 2008 Bill Nottingham <notting at redhat.com> - 2.6.4-4
+- make /dev/md if necessary in incremental mode (#429604)
+- open RAID devices with O_EXCL to avoid racing against other --incremental processes (#433932)
+ 
+* Fri Feb  1 2008 Bill Nottingham <notting at redhat.com> - 2.6.4-3
 - add a udev rules file for device assembly (#429604)
 
 * Fri Jan 18 2008 Doug Ledford <dledford at redhat.com> - 2.6.4-2




More information about the fedora-extras-commits mailing list