Fix problem with first stop command of IMSM raid during reshape

In addition
- Remove Fedora 17 support
- Fix pointless noise from rpm tools over date mismatches

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
This commit is contained in:
Jes Sorensen 2013-08-13 21:29:05 +02:00
parent 6d157ec6dc
commit f7e88a8ef4
2 changed files with 66 additions and 52 deletions

View File

@ -0,0 +1,54 @@
From 2fdf559d74a48806900b63f1b4504a18dec048a9 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 22 Apr 2013 17:05:33 +1000
Subject: [PATCH] Manage_runstop: call flush_mdmon if O_EXCL fails on stopping
mdmon array.
When stopping an mdmon array, at reshape might be being aborted
which inhibets O_EXCL. So if that is possible, call flush_mdmon
to make sure mdmon isn't still busy.
Reported-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
---
Manage.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/Manage.c b/Manage.c
index e3d3041..e37f415 100644
--- a/Manage.c
+++ b/Manage.c
@@ -221,8 +222,19 @@ int Manage_runstop(char *devname, int fd, int runstop,
/* Get EXCL access first. If this fails, then attempting
* to stop is probably a bad idea.
*/
- close(fd);
- fd = open(devname, O_RDONLY|O_EXCL);
+ mdi = sysfs_read(fd, -1, GET_LEVEL|GET_VERSION);
+ close(fd);
+ count = 5;
+ while (((fd = open(devname, O_RDONLY|O_EXCL)) < 0
+ || fd2devnum(fd) != devnum)
+ && mdi && !is_subarray(mdi->text_version)
+ && mdmon_running(devname2devnum(mdi->sys_name))
+ && count) {
+ if (fd >= 0)
+ close(fd);
+ flush_mdmon(mdi->sys_name);
+ count--;
+ }
if (fd < 0 || fd2devnum(fd) != devnum) {
if (fd >= 0)
close(fd);
@@ -237,7 +257,6 @@ int Manage_runstop(char *devname, int fd, int runstop,
devname);
return 1;
}
- mdi = sysfs_read(fd, -1, GET_LEVEL|GET_VERSION);
if (mdi &&
mdi->array.level > 0 &&
is_subarray(mdi->text_version)) {
--
1.8.3.1

View File

@ -1,7 +1,7 @@
Summary: The mdadm program controls Linux md devices (software RAID arrays)
Name: mdadm
Version: 3.2.6
Release: 20%{?dist}
Release: 21%{?dist}
Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz
Source1: mdmonitor.init
Source2: raid-check
@ -16,6 +16,7 @@ Patch2: mdadm-3.2.6-imsm-Forbid-spanning-between-multiple-controllers.patch
Patch3: mdadm-3.2.6-query-udev-dir-via-pkg-config.patch
Patch4: mdadm-3.2.6-Add-updating-component_size-to-manager-thread-of-mdm.patch
Patch5: mdadm-3.2.6-imsm-monitor-do-not-finish-migration-if-there-are-no.patch
Patch6: mdadm-3.2.6-Manage_runstop-call-flush_mdmon-if-O_EXCL-fails-on-s.patch
Patch93: mdadm-3.2.6-Remove-offroot-argument-and-default-to-always-settin.patch
Patch94: mdadm-3.2.6-Add-support-for-launching-mdmon-via-systemctl-instea.patch
Patch95: mdadm-3.2.6-In-case-launching-mdmon-fails-print-an-error-message.patch
@ -30,22 +31,9 @@ License: GPLv2+
Group: System Environment/Base
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Obsoletes: mdctl,raidtools
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
%define fedora17 0
%else
%define fedora17 1
%define _udevrulesdir /usr/lib/udev/rules.d
%define _tmpfilesdir %{_prefix}/usr/lib/tmpfiles.d
%endif
%if %{fedora17}
Requires(post): systemd-units systemd-sysv chkconfig coreutils
Requires: udev initscripts
Conflicts: dracut < 009-14
%else
Obsoletes: mdadm-sysvinit
Conflicts: dracut < 024-25
Requires(post): systemd-units chkconfig coreutils
%endif
BuildRequires: systemd-units binutils-devel
Requires(preun): systemd-units
Requires(postun): systemd-units coreutils
@ -58,20 +46,6 @@ package. However, mdadm is a single program, and it can perform
almost all functions without a configuration file, though a configuration
file can be used to help with some common tasks.
%if %{fedora17}
%package sysvinit
Group: System Environment/Base
Summary: SysV init script for mdadm
Requires: %{name} = %{version}-%{release}
Requires(post): /sbin/service
Requires(preun): /sbin/service
Requires(postun): /sbin/service
%description sysvinit
SysV style init script for mdadm. It needs to be installed only if systemd
is not used as the system init process.
%endif
%prep
%setup -q
%patch1 -p1 -b .raidsize
@ -79,34 +53,24 @@ is not used as the system init process.
%patch3 -p1 -b .udevquery
%patch4 -p1 -b .component
%patch5 -p1 -b .migration
%patch6 -p1 -b .runstop
# Use systemctl to launch mdmon on F18 and higher
%if !%{fedora17}
%patch93 -p1 -b .nooffroot
%patch94 -p1 -b .sysctl
%patch95 -p1 -b .mdmonfail
%patch96 -p1 -b .foreground
%endif
# Fedora customization patches
%patch97 -p1 -b .udev
%patch98 -p1 -b .static
# Fedora 16, 17 - only
%if %{fedora17}
%patch99 -p1 -b .map-dir
%endif
%build
make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" SYSCONFDIR="%{_sysconfdir}" mdadm mdmon
%install
rm -rf %{buildroot}
%if !%{fedora17}
make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=%{_sbindir} SYSTEMD_DIR=%{_unitdir} install install-systemd
%else
make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=%{_sbindir} SYSTEMD_DIR=%{_unitdir} install
install -Dp -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/mdmonitor
%endif
install -Dp -m 755 %{SOURCE2} %{buildroot}%{_sbindir}/raid-check
install -Dp -m 644 %{SOURCE3} %{buildroot}%{_udevrulesdir}/65-md-incremental.rules
install -Dp -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/raid-check
@ -146,11 +110,6 @@ rm -rf %{buildroot}
/sbin/chkconfig --del mdmonitor >/dev/null 2>&1 || :
/bin/systemctl try-restart mdmonitor.service >/dev/null 2>&1 || :
%if %{fedora17}
%triggerpostun -n %{name}-sysvinit -- %{name} < 3.2.2-3
/sbin/chkconfig --add mdmonitor >/dev/null 2>&1 || :
%endif
%files
%defattr(-,root,root,-)
%doc TODO ChangeLog mdadm.conf-example COPYING misc/*
@ -164,12 +123,13 @@ rm -rf %{buildroot}
%config(noreplace) %{_tmpfilesdir}/%{name}.conf
/etc/libreport/events.d/*
%if %{fedora17}
%files sysvinit
%{_initrddir}/*
%endif
%changelog
* Tue Aug 13 2013 Jes Sorensen <Jes.Sorensen@redhat.com> - 3.2.6-21
- Fix pointless rpmbuild noise over mismatching date info
- Remove Fedora 17 support
- Fix problem where first stop command doesn't stop container during
IMSM volume's reshape bz956053 (f18), bz956056 (f19)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.6-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
@ -183,11 +143,11 @@ rm -rf %{buildroot}
if an array was stopped during ongoing expansion of a RAID1/5 volume.
- Resolves bz948745
* Wed Apr 23 2013 Jes Sorensen <Jes.Sorensen@redhat.com> - 3.2.6-17
* Tue Apr 23 2013 Jes Sorensen <Jes.Sorensen@redhat.com> - 3.2.6-17
- Reorder patches to allow for udev query patch to be applied on
Fedora 17 as well.
* Tue Apr 22 2013 Jes Sorensen <Jes.Sorensen@redhat.com> - 3.2.6-16
* Mon Apr 22 2013 Jes Sorensen <Jes.Sorensen@redhat.com> - 3.2.6-16
- Rely on rpm macros to place files in correct directories, and match /usr
move
- Resolves bz955248
@ -960,7 +920,7 @@ rm -rf %{buildroot}
- Added Obsoletes: mdctl
- missingok for configfile
* Wed Mar 12 2002 NeilBrown <neilb@cse.unsw.edu.au>
* Tue Mar 12 2002 NeilBrown <neilb@cse.unsw.edu.au>
- Add md.4 and mdadm.conf.5 man pages
* Fri Mar 08 2002 Chris Siebenmann <cks@cquest.utoronto.ca>