rpms/mdadm/F-13 mdadm-3.1.2-lock.patch, NONE, 1.1 mdadm-3.1.3-read.patch, NONE, 1.1 .cvsignore, 1.29, 1.30 mdadm.spec, 1.89, 1.90 sources, 1.29, 1.30 mdadm-3.1.1-endian.patch, 1.3, NONE mdadm-3.1.2-container-2.patch, 1.2, NONE mdadm-3.1.2-container.patch, 1.2, NONE mdadm-3.1.2-decremental-2.patch, 1.1, NONE mdadm-3.1.2-decremental-3.patch, 1.1, NONE mdadm-3.1.2-decremental.patch, 1.1, NONE mdadm-3.1.2-directory.patch, 1.1, NONE mdadm-3.1.2-mapfile.patch, 1.1, NONE mdadm-3.1.2-mapname.patch, 1.1, NONE mdadm-3.1.2-powerpc-compile.patch, 1.1, NONE mdadm-3.1.2-rebuild.patch, 1.1, NONE

Doug Ledford dledford at fedoraproject.org
Tue Jul 20 22:01:40 UTC 2010


Author: dledford

Update of /cvs/extras/rpms/mdadm/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv8320

Modified Files:
	.cvsignore mdadm.spec sources 
Added Files:
	mdadm-3.1.2-lock.patch mdadm-3.1.3-read.patch 
Removed Files:
	mdadm-3.1.1-endian.patch mdadm-3.1.2-container-2.patch 
	mdadm-3.1.2-container.patch mdadm-3.1.2-decremental-2.patch 
	mdadm-3.1.2-decremental-3.patch mdadm-3.1.2-decremental.patch 
	mdadm-3.1.2-directory.patch mdadm-3.1.2-mapfile.patch 
	mdadm-3.1.2-mapname.patch mdadm-3.1.2-powerpc-compile.patch 
	mdadm-3.1.2-rebuild.patch 
Log Message:
* Tue Jul 20 2010 Doug Ledford <dledford at redhat.com> - 3.1.3-0.git07202010.2
- Fix racy locking of mapfile (bz600900)


mdadm-3.1.2-lock.patch:
 Incremental.c |    8 ++++++--
 mapfile.c     |   16 +++++-----------
 2 files changed, 11 insertions(+), 13 deletions(-)

--- NEW FILE mdadm-3.1.2-lock.patch ---
--- mdadm-3.1.2/Incremental.c.lock	2010-07-20 17:21:41.879217630 -0400
+++ mdadm-3.1.2/Incremental.c	2010-07-20 17:21:41.916342431 -0400
@@ -285,7 +285,9 @@ int Incremental(char *devname, int verbo
 
 	/* 4/ Check if array exists.
 	 */
-	map_lock(&map);
+	if (map_lock(&map))
+		fprintf(stderr, Name ": failed to get exclusive lock on "
+			"mapfile\n");
 	mp = map_by_uuid(&map, info.uuid);
 	if (mp)
 		mdfd = open_dev(mp->devnum);
@@ -769,7 +771,9 @@ int Incremental_container(struct superty
 	struct mdinfo *ra;
 	struct map_ent *map = NULL;
 
-	map_lock(&map);
+	if (map_lock(&map))
+		fprintf(stderr, Name ": failed to get exclusive lock on "
+			"mapfile\n");
 
 	for (ra = list ; ra ; ra = ra->next) {
 		int mdfd;
--- mdadm-3.1.2/mapfile.c.lock	2010-07-20 17:21:41.687217302 -0400
+++ mdadm-3.1.2/mapfile.c	2010-07-20 17:23:23.038096346 -0400
@@ -58,7 +58,7 @@ char *mapname[2][3] = {
 };
 char *mapdir[2] = { MAP_DIR, NULL };
 
-int mapmode[3] = { O_RDONLY, O_RDWR|O_CREAT, O_RDWR|O_CREAT|O_TRUNC };
+int mapmode[3] = { O_RDONLY, O_RDWR|O_CREAT, O_RDWR|O_CREAT|O_EXCL };
 char *mapsmode[3] = { "r", "w", "w"};
 
 FILE *open_map(int modenum, int *choice)
@@ -120,14 +120,11 @@ static int lwhich = 0;
 int map_lock(struct map_ent **melp)
 {
 	if (lf == NULL) {
-		lf = open_map(2, &lwhich);
+		do {
+			lf = open_map(2, &lwhich);
+		} while (lf == NULL && errno == EEXIST);
 		if (lf == NULL)
 			return -1;
-		if (flock(fileno(lf), LOCK_EX) != 0) {
-			fclose(lf);
-			lf = NULL;
-			return -1;
-		}
 	}
 	if (*melp)
 		map_free(*melp);
@@ -137,10 +134,7 @@ int map_lock(struct map_ent **melp)
 
 void map_unlock(struct map_ent **melp)
 {
-	if (lf) {
-		flock(fileno(lf), LOCK_UN);
-		fclose(lf);
-	}
+	fclose(lf);
 	unlink(mapname[lwhich][2]);
 	lf = NULL;
 }

mdadm-3.1.3-read.patch:
 Grow.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE mdadm-3.1.3-read.patch ---
--- mdadm-3.1.3-git07202010/Grow.c.read	2010-07-20 12:18:12.000000000 -0400
+++ mdadm-3.1.3-git07202010/Grow.c	2010-07-20 12:55:26.816805170 -0400
@@ -1820,7 +1820,7 @@ int Grow_restart(struct supertype *st, s
 		}
 		/* There should be a duplicate backup superblock 4k before here */
 		if (lseek64(fd, -4096, 1) < 0 ||
-		    read(fd, &bsb2, 4096) != 4096)
+		    read(fd, &bsb2, sizeof(bsb2)) != sizeof(bsb2))
 			goto second_fail; /* Cannot find leading superblock */
 		if (bsb.magic[15] == '1')
 			bsbsize = offsetof(struct mdp_backup_super, pad1);


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/mdadm/F-13/.cvsignore,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -p -r1.29 -r1.30
--- .cvsignore	6 Apr 2010 16:45:45 -0000	1.29
+++ .cvsignore	20 Jul 2010 22:01:38 -0000	1.30
@@ -1,3 +1,4 @@
 mdadm-3.0.3.tar.bz2
 mdadm-3.1.1-gcd9a8b5.tar.bz2
 mdadm-3.1.2.tar.bz2
+mdadm-3.1.3-git07202010.tar.bz2


Index: mdadm.spec
===================================================================
RCS file: /cvs/extras/rpms/mdadm/F-13/mdadm.spec,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -p -r1.89 -r1.90
--- mdadm.spec	13 Apr 2010 23:18:29 -0000	1.89
+++ mdadm.spec	20 Jul 2010 22:01:40 -0000	1.90
@@ -1,23 +1,14 @@
 Summary:     The mdadm program controls Linux md devices (software RAID arrays)
 Name:        mdadm
-Version:     3.1.2
-Release:     10%{?dist}
-Source:      http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.bz2
+Version:     3.1.3
+Release:     0.git07202010.2%{?dist}
+Source:      http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}-git07202010.tar.bz2
 Source1:     mdmonitor.init
 Source2:     raid-check
 Source3:     mdadm.rules
 Source4:     mdadm-raid-check-sysconfig
-Patch1:      mdadm-3.1.2-mapname.patch
-Patch2:      mdadm-3.1.1-endian.patch
-Patch3:      mdadm-3.1.2-mapfile.patch
-Patch4:      mdadm-3.1.2-rebuild.patch
-Patch5:      mdadm-3.1.2-directory.patch
-Patch6:      mdadm-3.1.2-decremental.patch
-Patch7:      mdadm-3.1.2-decremental-2.patch
-Patch8:      mdadm-3.1.2-decremental-3.patch
-Patch9:      mdadm-3.1.2-powerpc-compile.patch
-Patch10:     mdadm-3.1.2-container.patch
-Patch11:     mdadm-3.1.2-container-2.patch
+Patch0:      mdadm-3.1.3-read.patch
+PAtch1:      mdadm-3.1.2-lock.patch
 Patch20:     mdadm-2.5.2-static.patch
 URL:         http://www.kernel.org/pub/linux/utils/raid/mdadm/
 License:     GPLv2+
@@ -38,18 +29,9 @@ almost all functions without a configura
 file can be used to help with some common tasks.
 
 %prep
-%setup -q
-%patch3 -p1 -b .mapfile
-%patch1 -p1 -b .mapname
-%patch2 -p1 -b .endian
-%patch4 -p1 -b .rebuild
-%patch5 -p1 -b .directory
-%patch6 -p1 -b .decremental
-%patch7 -p1 -b .decremental-2
-%patch8 -p1 -b .decremental-3
-%patch9 -p1 -b .powerpc
-%patch10 -p1 -b .container
-%patch11 -p1 -b .container-2
+%setup -q -n mdadm-3.1.3-git07202010
+%patch0 -p1 -b .read
+%patch1 -p1 -b .lock
 %patch20 -p1 -b .static
 
 %build
@@ -57,14 +39,13 @@ make %{?_smp_mflags} CXFLAGS="$RPM_OPT_F
 
 %install
 rm -rf %{buildroot}
-make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=/sbin install install-static
-rm -f %{buildroot}/lib/udev/rules.d/*
+make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=/sbin install
+rm -f %{buildroot}/lib/udev/rules.d/64*
 install -Dp -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/mdmonitor
 install -Dp -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.weekly/99-raid-check
 install -Dp -m 644 %{SOURCE3} %{buildroot}/lib/udev/rules.d/65-md-incremental.rules
 install -Dp -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/raid-check
 mkdir -p -m 700 %{buildroot}/var/run/mdadm
-ln -s mdadm.8.gz %{buildroot}%{_mandir}/man8/mdadm.static.8.gz
 
 %clean
 rm -rf %{buildroot}
@@ -97,6 +78,13 @@ fi
 %attr(0700,root,root) %dir /var/run/mdadm
 
 %changelog
+* Tue Jul 20 2010 Doug Ledford <dledford at redhat.com> - 3.1.3-0.git07202010.2
+- Fix racy locking of mapfile (bz600900)
+
+* Tue Jul 20 2010 Doug Ledford <dledford at redhat.com> - 3.1.3-0.git07202010.1
+- Update to latest git repo (3.1.2 plus pending changes, fixes bz602457)
+- Remove mdadm.static as its no longer used in initrd creation
+
 * Tue Apr 13 2010 Doug Ledford <dledford at redhat.com> - 3.1.2-10
 - Minor update to mdadm.rules to make anaconda happy
 


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/mdadm/F-13/sources,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -p -r1.29 -r1.30
--- sources	6 Apr 2010 16:45:46 -0000	1.29
+++ sources	20 Jul 2010 22:01:40 -0000	1.30
@@ -1 +1,2 @@
 c5a39f38c465229767a5af2a4eb81bef  mdadm-3.1.2.tar.bz2
+3c1df7259e17ed909ddd4b28e434f10a  mdadm-3.1.3-git07202010.tar.bz2


--- mdadm-3.1.1-endian.patch DELETED ---


--- mdadm-3.1.2-container-2.patch DELETED ---


--- mdadm-3.1.2-container.patch DELETED ---


--- mdadm-3.1.2-decremental-2.patch DELETED ---


--- mdadm-3.1.2-decremental-3.patch DELETED ---


--- mdadm-3.1.2-decremental.patch DELETED ---


--- mdadm-3.1.2-directory.patch DELETED ---


--- mdadm-3.1.2-mapfile.patch DELETED ---


--- mdadm-3.1.2-mapname.patch DELETED ---


--- mdadm-3.1.2-powerpc-compile.patch DELETED ---


--- mdadm-3.1.2-rebuild.patch DELETED ---



More information about the scm-commits mailing list