Fix global locking in PV reporting commands (2.02.49). Fix pvcreate on a

partition (2.02.51). Build clvmd with both cman and corosync support.
This commit is contained in:
Milan Broz 2009-08-24 12:23:10 +00:00
parent c295dc550a
commit 7047a17d4f
3 changed files with 107 additions and 2 deletions

View File

@ -0,0 +1,76 @@
--- LVM2.2.02.51.old/lib/device/dev-md.c 2009-08-01 19:14:52.000000000 +0200
+++ LVM2.2.02.51/lib/device/dev-md.c 2009-08-24 14:13:39.000000000 +0200
@@ -137,13 +137,15 @@ static int _md_sysfs_attribute_snprintf(
if (!sysfs_dir || !*sysfs_dir)
return ret;
-check_md_major:
- if (MAJOR(dev) != md_major()) {
- if (get_primary_dev(sysfs_dir, blkdev, &dev))
- goto check_md_major;
- return ret;
+ if (MAJOR(dev) == blkext_major()) {
+ /* lookup parent MD device from blkext partition */
+ if (!get_primary_dev(sysfs_dir, blkdev, &dev))
+ return ret;
}
+ if (MAJOR(dev) != md_major())
+ return ret;
+
ret = dm_snprintf(path, size, "%s/dev/block/%d:%d/md/%s", sysfs_dir,
(int)MAJOR(dev), (int)MINOR(dev), attribute);
if (ret < 0) {
--- LVM2.2.02.51.old/lib/filters/filter.c 2009-07-10 00:34:02.000000000 +0200
+++ LVM2.2.02.51/lib/filters/filter.c 2009-08-24 14:13:39.000000000 +0200
@@ -38,6 +38,7 @@ typedef struct {
} device_info_t;
static int _md_major = -1;
+static int _blkext_major = -1;
static int _device_mapper_major = -1;
int md_major(void)
@@ -45,6 +46,11 @@ int md_major(void)
return _md_major;
}
+int blkext_major(void)
+{
+ return _blkext_major;
+}
+
/*
* Devices are only checked for partition tables if their minor number
* is a multiple of the number corresponding to their type below
@@ -197,6 +203,10 @@ static int _scan_proc_dev(const char *pr
if (!strncmp("md", line + i, 2) && isspace(*(line + i + 2)))
_md_major = line_maj;
+ /* Look for blkext device */
+ if (!strncmp("blkext", line + i, 6) && isspace(*(line + i + 6)))
+ _blkext_major = line_maj;
+
/* Look for device-mapper device */
/* FIXME Cope with multiple majors */
if (!strncmp("device-mapper", line + i, 13) && isspace(*(line + i + 13)))
--- LVM2.2.02.51.old/lib/filters/filter.h 2007-08-20 22:55:25.000000000 +0200
+++ LVM2.2.02.51/lib/filters/filter.h 2009-08-24 14:13:39.000000000 +0200
@@ -36,6 +36,7 @@ struct dev_filter *lvm_type_filter_creat
void lvm_type_filter_destroy(struct dev_filter *f);
int md_major(void);
+int blkext_major(void);
int max_partitions(int major);
#endif
--- LVM2.2.02.51.old/WHATS_NEW 2009-08-06 19:08:01.000000000 +0200
+++ LVM2.2.02.51/WHATS_NEW 2009-08-24 14:14:06.000000000 +0200
@@ -1,3 +1,7 @@
+Version 2.02.52 -
+=================================
+ Fix pvcreate on a partition (2.02.51).
+
Version 2.02.51 - 6th August 2009
=================================
Fix locking in clvmd (2.02.50).

View File

@ -0,0 +1,20 @@
--- LVM2.2.02.51.old/tools/toollib.c 2009-07-21 13:10:49.000000000 +0200
+++ LVM2.2.02.51/tools/toollib.c 2009-08-24 14:15:08.000000000 +0200
@@ -643,7 +643,7 @@ int process_each_pv(struct cmd_context *
dm_list_init(&tags);
- if (lock_global && !lock_vol(cmd, VG_GLOBAL, LCK_READ)) {
+ if (lock_global && !lock_vol(cmd, VG_GLOBAL, LCK_VG_READ)) {
log_error("Unable to obtain global lock.");
return ECMD_FAILED;
}
--- LVM2.2.02.51.old/WHATS_NEW 2009-08-24 14:14:58.000000000 +0200
+++ LVM2.2.02.51/WHATS_NEW 2009-08-24 14:15:25.000000000 +0200
@@ -1,5 +1,6 @@
Version 2.02.52 -
=================================
+ Fix global locking in PV reporting commands (2.02.49).
Fix pvcreate on a partition (2.02.51).
Version 2.02.51 - 6th August 2009

View File

@ -8,7 +8,7 @@
Summary: Userland logical volume management tools Summary: Userland logical volume management tools
Name: lvm2 Name: lvm2
Version: 2.02.51 Version: 2.02.51
Release: 2%{?dist} Release: 3%{?dist}
License: GPLv2 License: GPLv2
Group: System Environment/Base Group: System Environment/Base
URL: http://sources.redhat.com/lvm2 URL: http://sources.redhat.com/lvm2
@ -16,6 +16,8 @@ Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
# Customise lvmconf.sh for built-in clustered locking in Fedora # Customise lvmconf.sh for built-in clustered locking in Fedora
Patch0: cluster-locking-built-in.patch Patch0: cluster-locking-built-in.patch
Patch1: lvm2-2_02_52-fix-pvcreate-partition.patch
Patch2: lvm2-2_02_52-fix-pvs-global-lock.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libselinux-devel >= 1.30.19-4, libsepol-devel BuildRequires: libselinux-devel >= 1.30.19-4, libsepol-devel
@ -41,6 +43,8 @@ or more physical volumes and creating one or more logical volumes
%prep %prep
%setup -q -n LVM2.%{version} %setup -q -n LVM2.%{version}
%patch0 -p1 -b .locking %patch0 -p1 -b .locking
%patch1 -p1 -b .partition
%patch2 -p1 -b .globallock
%build %build
%define _exec_prefix / %define _exec_prefix /
@ -48,7 +52,7 @@ or more physical volumes and creating one or more logical volumes
%define _sbindir /sbin %define _sbindir /sbin
%define _libdir /%{_lib} %define _libdir /%{_lib}
%configure --enable-lvm1_fallback --enable-fsadm --with-clvmd=corosync --with-cluster=internal --with-pool=internal --with-user= --with-group= --with-usrlibdir=/usr/%{_lib} --with-usrsbindir=/usr/sbin --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib %configure --enable-lvm1_fallback --enable-fsadm --with-clvmd=cman,corosync --with-cluster=internal --with-pool=internal --with-user= --with-group= --with-usrlibdir=/usr/%{_lib} --with-usrsbindir=/usr/sbin --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
@ -306,6 +310,11 @@ This package contains the device-mapper shared library, libdevmapper.
%changelog %changelog
* Mon Aug 24 2009 Milan Broz <mbroz@redhat.com> - 2.02.51-3
- Fix global locking in PV reporting commands (2.02.49).
- Fix pvcreate on a partition (2.02.51).
- Build clvmd with both cman and corosync support.
* Thu Aug 6 2009 Alasdair Kergon <agk@redhat.com> - 2.02.51-2 * Thu Aug 6 2009 Alasdair Kergon <agk@redhat.com> - 2.02.51-2
- Fix clvmd locking broken in 2.02.50-1. - Fix clvmd locking broken in 2.02.50-1.
- Only change LV /dev symlinks on ACTIVATE not PRELOAD (so not done twice). - Only change LV /dev symlinks on ACTIVATE not PRELOAD (so not done twice).