![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package lvm2 for openSUSE:Factory checked in at Fri May 15 22:00:13 CEST 2009. -------- New Changes file: --- /dev/null 2009-04-14 11:58:14.000000000 +0200 +++ lvm2/device-mapper.changes 2009-05-15 21:51:46.059725000 +0200 @@ -0,0 +1,484 @@ +------------------------------------------------------------------- +Mon May 11 15:36:05 CST 2009 - xwhu@suse.de + +- Enable pkgconfig for GNOME 2.28 + +------------------------------------------------------------------- +Mon Apr 27 18:37:32 CST 2009 - xwhu@suse.de + +- Upgrade to 1.02.31 + . Add "all" field to reports expanding to all fields of report type. + . Enforce device name length and character limitations in libdm. + . Replace _dm_snprintf with EMIT_PARAMS macro for creating target lines. + . Only resume devices in dm_tree_preload_children if size changes. + . Extend deptree buffers so the largest possible device numbers fit. + . Generate versioned libdevmapper-event.so. + . Underline longer report help text headings. + +------------------------------------------------------------------- +Tue Apr 21 10:11:35 CEST 2009 - xwhu@suse.de + +- bnc#479104, export additional information + +------------------------------------------------------------------- +Tue Feb 3 08:42:58 CET 2009 - hare@suse.de + +- No whitespace for DM_STATE export variable (bnc#440959) +- Remove obsolete reference to boot.scsidev from init script + +------------------------------------------------------------------- +Wed Dec 10 12:34:56 CET 2008 - olh@suse.de + +- use Obsoletes: -XXbit only for ppc64 to help solver during distupgrade + (bnc#437293) + +------------------------------------------------------------------- +Wed Nov 5 16:57:47 CET 2008 - werner@suse.de + +- As boot.crypto depends on boot.device-mapper, the later one has + even on shutdown to depend on boot.udev to make sure that events + will be processed (bnc#413059) + +------------------------------------------------------------------- +Thu Oct 30 12:34:56 CET 2008 - olh@suse.de + +- obsolete old -XXbit packages (bnc#437293) + +------------------------------------------------------------------- +Sat Sep 13 07:03:44 CEST 2008 - xwhu@suse.de + +- Fix typo for correct compiling +- Timeout if udevd's not running (bnc#425436) + +------------------------------------------------------------------- +Wed Sep 10 11:56:17 CEST 2008 - xwhu@suse.de + +- update to 1.02.27 + Align struct memblock in dbg_malloc for sparc. + Add --unquoted and --rows to dmsetup. + Avoid compiler warning about cast in dmsetup.c's OFFSET_OF macro. + Fix inverted no_flush debug message. + Remove --enable-jobs from configure. (Set at runtime instead.) + Bring configure.in and list.h into line with the lvm2 versions. + +------------------------------------------------------------------- +Wed Sep 3 11:09:34 CEST 2008 - hare@suse.de + +- Call mkinitrd_setup during %post and %postun (bnc#413709) + +------------------------------------------------------------------- +Mon Aug 25 12:03:57 CEST 2008 - prusnak@suse.cz + +- enabled SELinux support [Fate#303662] + +------------------------------------------------------------------- +Fri Aug 22 13:00:15 CEST 2008 - xwhu@suse.de + +- Remove the -p option for fillup_and_insserv + +------------------------------------------------------------------- +Wed Aug 13 06:26:49 CEST 2008 - xwhu@suse.de + +- Add Should-Stop to boot.device-mapper + +------------------------------------------------------------------- +Wed Jul 23 15:35:05 CEST 2008 - hare@suse.de + +- Include mkinitrd scriptlets. + +------------------------------------------------------------------- +Wed Jul 16 19:38:07 CEST 2008 - xwhu@suse.de + +- repack device-mapper.1.02.26.tar.bz2 into bzip2. +- change the owner of device to root:disk, with permission + 0640 (bnc#407952) + +------------------------------------------------------------------- +Tue Jun 24 05:43:08 CEST 2008 - xwhu@suse.de + +- update to new version 1.02.26 + Initialise params buffer to empty string in _emit_segment. + Skip add_dev_node when ioctls disabled. + Make dm_hash_iter safe against deletion. + Accept a NULL pointer to dm_free silently. + Add tables_loaded, readonly and suspended columns to reports. + Add --nameprefixes to dmsetup. + Add field name prefix option to reporting functions. + Calculate string size within dm_pool_grow_object. + + Remove redundant if-before-free tests. + Use log_warn for reporting field help text instead of log_print. + Change cluster mirror log type name (s/clustered_/clustered-/) + +------------------------------------------------------------------- +Fri May 30 13:54:02 CEST 2008 - xwhu@suse.de + +- Hold on mknod until udev finish it's job. + +------------------------------------------------------------------- +Thu Apr 10 12:54:45 CEST 2008 - ro@suse.de + +- added baselibs.conf file to build xxbit packages + for multilib support + +------------------------------------------------------------------- +Wed Feb 27 13:00:25 CET 2008 - dmueller@suse.de + +- fix static library installation again + +------------------------------------------------------------------- +Tue Feb 26 21:55:47 CET 2008 - dmueller@suse.de + +- fix "binary contains trace of $RPM_BUILD_ROOT" failure + +------------------------------------------------------------------- +Thu Feb 7 08:59:16 CET 2008 - hare@suse.de + +- Enable dmeventd (FATE#303381) + +------------------------------------------------------------------- +Thu Jan 31 11:54:11 CET 2008 - fehr@suse.de + +- update to new version 1.02.24 + Fix deptree to pass new name to _resume_node after a rename. + Suppress other node operations if node is deleted. + Report error when empty device name passed to readahead functions. + +------------------------------------------------------------------- +Mon Dec 10 11:25:40 CET 2007 - fehr@suse.de + +- update to new version 1.02.23 + Add readahead support to libdevmapper and dmsetup. + Fix double free in a libdevmapper-event error path. + Allow a DM_DEV_DIR environment variable to override /dev. + +------------------------------------------------------------------- +Thu Nov 22 14:07:15 CET 2007 - fehr@suse.de + +- update to new version 1.02.22 + Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. + Fix dmsetup -o devno string termination. + Fix default dmsetup report buffering and add --unbuffered. + Add tree-based and dependency fields to dmsetup reports. + +------------------------------------------------------------------- +Mon May 7 11:46:29 CEST 2007 - kay.sievers@suse.de + +- update to new version 1.02.19 + Avoid trailing separator in reports when there are hidden sort fields. + Fix segfault in 'dmsetup status' without --showkeys against crypt target. + Migrate dmsetup column-based output over to new libdevmapper report framework. + Add descriptions to reporting field definitions. + Add basic reporting functions to libdevmapper. +- remove dmsetup option patch (upstream provides it) +- add dmsetup export command + +------------------------------------------------------------------- +Sun Feb 11 11:58:37 CET 2007 - ro@suse.de + +- fix build as non-root + +------------------------------------------------------------------- +Tue Jan 16 14:25:01 CET 2007 - fehr@suse.de + +- remove superfluouus /lib/libdevmapper.so (#235359) +- add call to ldconfig (#235359) + +------------------------------------------------------------------- +Wed Dec 6 09:58:48 CET 2006 - fehr@suse.de + +- update to new version 1.02.13 + Update dmsetup man page (setgeometry & message). + Fix dmsetup free after getline with debug. + Suppress encryption key in 'dmsetup table' output unless --showkeys supplied. + +------------------------------------------------------------------- +Mon Oct 16 13:01:52 CEST 2006 - fehr@suse.de + ++++ 287 more lines (skipped) ++++ between /dev/null ++++ and lvm2/device-mapper.changes New Changes file: --- /dev/null 2009-04-14 11:58:14.000000000 +0200 +++ lvm2/lvm2.changes 2009-05-15 21:51:49.264028000 +0200 @@ -0,0 +1,878 @@ +------------------------------------------------------------------- +Mon Apr 27 18:37:32 CST 2009 - xwhu@suse.de + +- Upgrade to LVM2 2.02.45 + Avoid scanning empty metadata areas for VG names + Pass --test from lvresize to fsadm as --dry-run. + Remove duplicate cpg_initialize from clvmd startup. + Add option to /etc/sysconfig/cluster to select cluster type for clvmd. + Remove external dependency on the 'cut' command from fsadm. + Fix pvs segfault when pv mda attributes requested for not available PV. + Fix lvresize size conversion for fsadm when block size is not 1K. + Add pv_mda_size to pvs and vg_mda_size to vgs. + Add "--refresh" functionality to vgchange and vgmknodes. + Fix vgrename using UUID if there are VGs with identical names. + Fix segfault when invalid field given in reporting commands. + Merge device-mapper into the lvm2 tree. + Exit with non-zero status from vgdisplay if couldn't show any requested VG. + Fix snapshot monitoring library to not cancel monitoring invalid snapshot. + Fix conversion of md chunk size into sectors. + Fix misleading error message when there are no allocatable extents in VG. + Fix handling of PVs which reappeared with old metadata version. + Fix mirror DSO to call vgreduce with proper parameters. + Fix validation of --minor and --major in lvcreate to require -My always. + Fix release: clvmd build, vgreduce consolidate & tests, /dev/ioerror warning. + +------------------------------------------------------------------- +Tue Mar 31 11:59:03 CST 2009 - xwhu@suse.de + +- Handle the case that drbd virtual device has the same PV uuid + with the underlining physical device. + +------------------------------------------------------------------- +Wed Mar 25 23:14:29 CST 2009 - xwhu@suse.de + +- Do not filter out tmp device file(bnc#485572) +- Do not try to activate VG when all paths are down already(bnc#479104) + +------------------------------------------------------------------- +Wed Mar 25 22:50:50 CST 2009 - xwhu@suse.de + +- Split CLVMD as a independent package + +------------------------------------------------------------------- +Tue Mar 24 00:23:13 CST 2009 - xwhu@suse.de + +- Fix for bnc#486952 + use "killproc -INT" instead of "killproc" + handle signal in the main loop thread only + +------------------------------------------------------------------- +Thu Feb 26 14:08:22 CST 2009 - xwhu@suse.de + +- add daemon_options parameter to clvmd.ocf +- check EUNLOCK for dlm_ls_unlock_wait + +------------------------------------------------------------------- +Wed Feb 25 18:39:26 CST 2009 - xwhu@suse.de + +- bnc#479422, check both lksb.sb_status and status. + +------------------------------------------------------------------- +Fri Feb 20 10:24:00 CET 2009 - xwhu@suse.de + +- simplify patch of dlm lock to clvmd + +------------------------------------------------------------------- +Fri Feb 20 08:06:37 CET 2009 - xwhu@suse.de + +- bnc#476861, clvmd.ocf doesn't report the correct status when + kill -9 doesn't terminate the process + +------------------------------------------------------------------- +Thu Jan 22 13:00:26 CST 2009 - xwhu@suse.de + +- bnc#464851, use dlm instead of openais lck + +------------------------------------------------------------------- +Wed Jan 21 15:23:31 CET 2009 - ro@suse.de + +- do not require a specific package release from subpackage + (bnc#467704) + +------------------------------------------------------------------- +Wed Dec 3 18:51:27 CST 2008 - xwhu@suse.de + +- Add OCF script for clvmd + +------------------------------------------------------------------- +Wed Nov 12 02:22:56 CST 2008 - xwhu@suse.de + +- bnc#443677. dmeventd DSOs are linked against liblvm2cmd + +------------------------------------------------------------------- +Thu Oct 9 11:54:47 CEST 2008 - xwhu@suse.de + +- bnc#432782. Remove vol_id in 64-lvm2.rules. + +------------------------------------------------------------------- +Mon Sep 29 14:09:33 CEST 2008 - ro@suse.de + +- buildreq: replace openais-devel by libopenais-devel + +------------------------------------------------------------------- +Wed Sep 24 18:25:40 CEST 2008 - ro@suse.de + +- change "udevsettle" to "udevadm settle" + +------------------------------------------------------------------- +Sat Sep 13 11:59:34 CEST 2008 - xwhu@novell.com + +- added missing directories to filelist + +------------------------------------------------------------------- +Wed Sep 10 13:43:17 CEST 2008 - xwhu@novell.com + +- Upgrade to 2.0.39 + Fix up cache for PVs without mdas after consistent VG metadata is processed. + Update validation of safe mirror log type conversions in lvconvert. + Fix lvconvert to disallow snapshot and mirror combinations. + Fix reporting of LV fields alongside unallocated PV segments. + Add --unquoted and --rows to reporting tools. + Avoid undefined return value after _memlock manipulation in lvm2_run. + Avoid link failure if configured without --enable-cmdlib or --enable-readline. + Make clvmd return at once if other nodes down in a gulm or openais cluster. + Fix and improve readahead 'auto' calculation for stripe_size. + Fix lvchange output for -r auto setting if auto is already set. + Fix ambiguous use of identifier error_message_produced. + Fix add_mirror_images not to dereference uninitialized log_lv upon failure. + Don't call openlog for every debug line output by clvmd. + Add --force to lvextend and lvresize. + Fix vgchange to not activate mirror leg and log volumes directly. + Fix test directory clean up in make distclean. +- pvcreate/pvremove/pvchange will create symlinks in /dev/disk/by-id/ + to the device file +------------------------------------------------------------------- +Wed Sep 3 11:09:34 CEST 2008 - hare@suse.de + +- Call mkinitrd_setup during %post and %postun (bnc#413709) + +------------------------------------------------------------------- +Tue Sep 2 16:59:00 CEST 2008 - hare@suse.de + +- Fix initrd scripts if no 'root=' parameter is given + (bnc#421546) + +------------------------------------------------------------------- +Mon Aug 25 12:49:58 CEST 2008 - aj@suse.de + +- Provide and obsolete evms. + +------------------------------------------------------------------- +Mon Aug 25 12:04:29 CEST 2008 - prusnak@suse.cz + +- enabled SELinux support [Fate#303662] + +------------------------------------------------------------------- +Fri Aug 22 12:58:08 CEST 2008 - xwhu@suse.de + +- Remove the -p option for fillup_and_insserv + +------------------------------------------------------------------- +Wed Aug 13 06:18:44 CEST 2008 - xwhu@suse.de + +- Add Should-Stop to boot.lvm + +------------------------------------------------------------------- +Thu Jul 31 16:13:59 CST 2008 - xwhu@suse.de + +- repack LVM2.2.02.38.tar.bz2 into bz2 format + +------------------------------------------------------------------- +Wed Jul 23 15:38:13 CEST 2008 - hare@suse.de + +- Include mkinitrd scriptlets. + +------------------------------------------------------------------- +Fri Jun 27 07:51:31 CEST 2008 - xwhu@suse.de + +- update to 2.02.38 + Fix tracking of validity of PVs with no mdas in lvmcache. + Fix return values for reporting commands when run with no PVs, LVs, or VGs. + Fix free_count when reading pool metadata. + Fix segfault when using pvcreate on a device containing pool metadata. + Fix segfault after _free_vginfo by remembering to remove vginfo from list. + Fix setpriority error message to signed int. + Fix uninitialised mutex in clvmd if all daemons are not running at startup. + Fix fsadm.sh to work with older blockdev, blkid & readlink binaries. + Fix lvresize to pass new size to fsadm when extending device. + Fix nodes list in clvmd-openais, and allow for broadcast messages. + Fix vgsplit internal counting of snapshot LVs. + Fix vgmerge snapshot_count when source VG contains snapshots. + Fix internal LV counter when a snapshot is removed. + Fix metadata corruption writing lvm1-formatted metadata with snapshots. + Fix lvconvert -m0 allocatable space check. + Fix vgdisplay 'Cur LV' field to match lvdisplay output. + Fix lv_count report field to exclude hidden LVs. + Fix vgsplit to only move hidden 'snapshotN' LVs when necessary. ++++ 681 more lines (skipped) ++++ between /dev/null ++++ and lvm2/lvm2.changes New Changes file: --- /dev/null 2009-04-14 11:58:14.000000000 +0200 +++ lvm2/lvm2-clvm.changes 2009-05-15 21:51:52.746033000 +0200 @@ -0,0 +1,46 @@ +------------------------------------------------------------------- +Mon Apr 27 18:37:32 CST 2009 - xwhu@suse.de + +- Upgrade to LVM2 2.02.45 + Avoid scanning empty metadata areas for VG names + Pass --test from lvresize to fsadm as --dry-run. + Remove duplicate cpg_initialize from clvmd startup. + Add option to /etc/sysconfig/cluster to select cluster type for clvmd. + Remove external dependency on the 'cut' command from fsadm. + Fix pvs segfault when pv mda attributes requested for not available PV. + Fix lvresize size conversion for fsadm when block size is not 1K. + Add pv_mda_size to pvs and vg_mda_size to vgs. + Add "--refresh" functionality to vgchange and vgmknodes. + Fix vgrename using UUID if there are VGs with identical names. + Fix segfault when invalid field given in reporting commands. + Merge device-mapper into the lvm2 tree. + Exit with non-zero status from vgdisplay if couldn't show any requested VG. + Fix snapshot monitoring library to not cancel monitoring invalid snapshot. + Fix conversion of md chunk size into sectors. + Fix misleading error message when there are no allocatable extents in VG. + Fix handling of PVs which reappeared with old metadata version. + Fix mirror DSO to call vgreduce with proper parameters. + Fix validation of --minor and --major in lvcreate to require -My always. + Fix release: clvmd build, vgreduce consolidate & tests, /dev/ioerror warning. + +------------------------------------------------------------------- +Tue Apr 1 01:10:00 CST 2009 - lmb@suse.de + +- clvmd: Ensure that the lockspace is released locally even we were the + lock master, avoiding an unclean shutdown (bnc#490415). + +------------------------------------------------------------------- +Tue Mar 31 19:16:18 CST 2009 - xwhu@suse.de + +- Call cpg_leave before shutting down clvmd + +------------------------------------------------------------------- +Wed Mar 25 23:14:29 CST 2009 - xwhu@suse.de + +- Do not filter out tmp device file(bnc#485572) + +------------------------------------------------------------------- +Wed Mar 25 22:50:50 CST 2009 - xwhu@suse.de + +- Newly splitted off from lvm2, as a independent package now + calling whatdependson for head-i586 New: ---- 64-lvm2.rules baselibs.conf boot.device-mapper boot.lvm bug-486952_clvmd-check-returncode-of-dlmrelease.diff call_cpg_leave_before_shutdown.diff clvmd.ocf clvmd-openais-use-dlm.diff cmdline_large_minor.diff collect_lvm device-mapper.changes device-mapper-dmsetup-deps-export.patch device-mapper-dmsetup-export.patch device-mapper-gcc-warning.diff device-mapper.spec device-mapper-static.diff device-mapper-wait_udev.diff dont_ignore_tmp_device_file.diff enable-clvmd.patch improve_probing.diff k_dev_t.dif LVM2.2.02.45.tar.bz2 lvm2.changes lvm2-clvm.changes lvm2-clvm.spec lvm2.spec lvm.conf lvm-no_chown.diff lvm-pv-create-link.diff man_page_sectors.diff mkinitrd-boot.sh mkinitrd-setup.sh no_buildroot_shared.diff no-inc-audit.diff pipe_buff-definition.diff pvscan_2TB_limit.diff sigterm_in_main_thread.diff support-drbd-filter.diff sysconfig.lvm sys_mount_instead_linux_fs.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ device-mapper.spec ++++++ # # spec file for package device-mapper (Version 1.02.31) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: device-mapper License: GPL v2 or later; LGPL v2.1 or later Group: System/Base AutoReqProv: on # bug437293 %ifarch ppc64 Obsoletes: device-mapper-64bit %endif # Version: 1.02.31 Release: 2 Summary: Device Mapper Tools Source: LVM2.2.02.45.tar.bz2 Source1: boot.device-mapper Source2: mkinitrd-setup.sh Source3: mkinitrd-boot.sh Patch: improve_probing.diff Patch2: no-inc-audit.diff Patch3: no_buildroot_shared.diff Patch4: sys_mount_instead_linux_fs.diff Patch5: pvscan_2TB_limit.diff Patch6: man_page_sectors.diff Patch10: lvm-no_chown.diff Patch11: cmdline_large_minor.diff Patch12: enable-clvmd.patch Patch13: pipe_buff-definition.diff Patch14: lvm-pv-create-link.diff #Patch15: dmeventd-link-libcmd.diff Patch16: clvmd-openais-use-dlm.diff Patch17: bug-486952_clvmd-check-returncode-of-dlmrelease.diff Patch18: sigterm_in_main_thread.diff Patch19: dont_ignore_tmp_device_file.diff Patch20: support-drbd-filter.diff Patch21: call_cpg_leave_before_shutdown.diff #Patches for device mapper Patch60: k_dev_t.dif Patch61: device-mapper-dmsetup-export.patch Patch62: device-mapper-gcc-warning.diff Patch63: device-mapper-static.diff Patch64: device-mapper-wait_udev.diff Patch65: device-mapper-dmsetup-deps-export.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libselinux-devel PreReq: %insserv_prereq %fillup_prereq %description Programs, libraries, and man pages for configuring and using the device mapper. Authors: -------- Joe Thornber <thornber@sistina.com> %package devel License: GPL v2 or later; LGPL v2.1 or later Summary: Development package for the device mapper Group: System/Base Requires: %name = %version %description devel Files needed for software development using the device mapper Authors: -------- Joe Thornber <thornber@sistina.com> %prep %setup -n LVM2.2.02.45 %patch %patch2 %patch3 %patch4 %patch5 %patch6 %patch10 %patch11 %patch12 %patch13 %patch14 -p1 #%patch15 -p1 %patch16 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 %patch20 -p1 %patch21 -p1 %patch60 -p1 %patch61 -p1 %patch62 -p1 %patch63 -p1 %patch64 -p1 %patch65 -p1 %build CFLAGS="$RPM_OPT_FLAGS" \ %configure --bindir=/bin --libdir=/%_lib --sbindir=/sbin --enable-dmeventd \ --enable-selinux --enable-cmdlib \ --with-dmeventd-path=/sbin/dmeventd \ --with-device-uid=0 --with-device-gid=6 --with-device-mode=0640 \ --enable-pkgconfig make %{?jobs:-j %jobs} %install #%makeinstall make install_device-mapper DESTDIR=$RPM_BUILD_ROOT #make libdir=$RPM_BUILD_ROOT/%_libdir install_static_lib mkdir -p $RPM_BUILD_ROOT/%_libdir ln -s /%_lib/libdevmapper.so.1.02 $RPM_BUILD_ROOT/%_libdir/libdevmapper.so ln -s /%_lib/libdevmapper-event.so.1.02 $RPM_BUILD_ROOT/%_libdir/libdevmapper-event.so rm $RPM_BUILD_ROOT/%_lib/libdevmapper.so rm $RPM_BUILD_ROOT/%_lib/libdevmapper-event.so rm $RPM_BUILD_ROOT/%_lib/libdevmapper-event-lvm2mirror.so rm $RPM_BUILD_ROOT/%_lib/libdevmapper-event-lvm2mirror.so.2.02 rm $RPM_BUILD_ROOT/%_lib/libdevmapper-event-lvm2snapshot.so rm $RPM_BUILD_ROOT/%_lib/libdevmapper-event-lvm2snapshot.so.2.02 #install -m 744 scripts/devmap_mknod.sh $RPM_BUILD_ROOT/sbin/ mkdir -p $RPM_BUILD_ROOT/etc/init.d install -m 744 %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-dm.sh install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-dm.sh %post %{run_ldconfig} [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup %{fillup_and_insserv -y boot.device-mapper} %postun %{run_ldconfig} [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup %{insserv_cleanup} %files %defattr(-,root,root) %doc INSTALL COPYING COPYING.LIB README VERSION_DM WHATS_NEW_DM %config /etc/init.d/boot.device-mapper /%_lib/libdevmapper.so.1.02 /%_lib/libdevmapper-event.so.1.02 /sbin/dmsetup /sbin/dmeventd #/sbin/devmap_mknod.sh %{_mandir}/man8/dmsetup.8.gz %dir /lib/mkinitrd %dir /lib/mkinitrd/scripts /lib/mkinitrd/scripts/setup-dm.sh /lib/mkinitrd/scripts/boot-dm.sh %files devel %defattr(-,root,root) /%_libdir/libdevmapper.so /%_libdir/libdevmapper-event.so /%_libdir/pkgconfig/*.pc #%attr(644, root, root) %_libdir/libdevmapper.a /usr/include/libdevmapper.h /usr/include/libdevmapper-event.h %changelog * Mon May 11 2009 xwhu@suse.de - Enable pkgconfig for GNOME 2.28 * Mon Apr 27 2009 xwhu@suse.de - Upgrade to 1.02.31 . Add "all" field to reports expanding to all fields of report type. . Enforce device name length and character limitations in libdm. . Replace _dm_snprintf with EMIT_PARAMS macro for creating target lines. . Only resume devices in dm_tree_preload_children if size changes. . Extend deptree buffers so the largest possible device numbers fit. . Generate versioned libdevmapper-event.so. . Underline longer report help text headings. * Tue Apr 21 2009 xwhu@suse.de - bnc#479104, export additional information * Tue Feb 03 2009 hare@suse.de - No whitespace for DM_STATE export variable (bnc#440959) - Remove obsolete reference to boot.scsidev from init script * Wed Dec 10 2008 olh@suse.de - use Obsoletes: -XXbit only for ppc64 to help solver during distupgrade (bnc#437293) * Wed Nov 05 2008 werner@suse.de - As boot.crypto depends on boot.device-mapper, the later one has even on shutdown to depend on boot.udev to make sure that events will be processed (bnc#413059) * Thu Oct 30 2008 olh@suse.de - obsolete old -XXbit packages (bnc#437293) * Fri Sep 12 2008 xwhu@suse.de - Fix typo for correct compiling - Timeout if udevd's not running (bnc#425436) * Wed Sep 10 2008 xwhu@suse.de - update to 1.02.27 Align struct memblock in dbg_malloc for sparc. Add --unquoted and --rows to dmsetup. Avoid compiler warning about cast in dmsetup.c's OFFSET_OF macro. Fix inverted no_flush debug message. Remove --enable-jobs from configure. (Set at runtime instead.) Bring configure.in and list.h into line with the lvm2 versions. * Wed Sep 03 2008 hare@suse.de - Call mkinitrd_setup during %%post and %%postun (bnc#413709) * Mon Aug 25 2008 prusnak@suse.cz - enabled SELinux support [Fate#303662] * Fri Aug 22 2008 xwhu@suse.de - Remove the -p option for fillup_and_insserv * Tue Aug 12 2008 xwhu@suse.de - Add Should-Stop to boot.device-mapper * Wed Jul 23 2008 hare@suse.de - Include mkinitrd scriptlets. * Wed Jul 16 2008 xwhu@suse.de - repack device-mapper.1.02.26.tar.bz2 into bzip2. - change the owner of device to root:disk, with permission 0640 (bnc#407952) * Mon Jun 23 2008 xwhu@suse.de - update to new version 1.02.26 Initialise params buffer to empty string in _emit_segment. Skip add_dev_node when ioctls disabled. Make dm_hash_iter safe against deletion. Accept a NULL pointer to dm_free silently. Add tables_loaded, readonly and suspended columns to reports. Add --nameprefixes to dmsetup. Add field name prefix option to reporting functions. Calculate string size within dm_pool_grow_object. Remove redundant if-before-free tests. Use log_warn for reporting field help text instead of log_print. Change cluster mirror log type name (s/clustered_/clustered-/) * Fri May 30 2008 xwhu@suse.de - Hold on mknod until udev finish it's job. * Thu Apr 10 2008 ro@suse.de - added baselibs.conf file to build xxbit packages for multilib support * Wed Feb 27 2008 dmueller@suse.de - fix static library installation again * Tue Feb 26 2008 dmueller@suse.de - fix "binary contains trace of $RPM_BUILD_ROOT" failure * Thu Feb 07 2008 hare@suse.de - Enable dmeventd (FATE#303381) * Thu Jan 31 2008 fehr@suse.de - update to new version 1.02.24 Fix deptree to pass new name to _resume_node after a rename. Suppress other node operations if node is deleted. Report error when empty device name passed to readahead functions. * Mon Dec 10 2007 fehr@suse.de - update to new version 1.02.23 Add readahead support to libdevmapper and dmsetup. Fix double free in a libdevmapper-event error path. Allow a DM_DEV_DIR environment variable to override /dev. * Thu Nov 22 2007 fehr@suse.de - update to new version 1.02.22 Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. Fix dmsetup -o devno string termination. Fix default dmsetup report buffering and add --unbuffered. Add tree-based and dependency fields to dmsetup reports. * Mon May 07 2007 kay.sievers@suse.de - update to new version 1.02.19 Avoid trailing separator in reports when there are hidden sort fields. Fix segfault in 'dmsetup status' without --showkeys against crypt target. Migrate dmsetup column-based output over to new libdevmapper report framework. Add descriptions to reporting field definitions. Add basic reporting functions to libdevmapper. - remove dmsetup option patch (upstream provides it) - add dmsetup export command * Sun Feb 11 2007 ro@suse.de - fix build as non-root * Tue Jan 16 2007 fehr@suse.de - remove superfluouus /lib/libdevmapper.so (#235359) - add call to ldconfig (#235359) * Wed Dec 06 2006 fehr@suse.de - update to new version 1.02.13 Update dmsetup man page (setgeometry & message). Fix dmsetup free after getline with debug. Suppress encryption key in 'dmsetup table' output unless --showkeys supplied. * Mon Oct 16 2006 fehr@suse.de - update to new version 1.02.12 Avoid deptree attempting to suspend a device that's already suspended. Add suspend noflush support. Add basic dmsetup loop support. Switch dmsetup to use dm_malloc and dm_free. * Wed Sep 20 2006 fehr@suse.de - update to new version 1.02.10 Add dm_snprintf(), dm_split_words() and dm_split_lvm_name() to libdevmapper. Reorder mm bounds_check code to reduce window for a dmeventd race. * Thu Sep 14 2006 mkoenig@suse.de - fixed permissions for static lib - removed static lib version extension * Tue Sep 12 2006 hvogel@suse.de - split device-mapper-devel subpackage - install static libs (needed to link cryptsetup from util-linux-crypto static) * Wed Aug 30 2006 hare@suse.de - Fix gcc warnings - Fix field display for 'dmsetup info'. * Wed Aug 30 2006 hare@suse.de - Add 'major', 'minor', and 'uuid' as valid fields for 'dmsetup info -o XXX'. * Wed Aug 16 2006 fehr@suse.de - update to new version 1.02.09 Add --table argument to dmsetup for a one-line table. Abort if errors are found during cmdline option processing. Add lockfs indicator to debug output. * Wed Jul 26 2006 fehr@suse.de - update to new version 1.02.08 Update dmsetup man page. Add --force to dmsetup remove* to load error target. dmsetup remove_all also performs mknodes. Don't suppress identical table reloads if permission changes. Fix corelog segment line. * Mon May 22 2006 fehr@suse.de - update to new version 1.02.07 Add DM_CORELOG flag to dm_tree_node_add_mirror_target(). Avoid a dmeventd compiler warning. - update to new version 1.02.06 Move DEFS into configure.h. Fix leaks in error paths found by coverity. Remove dmsetup line buffer limitation. * Thu Apr 20 2006 fehr@suse.de - update to new version 1.02.05 Separate install_include target in makefiles. Separate out DEFS from CFLAGS. Support pkg-config. Check for libsepol. * Wed Apr 19 2006 fehr@suse.de - update to new version 1.02.04 Bring dmsetup man page up-to-date. Use name-based device refs if kernel doesn't support device number refs. Fix memory leak (struct dm_ioctl) when struct dm_task is reused. If _create_and_load_v4 fails part way through, revert the creation. dmeventd thread/fifo fixes. Add file & line to dm_strdup_aux(). Add setgeometry. * Tue Mar 14 2006 fehr@suse.de - update to new version 1.02.03 Add exported functions to set uid, gid and mode. Rename _log to dm_log and export. Add dm_tree_skip_lockfs. Fix dm_strdup debug definition. Fix hash function to avoid using a negative array offset. Don't inline _find in hash.c and tidy signed/unsigned etc. Fix libdevmapper.h #endif. Fix dmsetup version driver version. Add sync, nosync and block_on_error mirror log parameters. Add hweight32. Fix dmeventd build. * Thu Mar 02 2006 hare@suse.de - Do not call devmap_mknod.sh (#150818) * Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires * Tue Jan 24 2006 fehr@suse.de - fix exit code of "dmsetup version" (#144794) * Mon Jan 23 2006 fehr@suse.de - add boot.udev to Required-Start section of init script (#144586) * Tue Dec 06 2005 fehr@suse.de - update to new version 1.02.02 * Tue Sep 27 2005 fehr@suse.de - update to new version 1.01.05 * Wed Sep 21 2005 fehr@suse.de - increase ioctl buffer size from 16k to 256k to allow larger number of dm device visible by "dmsetup ls" and "dmsetup table" * Wed Aug 03 2005 fehr@suse.de - update to new version 1.01.04 * Thu Jun 30 2005 meissner@suse.de - use RPM_OPT_FLAGS. * Tue Jun 14 2005 fehr@suse.de - update to new version 1.01.03 * Wed May 18 2005 fehr@suse.de - update to new version 1.01.02 * Mon Apr 11 2005 fehr@suse.de - use -py instead of -pY as option for fillup_and_insserv (#76689) - update to new version 1.01.01 * Tue Jan 18 2005 fehr@suse.de - update to new version 1.01.00 * Tue Jan 11 2005 fehr@suse.de - update to new version 1.00.21 * Thu Aug 26 2004 fehr@suse.de - /dev/mapper directory is now part of devs.rpm (#44258) * Wed Jul 14 2004 fehr@suse.de - update to new version 1.00.19 * Thu May 27 2004 fehr@suse.de - do not unload dm modules on shutdown, this hangs on some machines * Sat Apr 10 2004 aj@suse.de - devicemapper does not need 2.6 kernelsources. * Thu Apr 01 2004 fehr@suse.de - update to new version 1.00.09 * Tue Mar 16 2004 fehr@suse.de - fix typo in start script (#36168) * Mon Mar 15 2004 fehr@suse.de - do not depend on existence of /dev/mapper dir (#35825) * Mon Mar 01 2004 ro@suse.de - remove root-fsck stuff in bootscript - instead depend on boot.rootfsck * Fri Dec 05 2003 fehr@suse.de - update to new version 1.00.07 * Mon Nov 17 2003 odabrunz@suse.de - fix spec file to make it compile with both new and old glibc (__kernel_dev_t) * Thu Oct 02 2003 fehr@suse.de - add fix to make it compile with new glibc (use __kernel_old_dev_t) * Thu Sep 18 2003 fehr@suse.de - fix boot.devicemapper to cope with LABEL= and UUID= in /etc/fstab also check reiser filesystem (#31060) * Wed Sep 17 2003 fehr@suse.de - add comment when remounting root fs read-only (#31060) * Tue Sep 16 2003 kukuk@suse.de - Add missing PreRequires [Bug #31006] * Tue Sep 02 2003 fehr@suse.de - update to version 1.00.05 * Mon Aug 25 2003 fehr@suse.de - update to version 1.00.04 * Thu Aug 21 2003 fehr@suse.de - update to version 1.00.03 * Mon Aug 18 2003 garloff@suse.de - (#29083) Add # X-UnitedLinux-Should-Start: boot.scsidev * Fri Jul 25 2003 fehr@suse.de - update to version 1.00.02 * Tue Jul 01 2003 fehr@suse.de - add boot script for automated startup in system - fix typos in boot script * Mon Jun 30 2003 fehr@suse.de - created initial version of a SuSE package ++++++ lvm2-clvm.spec ++++++ # # spec file for package lvm2-clvm (Version 2.02.45) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Url: http://sources.redhat.com/cluster/clvm/ Name: lvm2-clvm BuildRequires: device-mapper-devel libdlm-devel libopenais-devel readline-devel BuildRequires: libselinux-devel License: GPL v2 or later; LGPL v2.1 or later Group: System/Base Version: 2.02.45 Release: 2 Requires: device-mapper >= 1.02.25 lvm2 = %{version} openais Provides: clvm PreReq: %fillup_prereq %insserv_prereq AutoReqProv: on Summary: Clustered LVM2 Source: LVM2.%{version}.tar.bz2 Source1: lvm.conf Source2: boot.lvm Source3: sysconfig.lvm Source4: mkinitrd-setup.sh Source5: mkinitrd-boot.sh Source6: 64-lvm2.rules Source7: collect_lvm Source8: clvmd.ocf Patch: improve_probing.diff Patch2: no-inc-audit.diff Patch3: no_buildroot_shared.diff Patch4: sys_mount_instead_linux_fs.diff Patch5: pvscan_2TB_limit.diff Patch6: man_page_sectors.diff Patch10: lvm-no_chown.diff Patch11: cmdline_large_minor.diff Patch12: enable-clvmd.patch Patch13: pipe_buff-definition.diff Patch14: lvm-pv-create-link.diff #Patch15: dmeventd-link-libcmd.diff Patch16: clvmd-openais-use-dlm.diff Patch17: bug-486952_clvmd-check-returncode-of-dlmrelease.diff Patch18: sigterm_in_main_thread.diff Patch19: dont_ignore_tmp_device_file.diff Patch20: support-drbd-filter.diff Patch21: call_cpg_leave_before_shutdown.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description A daemon for using LVM2 Logival Volumes in a clustered environment. %prep %setup -n LVM2.%{version} %patch %patch2 %patch3 %patch4 %patch5 %patch6 %patch10 %patch11 %patch12 %patch13 %patch14 -p1 #%patch15 -p1 %patch16 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 %patch20 -p1 %patch21 -p1 %build CFLAGS="$RPM_OPT_FLAGS" MODPROBE_CMD=/sbin/modprobe \ LDFLAGS="-L /usr/%_lib/openais" \ ./configure --prefix=/ \ --mandir=%{_mandir} \ --includedir=/usr/include \ --enable-selinux \ --enable-cmdlib \ --libdir=/%_lib --enable-dmeventd --enable-cmdlib \ --with-clvmd=openais make %install pushd daemons make install DESTDIR=$RPM_BUILD_ROOT popd pushd man make install DESTDIR=$RPM_BUILD_ROOT popd install -D -m 755 $RPM_BUILD_ROOT/sbin/clvmd $RPM_BUILD_ROOT/usr/sbin/clvmd rm $RPM_BUILD_ROOT/sbin/clvmd rm $RPM_BUILD_ROOT/sbin/dmeventd rm $RPM_BUILD_ROOT/usr/include/libdevmapper-event.h rm $RPM_BUILD_ROOT/%{_lib}/libdevmapper-event-lvm2mirror.* rm $RPM_BUILD_ROOT/%{_lib}/libdevmapper-event-lvm2snapshot.* rm $RPM_BUILD_ROOT/%{_lib}/libdevmapper-event.* rm -rf $RPM_BUILD_ROOT/%{_mandir}/man5 rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/lv* rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/pv* rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/vg* rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/dmsetup* rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/fsadm* install -m755 -D %{S:8} $RPM_BUILD_ROOT/usr/lib/ocf/resource.d/lvm2/clvmd %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) /usr/sbin/clvmd %dir /usr/lib/ocf %dir /usr/lib/ocf/resource.d %dir /usr/lib/ocf/resource.d/lvm2 /usr/lib/ocf/resource.d/lvm2/clvmd %{_mandir}/man8/clvmd.8.gz %changelog * Mon Apr 27 2009 xwhu@suse.de - Upgrade to LVM2 2.02.45 Avoid scanning empty metadata areas for VG names Pass --test from lvresize to fsadm as --dry-run. Remove duplicate cpg_initialize from clvmd startup. Add option to /etc/sysconfig/cluster to select cluster type for clvmd. Remove external dependency on the 'cut' command from fsadm. Fix pvs segfault when pv mda attributes requested for not available PV. Fix lvresize size conversion for fsadm when block size is not 1K. Add pv_mda_size to pvs and vg_mda_size to vgs. Add "--refresh" functionality to vgchange and vgmknodes. Fix vgrename using UUID if there are VGs with identical names. Fix segfault when invalid field given in reporting commands. Merge device-mapper into the lvm2 tree. Exit with non-zero status from vgdisplay if couldn't show any requested VG. Fix snapshot monitoring library to not cancel monitoring invalid snapshot. Fix conversion of md chunk size into sectors. Fix misleading error message when there are no allocatable extents in VG. Fix handling of PVs which reappeared with old metadata version. Fix mirror DSO to call vgreduce with proper parameters. Fix validation of --minor and --major in lvcreate to require -My always. Fix release: clvmd build, vgreduce consolidate & tests, /dev/ioerror warning. * Wed Apr 01 2009 lmb@suse.de - clvmd: Ensure that the lockspace is released locally even we were the lock master, avoiding an unclean shutdown (bnc#490415). * Tue Mar 31 2009 xwhu@suse.de - Call cpg_leave before shutting down clvmd * Wed Mar 25 2009 xwhu@suse.de - Do not filter out tmp device file(bnc#485572) * Wed Mar 25 2009 xwhu@suse.de - Newly splitted off from lvm2, as a independent package now ++++++ lvm2.spec ++++++ ++++ 830 lines (skipped) ++++++ 64-lvm2.rules ++++++ # This file causes block devices with LVM signatures to be automatically # added to their volume group. # See udev(8) for syntax SUBSYSTEM!="block", GOTO="lvm_end" ACTION!="add|change", GOTO="lvm_end" ENV{ID_FS_TYPE}!="LVM2_member", GOTO="lvm_end" ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-id/lvm2-pvuuid-$env{ID_FS_UUID_ENC}" ENV{DMDEPS}=="0", GOTO="lvm_end" IMPORT{PROGRAM}="collect_lvm $tempnode" ENV{VGUUID}!="?*", GOTO="lvm_end" ENV{VGNAME}!="?*", GOTO="lvm_end" # If all related PV's available already, active all LVs inside. ENV{COLLECT}=="0", RUN+="/sbin/vgchange -a y $env{VGNAME}" LABEL="lvm_end" ++++++ baselibs.conf ++++++ device-mapper ++++++ boot.device-mapper ++++++ #! /bin/sh # # Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. All rights reserved. # # /etc/init.d/boot.device-mapper # ### BEGIN INIT INFO # Provides: boot.device-mapper # Required-Start: boot.udev boot.rootfsck # Required-Stop: boot.udev # Default-Start: B # Default-Stop: # Description: activate device mapper ### END INIT INFO . /etc/rc.status rc_reset case "$1" in start) echo "Activating device mapper..." lsmod | grep "^dm[-_]mod[ ]" >/dev/null 2>&1 || modprobe dm-mod rc_status -v -r ;; stop) # module unloading seems to be uneliable in kernel 2.6 # rmmod dm-mod # rc_status -v ;; status) rc_failed 4 rc_status -v ;; *) echo "Usage: $0 {start|stop|status}" exit 1 ;; esac rc_exit ++++++ boot.lvm ++++++ #! /bin/sh # # Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. All rights reserved. # # /etc/init.d/boot.lvm # ### BEGIN INIT INFO # Provides: boot.lvm # Required-Start: boot.device-mapper boot.udev boot.rootfsck # Should-Start: boot.multipath boot.md boot.dmraid # Required-Stop: $null # Should-Stop: $null # Default-Start: B # Default-Stop: # Description: start logical volumes ### END INIT INFO . /etc/rc.status . /etc/sysconfig/lvm # udev interaction if [ -x /sbin/udevadm ] ; then [ -z "$LVM_DEVICE_TIMEOUT" ] && LVM_DEVICE_TIMEOUT=60 else LVM_DEVICE_TIMEOUT=0 fi rc_reset case "$1" in start) # # Find and activate volume groups (HM 1/1/1999) # if test -d /etc/lvm -a -x /sbin/vgscan -a -x /sbin/vgchange ; then # Waiting for udev to settle if [ "$LVM_DEVICE_TIMEOUT" -gt 0 ] ; then echo "Waiting for udev to settle..." /sbin/udevadm settle --timeout=$LVM_DEVICE_TIMEOUT fi echo "Scanning for LVM volume groups..." /sbin/vgscan --mknodes echo "Activating LVM volume groups..." /sbin/vgchange -a y $LVM_VGS_ACTIVATED_ON_BOOT rc_status -v -r fi ;; stop) if test -d /etc/lvm -a -x /sbin/vgchange ; then /sbin/vgchange -a n fi rc_status -v ;; status) rc_failed 4 rc_status -v ;; reload) $0 start ;; *) echo "Usage: $0 {start|stop|status|reload}" exit 1 ;; esac rc_exit ++++++ bug-486952_clvmd-check-returncode-of-dlmrelease.diff ++++++ Index: LVM2.2.02.39/daemons/clvmd/clvmd-openais.c =================================================================== --- LVM2.2.02.39.orig/daemons/clvmd/clvmd-openais.c +++ LVM2.2.02.39/daemons/clvmd/clvmd-openais.c @@ -368,7 +368,16 @@ static void _cluster_closedown(void) DEBUGLOG("cluster_closedown\n"); unlock_all(); - dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0); + int r; + r = dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0); + if (r == -1) { + if (errno == EBUSY) { + syslog(LOG_ERR, "Some locks still active, close by force\n"); + dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1); + } else { + syslog(LOG_ERR, "dlm_release_lockspace failed\n"); + } + } cpg_finalize(cpg_handle); } ++++++ call_cpg_leave_before_shutdown.diff ++++++ Index: LVM2.2.02.39/daemons/clvmd/clvmd-openais.c =================================================================== --- LVM2.2.02.39.orig/daemons/clvmd/clvmd-openais.c 2009-04-01 20:12:52.000000000 +0800 +++ LVM2.2.02.39/daemons/clvmd/clvmd-openais.c 2009-04-01 20:13:23.000000000 +0800 @@ -342,7 +342,7 @@ err = cpg_join(cpg_handle, &cpg_group_name); if (err != SA_AIS_OK) { cpg_finalize(cpg_handle); - dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0); + dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1); syslog(LOG_ERR, "Cannot join clvmd process group"); DEBUGLOG("Cannot join clvmd process group: %d\n", err); return ais_to_errno(err); @@ -351,8 +351,9 @@ err = cpg_local_get(cpg_handle, &our_nodeid); if (err != SA_AIS_OK) { + cpg_leave(cpg_handle, &cpg_group_name); cpg_finalize(cpg_handle); - dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0); + dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1); syslog(LOG_ERR, "Cannot get local node id\n"); return ais_to_errno(err); } @@ -369,15 +370,11 @@ unlock_all(); int r; - r = dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0); - if (r == -1) { - if (errno == EBUSY) { - syslog(LOG_ERR, "Some locks still active, close by force\n"); - dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1); - } else { - syslog(LOG_ERR, "dlm_release_lockspace failed\n"); - } + r = dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1); + if (r != 0) { + syslog(LOG_ERR, "dlm_release_lockspace failed: %d\n", errno); } + cpg_leave(cpg_handle, &cpg_group_name); cpg_finalize(cpg_handle); } ++++++ clvmd.ocf ++++++ #!/bin/bash # Copyright (c) 2008 Xinwei Hu # All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it would be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Further, this software is distributed without any warranty that it is # free of the rightful claim of any third person regarding infringement # or the like. Any license provided herein, whether implied or # otherwise, applies only to this software file. Patent licenses, if # any, provided herein do not apply to combinations of this program with # other software, or any other product whatsoever. # # You should have received a copy of the GNU General Public License # along with this program; if not, write the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. # ####################################################################### # OCF initialization . ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs # Parameter defaults : ${OCF_RESKEY_CRM_meta_gloablly_unique:="false"} : ${OCF_RESKEY_daemon_timeout:="80"} : ${OCF_RESKEY_daemon_options:="-d0"} # Common variables DAEMON="/usr/sbin/clvmd" status_daemon() { PID=`pidofproc "$DAEMON"` if [ -n "$PID" ]; then return $OCF_SUCCESS fi return $OCF_NOT_RUNNING } bringup_daemon() { if [ ! -e "$DAEMON" ]; then ocf_log err "Required binary not found: $DAEMON" return $OCF_ERR_INSTALLED fi start_daemon "$DAEMON" "$OCF_RESKEY_daemon_options"; rc=$? if [ $rc != 0 ]; then ocf_log err "Could not start $DAEMON" return $OCF_ERR_GENERIC fi sleep 1 COUNT=0 rc=$OCF_NOT_RUNNING while [ $rc = $OCF_NOT_RUNNING ]; do COUNT=`expr $COUNT + 1` if [ $COUNT -gt $OCF_RESKEY_daemon_timeout ]; then ocf_log err "`basename $DAEMON` did not come up" return $OCF_ERR_GENERIC fi status_daemon; rc=$? sleep 1 done return $rc } kill_daemon() { status_daemon; rc=$? if [ $rc != $OCF_SUCCESS ]; then return rc fi ocf_log info "Stopping `basename "$DAEMON"`" killproc -INT "$DAEMON" sleep 1 status_daemon; rc=$? COUNT=0 while [ $rc = $OCF_SUCCESS ]; do COUNT=`expr $COUNT + 1` if [ $COUNT -gt $OCF_RESKEY_daemon_timeout ]; then ocf_log err "`basename $DAEMON` shutdown emergency" killproc -9 "$DAEMON" status_daemon; rc=$? if [ $rc = $OCF_NOT_RUNNING ]; then return $OCF_SUCCESS else return $OCF_ERR_GENERIC fi fi killproc -INT "$DAEMON" sleep 1 status_daemon; rc=$? done return $OCF_SUCCESS } clvmd_start() { clvmd_monitor; rc=$? if [ $rc != $OCF_NOT_RUNNING ]; then return $rc fi ocf_log info "Starting $OCF_RESOURCE_INSTANCE" bringup_daemon return $? } clvmd_stop() { clvmd_monitor; rc=$? case $rc in $OCF_NOT_RUNNING) return $OCF_SUCCESS;; esac ocf_log info "Stopping $OCF_RESOURCE_INSTANCE" kill_daemon } clvmd_monitor() { clvmd_validate status_daemon return $? } clvmd_usage() { echo "usage: $0 {start|stop|monitor|validate-all|meta-data}" echo " Expects to have a fully populated OCF RA-compliant environment set." echo " In particualr, a value for OCF_ROOT" } clvmd_validate() { : TODO: check for gloablly_unique=true and return OCF_ERR_CONFIGURED case ${OCF_RESKEY_CRM_meta_gloablly_unique} in yes|Yes|true|True|1) ocf_log err "$OCF_RESOURCE_INSTANCE must be configured with the gloablly_unique=false meta attribute" exit $OCF_ERR_CONFIGURED ;; esac return $OCF_SUCCESS } meta_data() { cat <<END <?xml version="1.0"?> <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> <resource-agent name="clvmd"> <version>1.0</version> <longdesc lang="en"> This is a clvmd Resource Agent. It starts clvmd as anonymous clones. </longdesc> <shortdesc lang="en">clvmd resource agent</shortdesc> <parameters> <parameter name="daemon_timeout" unique="0"> <longdesc lang="en"> Number of seconds to allow the control daemon to come up and down </longdesc> <shortdesc lang="en">Daemon Timeout</shortdesc> <content type="string" default="80"/> </parameter> <parameter name="daemon_options" unique="0"> <longdesc lang="en"> Options to clvmd. Refer to clvmd.8 for detailed descriptions. </longdesc> <shortdesc lang="en">Daemon Options</shortdesc> <content type="string" default="-d0"/> </parameter> </parameters> <actions> <action name="start" timeout="90" /> <action name="stop" timeout="100" /> <action name="monitor" timeout="20" depth="0"/> <action name="meta-data" timeout="5" /> <action name="validate-all" timeout="30" /> </actions> </resource-agent> END } case $__OCF_ACTION in meta-data) meta_data exit $OCF_SUCCESS ;; start) clvmd_start ;; stop) clvmd_stop ;; monitor) clvmd_monitor ;; validate-all) clvmd_validate ;; usage|help) clvmd_usage exit $OCF_SUCCESS ;; *) clvmd_usage exit $OCF_ERR_UNIMPLEMENTED ;; esac exit $? ++++++ clvmd-openais-use-dlm.diff ++++++ Index: LVM2.2.02.39/daemons/clvmd/clvmd-openais.c =================================================================== --- LVM2.2.02.39.orig/daemons/clvmd/clvmd-openais.c 2008-06-20 20:46:21.000000000 +0800 +++ LVM2.2.02.39/daemons/clvmd/clvmd-openais.c 2009-02-25 22:13:32.000000000 +0800 @@ -34,9 +34,9 @@ #include <syslog.h> #include <assert.h> #include <libdevmapper.h> +#include <libdlm.h> #include <openais/saAis.h> -#include <openais/saLck.h> #include <openais/cpg.h> #include "list.h" @@ -50,6 +50,8 @@ /* Timeout value for several openais calls */ #define TIMEOUT 10 +#define LOCKSPACE_NAME "clvmd" + static void cpg_deliver_callback (cpg_handle_t handle, struct cpg_name *groupName, uint32_t nodeid, @@ -66,9 +68,6 @@ /* Hash list of nodes in the cluster */ static struct dm_hash_table *node_hash; -/* For associating lock IDs & resource handles */ -static struct dm_hash_table *lock_hash; - /* Number of active nodes */ static int num_nodes; static unsigned int our_nodeid; @@ -77,9 +76,15 @@ /* OpenAIS handles */ static cpg_handle_t cpg_handle; -static SaLckHandleT lck_handle; static struct cpg_name cpg_group_name; +static dlm_lshandle_t *lockspace; + +struct lock_wait { + pthread_cond_t cond; + pthread_mutex_t mutex; + struct dlm_lksb lksb; +}; /* Openais callback structs */ cpg_callbacks_t cpg_callbacks = { @@ -93,13 +98,6 @@ int nodeid; }; -struct lock_info -{ - SaLckResourceHandleT res_handle; - SaLckLockIdT lock_id; - SaNameT lock_name; -}; - /* Set errno to something approximating the right value and return 0 or -1 */ static int ais_to_errno(SaAisErrorT err) { @@ -309,22 +307,11 @@ num_nodes = member_list_entries; } -static int lck_dispatch(struct local_client *client, char *buf, int len, - const char *csid, struct local_client **new_client) -{ - *new_client = NULL; - saLckDispatch(lck_handle, SA_DISPATCH_ONE); - return 1; -} - static int _init_cluster(void) { SaAisErrorT err; - SaVersionT ver = { 'B', 1, 1 }; - int select_fd; node_hash = dm_hash_create(100); - lock_hash = dm_hash_create(10); err = cpg_initialize(&cpg_handle, &cpg_callbacks); @@ -335,16 +322,19 @@ return ais_to_errno(err); } - err = saLckInitialize(&lck_handle, - NULL, - &ver); - if (err != SA_AIS_OK) { - cpg_initialize(&cpg_handle, &cpg_callbacks); - syslog(LOG_ERR, "Cannot initialise OpenAIS lock service: %d", - err); - DEBUGLOG("Cannot initialise OpenAIS lock service: %d\n\n", err); - return ais_to_errno(err); + /* Create a lockspace for LV & VG locks to live in */ + lockspace = dlm_create_lockspace(LOCKSPACE_NAME, 0600); + if (!lockspace) { + if (errno == EEXIST) { + lockspace = dlm_open_lockspace(LOCKSPACE_NAME); + } + if (!lockspace) { + syslog(LOG_ERR, "Unable to create lockspace for CLVM: %m"); + return -1; + } } + dlm_ls_pthread_init(lockspace); + DEBUGLOG("DLM initialisation complete\n"); /* Connect to the clvmd group */ strcpy((char *)cpg_group_name.value, "clvmd"); @@ -352,7 +342,7 @@ err = cpg_join(cpg_handle, &cpg_group_name); if (err != SA_AIS_OK) { cpg_finalize(cpg_handle); - saLckFinalize(lck_handle); + dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0); syslog(LOG_ERR, "Cannot join clvmd process group"); DEBUGLOG("Cannot join clvmd process group: %d\n", err); return ais_to_errno(err); @@ -362,15 +352,12 @@ &our_nodeid); if (err != SA_AIS_OK) { cpg_finalize(cpg_handle); - saLckFinalize(lck_handle); + dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0); syslog(LOG_ERR, "Cannot get local node id\n"); return ais_to_errno(err); } DEBUGLOG("Our local node id is %d\n", our_nodeid); - saLckSelectionObjectGet(lck_handle, (SaSelectionObjectT *)&select_fd); - add_internal_client(select_fd, lck_dispatch); - DEBUGLOG("Connected to OpenAIS\n"); return 0; @@ -381,7 +368,7 @@ DEBUGLOG("cluster_closedown\n"); unlock_all(); - saLckFinalize(lck_handle); + dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0); cpg_finalize(cpg_handle); } @@ -472,156 +459,69 @@ return somedown; } -/* Real locking */ -static int _lock_resource(char *resource, int mode, int flags, int *lockid) +static int _sync_lock(const char *resource, int mode, int flags, int *lockid) { - struct lock_info *linfo; - SaLckResourceHandleT res_handle; - SaAisErrorT err; - SaLckLockIdT lock_id; - SaLckLockStatusT lockStatus; - - /* This needs to be converted from DLM/LVM2 value for OpenAIS LCK */ - if (flags & LCK_NONBLOCK) flags = SA_LCK_LOCK_NO_QUEUE; - - linfo = malloc(sizeof(struct lock_info)); - if (!linfo) - return -1; + struct dlm_lksb lksb; + int err; DEBUGLOG("lock_resource '%s', flags=%d, mode=%d\n", resource, flags, mode); - linfo->lock_name.length = strlen(resource)+1; - strcpy((char *)linfo->lock_name.value, resource); - - err = saLckResourceOpen(lck_handle, &linfo->lock_name, - SA_LCK_RESOURCE_CREATE, TIMEOUT, &res_handle); - if (err != SA_AIS_OK) - { - DEBUGLOG("ResourceOpen returned %d\n", err); - free(linfo); - return ais_to_errno(err); - } + if (flags & LKF_CONVERT) + lksb.sb_lkid = *lockid; - err = saLckResourceLock( - res_handle, - &lock_id, + err = dlm_ls_lock_wait(lockspace, mode, + &lksb, flags, + resource, + strlen(resource), 0, - SA_TIME_END, - &lockStatus); - if (err != SA_AIS_OK && lockStatus != SA_LCK_LOCK_GRANTED) + NULL, NULL, NULL); + + if (err != 0) { - free(linfo); - saLckResourceClose(res_handle); - return ais_to_errno(err); + DEBUGLOG("dlm_ls_lock returned %d\n", errno); + return err; + } + errno = lksb.sb_status; + if (lksb.sb_status != 0) + { + DEBUGLOG("dlm_ls_lock returns lksb.sb_status %d\n", lksb.sb_status); + return -1; } - - /* Wait for it to complete */ - - DEBUGLOG("lock_resource returning %d, lock_id=%llx\n", err, - lock_id); - linfo->lock_id = lock_id; - linfo->res_handle = res_handle; + DEBUGLOG("lock_resource returning %d, lock_id=%x\n", err, lksb.sb_lkid); - dm_hash_insert(lock_hash, resource, linfo); + *lockid = lksb.sb_lkid; - return ais_to_errno(err); + return 0; } - -static int _unlock_resource(char *resource, int lockid) +static int _sync_unlock(const char *resource, int lockid) { - SaAisErrorT err; - struct lock_info *linfo; + struct dlm_lksb lksb; + int err; - DEBUGLOG("unlock_resource %s\n", resource); - linfo = dm_hash_lookup(lock_hash, resource); - if (!linfo) - return 0; + DEBUGLOG("unlock_resource: %s lockid: %x\n", resource, lockid); + lksb.sb_lkid = lockid; - DEBUGLOG("unlock_resource: lockid: %llx\n", linfo->lock_id); - err = saLckResourceUnlock(linfo->lock_id, SA_TIME_END); - if (err != SA_AIS_OK) + err = dlm_ls_unlock_wait(lockspace, + lockid, + 0, + &lksb); + if (err != 0) { DEBUGLOG("Unlock returned %d\n", err); - return ais_to_errno(err); + return err; } - - /* Release the resource */ - dm_hash_remove(lock_hash, resource); - saLckResourceClose(linfo->res_handle); - free(linfo); - - return ais_to_errno(err); -} - -static int _sync_lock(const char *resource, int mode, int flags, int *lockid) -{ - int status; - char lock1[strlen(resource)+3]; - char lock2[strlen(resource)+3]; - - snprintf(lock1, sizeof(lock1), "%s-1", resource); - snprintf(lock2, sizeof(lock2), "%s-2", resource); - - switch (mode) + errno = lksb.sb_status; + if (lksb.sb_status != EUNLOCK) { - case LCK_EXCL: - status = _lock_resource(lock1, SA_LCK_EX_LOCK_MODE, flags, lockid); - if (status) - goto out; - - /* If we can't get this lock too then bail out */ - status = _lock_resource(lock2, SA_LCK_EX_LOCK_MODE, LCK_NONBLOCK, - lockid); - if (status == SA_LCK_LOCK_NOT_QUEUED) - { - _unlock_resource(lock1, *lockid); - status = -1; - errno = EAGAIN; - } - break; - - case LCK_PREAD: - case LCK_READ: - status = _lock_resource(lock1, SA_LCK_PR_LOCK_MODE, flags, lockid); - if (status) - goto out; - _unlock_resource(lock2, *lockid); - break; - - case LCK_WRITE: - status = _lock_resource(lock2, SA_LCK_EX_LOCK_MODE, flags, lockid); - if (status) - goto out; - _unlock_resource(lock1, *lockid); - break; - - default: - status = -1; - errno = EINVAL; - break; + DEBUGLOG("dlm_ls_unlock_wait returns lksb.sb_status: %x\n", lksb.sb_status); + return -1; } -out: - *lockid = mode; - return status; -} - -static int _sync_unlock(const char *resource, int lockid) -{ - int status = 0; - char lock1[strlen(resource)+3]; - char lock2[strlen(resource)+3]; - - snprintf(lock1, sizeof(lock1), "%s-1", resource); - snprintf(lock2, sizeof(lock2), "%s-2", resource); - - _unlock_resource(lock1, lockid); - _unlock_resource(lock2, lockid); + return 0; - return status; } /* We are always quorate ! */ Index: LVM2.2.02.39/daemons/clvmd/Makefile.in =================================================================== --- LVM2.2.02.39.orig/daemons/clvmd/Makefile.in 2009-02-25 18:52:32.000000000 +0800 +++ LVM2.2.02.39/daemons/clvmd/Makefile.in 2009-02-25 18:52:32.000000000 +0800 @@ -59,7 +59,7 @@ ifeq ("$(OPENAIS)", "yes") SOURCES += clvmd-openais.c - LMLIBS += -lSaLck -lcpg + LMLIBS += -ldlm -lcpg DEFS += -DUSE_OPENAIS endif Index: LVM2.2.02.39/daemons/clvmd/clvm.h =================================================================== --- LVM2.2.02.39.orig/daemons/clvmd/clvm.h 2009-02-25 18:52:32.000000000 +0800 +++ LVM2.2.02.39/daemons/clvmd/clvm.h 2009-02-25 18:52:32.000000000 +0800 @@ -79,6 +79,7 @@ /* Locking flags - these match the ones * in dlm.h */ +#ifndef LKF_NOQUEUE #define LKF_NOQUEUE (0x00000001) #define LKF_CANCEL (0x00000002) #define LKF_CONVERT (0x00000004) @@ -94,3 +95,4 @@ #define LKF_HEADQUE (0x00001000) #define LKF_NOORDER (0x00002000) #endif +#endif ++++++ cmdline_large_minor.diff ++++++ --- tools/lvmcmdline.c +++ tools/lvmcmdline.c 2008/02/20 10:45:12 @@ -265,8 +265,8 @@ if (!_get_int_arg(a, &ptr) || (*ptr) || (a->sign == SIGN_MINUS)) return 0; - if (a->i_value > 255) { - log_error("Minor number outside range 0-255"); + if (a->i_value > 1048575) { + log_error("Minor number outside range 0-1048575"); return 0; } ++++++ collect_lvm ++++++ #!/bin/sh PVNAME=$1 /sbin/lvm pvs --config "devices {filter = [ \"a|$PVNAME|\", \"r/.*/\" ]}" --partial -o vg_name,vg_attr,pv_uuid,vg_uuid --ignorelockingfailure --noheadings $PVNAME 2>/dev/null | while read vgname vgattr pvuuid vguuid; do if [[ $vgattr =~ mode. ]]; then continue fi if [[ $vgattr =~ .....c ]]; then exit 1 fi lvlist=$(/sbin/lvm lvs --config "devices {filter = [ \"a|$PVNAME|\", \"r/.*/\" ]}" --partial -o lv_name,lv_attr --ignorelockingfailure --noheadings $vgname 2>/dev/null | while read lvname lvattr; do if [[ $lvattr =~ mode. ]] ; then continue fi if [[ $lvattr =~ ....-. ]]; then echo -n $lvname fi done) if [ -z "$lvlist" ] ; then exit 1 fi pvlist=$(/sbin/lvm vgdisplay --config "devices {filter = [ \"a|$PVNAME|\", \"r/.*/\" ]}" --partial -v $vgname 2>/dev/null | while read str1 str2 val; do if [[ $str1 =~ PV && $str2 =~ UUID ]]; then echo $val fi done) echo PVUUID=$pvuuid echo VGUUID=$vguuid echo VGNAME=$vgname collected=0 for pv in $pvlist; do if [[ x$pv = x$pvuuid ]]; then continue fi if [[ ! -h /dev/disk/by-id/lvm2-pvuuid-$pv ]]; then echo COLLECT=1 collected=1 break fi done if [[ $collected = 0 ]]; then echo COLLECT=0 fi # /lib/udev/collect $vguuid $pvuuid $pvlist # echo COLLECT=$? done ++++++ device-mapper-dmsetup-deps-export.patch ++++++ Index: LVM2.2.02.45/tools/dmsetup.c =================================================================== --- LVM2.2.02.45.orig/tools/dmsetup.c 2009-04-27 17:46:16.000000000 +0800 +++ LVM2.2.02.45/tools/dmsetup.c 2009-04-27 17:58:50.000000000 +0800 @@ -1087,6 +1087,7 @@ const char *name = NULL; const char *uuid = NULL; struct dm_info info; + struct dm_deps *deps; if (data) name = names->name; @@ -1156,6 +1157,22 @@ printf("\n"); } + dm_task_destroy(dmt); + + if (!(dmt = dm_task_create(DM_DEVICE_DEPS))) + goto out; + + if (!_set_task_device(dmt, name, 0)) + goto out; + + if (!dm_task_run(dmt)) + goto out; + + if (!(deps = dm_task_get_deps(dmt))) + goto out; + + printf("DM_DEPS=%d\n", deps->count); + r = 1; out: if (dmt) ++++++ device-mapper-dmsetup-export.patch ++++++ Index: LVM2.2.02.45/tools/dmsetup.c =================================================================== --- LVM2.2.02.45.orig/tools/dmsetup.c 2008-10-31 01:52:06.000000000 +0800 +++ LVM2.2.02.45/tools/dmsetup.c 2009-04-27 17:46:16.000000000 +0800 @@ -1075,6 +1075,94 @@ return r; } +static int _export(int argc, char **argv, void *data) +{ + int r = 0; + struct dm_task *dmt = NULL; + void *next = NULL; + uint64_t start, length; + char *target_type = NULL; + char *params; + struct dm_names *names = (struct dm_names *) data; + const char *name = NULL; + const char *uuid = NULL; + struct dm_info info; + + if (data) + name = names->name; + else if (argc == 2) + name = argv[1]; + + if (!(dmt = dm_task_create(DM_DEVICE_STATUS))) + goto out; + + if (!_set_task_device(dmt, name, 0)) + goto out; + + if (!dm_task_run(dmt)) + goto out; + + if (!dm_task_get_info(dmt, &info) || !info.exists) + goto out; + + if (!name) + name = dm_task_get_name(dmt); + + uuid = dm_task_get_uuid(dmt); + printf("DM_NAME=%s\n", name); + + if ((uuid = dm_task_get_uuid(dmt)) && *uuid) + printf("DM_UUID=%s\n", uuid); + + if (!info.exists) { + printf("DM_STATE=NOTPRESENT\n"); + goto out; + } + + printf("DM_STATE=%s\n", + info.suspended ? "SUSPENDED" : + (info.read_only ? "READONLY" : "ACTIVE")); + + if (!info.live_table && !info.inactive_table) + printf("DM_TABLE_STATE=NONE\n"); + else + printf("DM_TABLE_STATE=%s%s%s\n", + info.live_table ? "LIVE" : "", + info.live_table && info.inactive_table ? "/" : "", + info.inactive_table ? "INACTIVE" : ""); + + if (info.open_count != -1) + printf("DM_OPENCOUNT=%d\n", info.open_count); + + printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr); + + printf("DM_MAJOR=%d\n", info.major); + printf("DM_MINOR=%d\n", info.minor); + + if (info.target_count != -1) + printf("DM_TARGET_COUNT=%d\n", info.target_count); + + /* export all table types */ + next = dm_get_next_target(dmt, next, &start, &length, + &target_type, ¶ms); + if (target_type) { + printf("DM_TARGET_TYPES=%s", target_type); + while (next) { + next = dm_get_next_target(dmt, next, &start, &length, + &target_type, ¶ms); + if (target_type) + printf(",%s", target_type); + } + printf("\n"); + } + + r = 1; + out: + if (dmt) + dm_task_destroy(dmt); + return r; +} + /* Show target names and their version numbers */ static int _targets(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused))) { @@ -2115,6 +2203,7 @@ {"info", "[<device>]", 0, 1, _info}, {"deps", "[<device>]", 0, 1, _deps}, {"status", "[<device>] [--target <target_type>]", 0, 1, _status}, + {"export", "[<device>]", 0, 1, _export}, {"table", "[<device>] [--target <target_type>] [--showkeys]", 0, 1, _status}, {"wait", "<device> [<event_nr>]", 0, 2, _wait}, {"mknodes", "[<device>]", 0, 1, _mknodes}, Index: LVM2.2.02.45/man/dmsetup.8.in =================================================================== --- LVM2.2.02.45.orig/man/dmsetup.8.in 2007-12-28 23:13:38.000000000 +0800 +++ LVM2.2.02.45/man/dmsetup.8.in 2009-04-27 17:48:53.000000000 +0800 @@ -46,6 +46,9 @@ .I [--noheadings] [--separator separator] [-o fields] [-O|--sort sort_fields] .I [device_name] .br +.B dmsetup export +.I [device_name] +.br .B dmsetup deps .I [device_name] .br @@ -146,6 +149,10 @@ If successful a device will appear as /dev/device-mapper/<device-name>. See below for information on the table format. +.IP \fBexport +.I [device_name] +.br +Outputs information in key/value format to be imported by other programs. .IP \fBdeps .I [device_name] .br ++++++ device-mapper-gcc-warning.diff ++++++ Index: LVM2.2.02.45/libdm/datastruct/hash.c =================================================================== --- LVM2.2.02.45.orig/libdm/datastruct/hash.c 2008-11-04 02:59:59.000000000 +0800 +++ LVM2.2.02.45/libdm/datastruct/hash.c 2009-04-27 17:52:05.000000000 +0800 @@ -19,7 +19,7 @@ struct dm_hash_node *next; void *data; unsigned keylen; - char key[0]; + unsigned char key[0]; }; struct dm_hash_table { @@ -140,7 +140,7 @@ static struct dm_hash_node **_find(struct dm_hash_table *t, const char *key, uint32_t len) { - unsigned h = _hash(key, len) & (t->num_slots - 1); + unsigned h = _hash((unsigned char*)key, len) & (t->num_slots - 1); struct dm_hash_node **c; for (c = &t->slots[h]; *c; c = &((*c)->next)) @@ -235,7 +235,7 @@ char *dm_hash_get_key(struct dm_hash_table *t __attribute((unused)), struct dm_hash_node *n) { - return n->key; + return (char*)n->key; } void *dm_hash_get_data(struct dm_hash_table *t __attribute((unused)), Index: LVM2.2.02.45/libdm/ioctl/libdm-iface.c =================================================================== --- LVM2.2.02.45.orig/libdm/ioctl/libdm-iface.c 2009-02-13 04:42:07.000000000 +0800 +++ LVM2.2.02.45/libdm/ioctl/libdm-iface.c 2009-04-27 17:53:30.000000000 +0800 @@ -1668,7 +1668,8 @@ dmt->no_open_count ? 'N' : 'O', dmt->no_flush ? 'N' : 'F', dmt->skip_lockfs ? "S " : "", - dmt->sector, dmt->message ? dmt->message : "", + (unsigned long long int)dmt->sector, + dmt->message ? dmt->message : "", dmi->data_size); #ifdef DM_IOCTLS if (ioctl(_control_fd, command, dmi) < 0) { ++++++ device-mapper-static.diff ++++++ Index: LVM2.2.02.45/libdm/Makefile.in =================================================================== --- LVM2.2.02.45.orig/libdm/Makefile.in 2009-04-27 17:41:57.000000000 +0800 +++ LVM2.2.02.45/libdm/Makefile.in 2009-04-27 17:56:06.000000000 +0800 @@ -78,7 +78,6 @@ $(libdir)/libdevmapper.$(LIB_SUFFIX) install_static: install_@interface@_static - $(LN_S) -f libdevmapper.a.$(LIB_VERSION_DM) $(libdir)/libdevmapper.a install_ioctl: ioctl/libdevmapper.$(LIB_SUFFIX) $(INSTALL) -D -m 555 $(STRIP) $< \ @@ -90,7 +89,7 @@ install_ioctl_static: ioctl/libdevmapper.a $(INSTALL) -D -m 555 $(STRIP) $< \ - $(libdir)/libdevmapper.a.$(LIB_VERSION_DM) + $(libdir)/libdevmapper.a $(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION_DM): $(interface)/%.$(LIB_SUFFIX) rm -f $@ ++++++ device-mapper-wait_udev.diff ++++++ Index: LVM2.2.02.45/libdm/ioctl/libdm-iface.c =================================================================== --- LVM2.2.02.45.orig/libdm/ioctl/libdm-iface.c 2009-04-27 17:53:30.000000000 +0800 +++ LVM2.2.02.45/libdm/ioctl/libdm-iface.c 2009-04-27 17:57:54.000000000 +0800 @@ -129,6 +129,67 @@ # define DM_EXISTS_FLAG 0x00000004 #endif +static unsigned long long get_seq() +{ + struct stat s; + int r; + unsigned long long seq = 0; + FILE* fp; + r = stat("/sys/kernel/uevent_seqnum", &s); + if (r) { return seq; } + if (!S_ISREG(s.st_mode)) { return seq; } + fp = fopen("/sys/kernel/uevent_seqnum", "r"); + if (fp == NULL) { return seq; } + fscanf(fp, "%llu\n", &seq); + fclose(fp); + return seq; +} + +static int wait_4_udev(unsigned long long start_seq, unsigned long long end_seq) +{ + FILE* fp; + struct stat s; + int r; + int ite=30; /* Iterate 30 times. Otherwise, it's considered timed out */ + unsigned long long seq; + /* + * len("/dev/.udev/queue/") + len(str(0xffffffffffffffff)) = 38 + */ + #define PATH_SIZE 40 + char filename[PATH_SIZE]; + #undef PATH_SIZE + + if (start_seq > end_seq || end_seq == 0) return 1; + + /* Wait until end_seq is enqueued into udev */ + r = stat("/dev/.udev/uevent_seqnum", &s); + if (r) { return 1; } + if (!S_ISREG(s.st_mode)) { return 1; } + while (ite-- > 0) { + fp = fopen("/dev/.udev/uevent_seqnum", "r"); + if (fp == NULL) { return 1; } + fscanf(fp, "%llu\n", &seq); + fclose(fp); + if (seq >= end_seq) { break; } + usleep(200000); + } + if (ite <=0 ) return 1; + + /* Loop to make sure all $seq are unlinked in /dev/.udev/queue then */ + for (seq = start_seq; seq <= end_seq; seq++) { + ite = 30; + while (ite-- > 0) { + snprintf(filename, sizeof(filename), "/dev/.udev/queue/%llu", seq); + r = open(filename, O_RDONLY); + if (r == -1 && errno == ENOENT) break; + if (r >= 0) close(r); + usleep(200000); + } + if (ite <=0 ) return 1; + } + return 0; +} + static void *_align(void *ptr, unsigned int a) { register unsigned long agn = --a; @@ -679,6 +740,7 @@ { struct dm_ioctl_v1 *dmi; unsigned int command; + unsigned long long before_seq, after_seq; dmi = _flatten_v1(dmt); if (!dmi) { @@ -705,6 +767,8 @@ dmi->name, dmi->uuid, dmt->newname ? " " : "", dmt->newname ? dmt->newname : "", dmi->data_size); + + before_seq = get_seq(); if (dmt->type == DM_DEVICE_LIST) { if (!_dm_names_v1(dmi)) goto bad; @@ -724,10 +788,13 @@ #else /* Userspace alternative for testing */ #endif + after_seq = get_seq(); if (dmi->flags & DM_BUFFER_FULL_FLAG) /* FIXME Increase buffer size and retry operation (if query) */ log_error("WARNING: libdevmapper buffer too small for data"); + wait_4_udev(before_seq, after_seq); + switch (dmt->type) { case DM_DEVICE_CREATE: add_dev_node(dmt->dev_name, MAJOR(dmi->dev), MINOR(dmi->dev), @@ -1706,6 +1773,7 @@ { struct dm_ioctl *dmi; unsigned command; + unsigned long long before_seq, after_seq; #ifdef DM_COMPAT if (_dm_version == 1) @@ -1736,9 +1804,11 @@ return 0; repeat_ioctl: + before_seq = get_seq(); if (!(dmi = _do_dm_ioctl(dmt, command, _ioctl_buffer_double_factor))) return 0; + after_seq = get_seq(); if (dmi->flags & DM_BUFFER_FULL_FLAG) { switch (dmt->type) { case DM_DEVICE_LIST_VERSIONS: @@ -1755,6 +1825,8 @@ } } + wait_4_udev(before_seq, after_seq); + switch (dmt->type) { case DM_DEVICE_CREATE: if (dmt->dev_name && *dmt->dev_name) ++++++ dont_ignore_tmp_device_file.diff ++++++ Index: LVM2.2.02.39/lib/device/dev-cache.c =================================================================== --- LVM2.2.02.39.orig/lib/device/dev-cache.c 2008-05-29 06:27:47.000000000 +0800 +++ LVM2.2.02.39/lib/device/dev-cache.c 2009-03-16 23:14:49.000000000 +0800 @@ -356,7 +356,11 @@ dirent_count = scandir(dir, &dirent, NULL, alphasort); if (dirent_count > 0) { for (n = 0; n < dirent_count; n++) { - if (dirent[n]->d_name[0] == '.') { + if (dirent[n]->d_name[0] == '.' && dirent[n]->d_name[1] == '\0') { + free(dirent[n]); + continue; + } + if (dirent[0]->d_name[0] == '.' && dirent[n]->d_name[1] == '.' && dirent[n]->d_name[2] == '\0') { free(dirent[n]); continue; } ++++++ enable-clvmd.patch ++++++ --- daemons/clvmd/clvmd.c +++ daemons/clvmd/clvmd.c @@ -37,7 +37,7 @@ #include <syslog.h> #include <errno.h> #include <limits.h> -#include <libdlm.h> +//#include <libdlm.h> #include "clvmd-comms.h" #include "lvm-functions.h" --- daemons/clvmd/clvmd-command.c +++ daemons/clvmd/clvmd-command.c @@ -65,7 +65,7 @@ #include <unistd.h> #include <errno.h> #include <libdevmapper.h> -#include <libdlm.h> +//#include <libdlm.h> #include "list.h" #include "locking.h" --- daemons/clvmd/clvm.h +++ daemons/clvmd/clvm.h @@ -68,4 +68,29 @@ #define CLVMD_CMD_GET_CLUSTERNAME 41 #define CLVMD_CMD_SET_DEBUG 42 #define CLVMD_CMD_VG_BACKUP 43 + +/* Lock modes: */ +#define LKM_NLMODE 0 /* null lock */ +#define LKM_CRMODE 1 /* concurrent read */ +#define LKM_CWMODE 2 /* concurrent write */ +#define LKM_PRMODE 3 /* protected read */ +#define LKM_PWMODE 4 /* protected write */ +#define LKM_EXMODE 5 /* exclusive */ +/* Locking flags - these match the ones + * in dlm.h + */ +#define LKF_NOQUEUE (0x00000001) +#define LKF_CANCEL (0x00000002) +#define LKF_CONVERT (0x00000004) +#define LKF_VALBLK (0x00000008) +#define LKF_QUECVT (0x00000010) +#define LKF_IVVALBLK (0x00000020) +#define LKF_CONVDEADLK (0x00000040) +#define LKF_PERSISTENT (0x00000080) +#define LKF_NODLCKWT (0x00000100) +#define LKF_NODLCKBLK (0x00000200) +#define LKF_EXPEDITE (0x00000400) +#define LKF_NOQUEUEBAST (0x00000800) +#define LKF_HEADQUE (0x00001000) +#define LKF_NOORDER (0x00002000) #endif --- daemons/clvmd/lvm-functions.c +++ daemons/clvmd/lvm-functions.c @@ -31,7 +31,7 @@ #include <syslog.h> #include <assert.h> #include <libdevmapper.h> -#include <libdlm.h> +//#include <libdlm.h> #include "list.h" #include "lvm-types.h" ++++++ improve_probing.diff ++++++ Index: lib/filters/filter.c =================================================================== --- lib/filters/filter.c.orig 2009-04-27 16:15:37.000000000 +0800 +++ lib/filters/filter.c 2009-04-27 16:15:39.000000000 +0800 @@ -13,6 +13,12 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <sys/ioctl.h> +#include <linux/fs.h> +#undef MAJOR +#undef MINOR +#undef MKDEV + #include "lib.h" #include "dev-cache.h" #include "filter.h" @@ -103,11 +109,18 @@ } /* Check it's accessible */ - if (!dev_open_flags(dev, O_RDONLY, 0, 1)) { + if (!dev_open_flags(dev, O_RDONLY|O_NONBLOCK, 0, 1)) { log_debug("%s: Skipping: open failed", name); return 0; } - + + /* Skip cdrom device */ + #define CDROM_GET_CAPABILITY 0x5331 + if (ioctl(dev->fd, CDROM_GET_CAPABILITY) >= 0) { + log_debug("%s: Skipping: cdrom device", name ); + goto out; + } + /* Check it's not too small */ if (!dev_get_size(dev, &size)) { log_debug("%s: Skipping: dev_get_size failed", name); ++++++ k_dev_t.dif ++++++ Index: LVM2.2.02.45/libdm/ioctl/libdm-compat.h =================================================================== --- LVM2.2.02.45.orig/libdm/ioctl/libdm-compat.h 2008-11-01 10:19:18.000000000 +0800 +++ LVM2.2.02.45/libdm/ioctl/libdm-compat.h 2009-04-27 17:43:08.000000000 +0800 @@ -40,7 +40,7 @@ int32_t open_count; /* out */ uint32_t flags; /* in/out */ - __kernel_dev_t dev; /* in/out */ + __kernel_old_dev_t dev; /* in/out */ char name[DM_NAME_LEN]; /* device name */ char uuid[DM_UUID_LEN]; /* unique identifier for @@ -60,7 +60,7 @@ struct dm_target_deps_v1 { uint32_t count; - __kernel_dev_t dev[0]; /* out */ + __kernel_old_dev_t dev[0]; /* out */ }; enum { ++++++ lvm.conf ++++++ # This is an example configuration file for the LVM2 system. # It contains the default settings that would be used if there was no # /etc/lvm/lvm.conf file. # # Refer to 'man lvm.conf' for further information including the file layout. # # To put this file in a different directory and override /etc/lvm set # the environment variable LVM_SYSTEM_DIR before running the tools. # This section allows you to configure which block devices should # be used by the LVM system. devices { # Where do you want your volume groups to appear ? dir = "/dev" # An array of directories that contain the device nodes you wish # to use with LVM2. scan = [ "/dev" ] # A filter that tells LVM2 to only use a restricted set of devices. # The filter consists of an array of regular expressions. These # expressions can be delimited by a character of your choice, and # prefixed with either an 'a' (for accept) or 'r' (for reject). # The first expression found to match a device name determines if # the device will be accepted or rejected (ignored). Devices that # don't match any patterns are accepted. # Remember to run vgscan after you change this parameter to ensure # that the cache file gets regenerated (see below). # By default we accept every block device except udev names: filter = [ "r|/dev/.*/by-path/.*|", "r|/dev/.*/by-id/.*|", "a/.*/" ] # Exclude the cdrom drive # filter = [ "r|/dev/cdrom|" ] # When testing I like to work with just loopback devices: # filter = [ "a/loop/", "r/.*/" ] # Or maybe all loops and ide drives except hdc: # filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ] # Use anchors if you want to be really specific # filter = [ "a|^/dev/hda8$|", "r/.*/" ] # The results of the filtering are cached on disk to avoid # rescanning dud devices (which can take a very long time). By # default this cache file is hidden in the /etc/lvm directory. # It is safe to delete this file: the tools regenerate it. cache = "/etc/lvm/.cache" # You can turn off writing this cache file by setting this to 0. write_cache_state = 1 # Advanced settings. # List of pairs of additional acceptable block device types found # in /proc/devices with maximum (non-zero) number of partitions. # types = [ "fd", 16 ] # If sysfs is mounted (2.6 kernels) restrict device scanning to # the block devices it believes are valid. # 1 enables; 0 disables. sysfs_scan = 1 # By default, LVM2 will ignore devices used as components of # software RAID (md) devices by looking for md superblocks. # 1 enables; 0 disables. md_component_detection = 1 } # This section that allows you to configure the nature of the # information that LVM2 reports. log { # Controls the messages sent to stdout or stderr. # There are three levels of verbosity, 3 being the most verbose. verbose = 0 # Should we send log messages through syslog? # 1 is yes; 0 is no. syslog = 1 # Should we log error and debug messages to a file? # By default there is no log file. #file = "/var/log/lvm2.log" # Should we overwrite the log file each time the program is run? # By default we append. overwrite = 0 # What level of log messages should we send to the log file and/or syslog? # There are 6 syslog-like log levels currently in use - 2 to 7 inclusive. # 7 is the most verbose (LOG_DEBUG). level = 0 # Format of output messages # Whether or not (1 or 0) to indent messages according to their severity indent = 1 # Whether or not (1 or 0) to display the command name on each line output command_names = 0 # A prefix to use before the message text (but after the command name, # if selected). Default is two spaces, so you can see/grep the severity # of each message. prefix = " " # To make the messages look similar to the original LVM tools use: # indent = 0 # command_names = 1 # prefix = " -- " # Set this if you want log messages during activation. # Don't use this in low memory situations (can deadlock). # activation = 0 } # Configuration of metadata backups and archiving. In LVM2 when we # talk about a 'backup' we mean making a copy of the metadata for the # *current* system. The 'archive' contains old metadata configurations. # Backups are stored in a human readeable text format. backup { # Should we maintain a backup of the current metadata configuration ? # Use 1 for Yes; 0 for No. # Think very hard before turning this off! backup = 1 # Where shall we keep it ? # Remember to back up this directory regularly! backup_dir = "/etc/lvm/backup" # Should we maintain an archive of old metadata configurations. # Use 1 for Yes; 0 for No. # On by default. Think very hard before turning this off. archive = 1 # Where should archived files go ? # Remember to back up this directory regularly! archive_dir = "/etc/lvm/archive" # What is the minimum number of archive files you wish to keep ? retain_min = 10 # What is the minimum time you wish to keep an archive file for ? retain_days = 30 } # Settings for the running LVM2 in shell (readline) mode. shell { # Number of lines of history to store in ~/.lvm_history history_size = 100 } # Miscellaneous global LVM2 settings global { # The file creation mask for any files and directories created. # Interpreted as octal if the first digit is zero. umask = 077 # Allow other users to read the files #umask = 022 # Enabling test mode means that no changes to the on disk metadata # will be made. Equivalent to having the -t option on every # command. Defaults to off. test = 0 # Whether or not to communicate with the kernel device-mapper. # Set to 0 if you want to use the tools to manipulate LVM metadata # without activating any logical volumes. # If the device-mapper kernel driver is not present in your kernel # setting this to 0 should suppress the error messages. activation = 1 # If we can't communicate with device-mapper, should we try running # the LVM1 tools? # This option only applies to 2.4 kernels and is provided to help you # switch between device-mapper kernels and LVM1 kernels. # The LVM1 tools need to be installed with .lvm1 suffices # e.g. vgscan.lvm1 and they will stop working after you start using # the new lvm2 on-disk metadata format. # The default value is set when the tools are built. # fallback_to_lvm1 = 0 # The default metadata format that commands should use - "lvm1" or "lvm2". # The command line override is -M1 or -M2. # Defaults to "lvm1" if compiled in, else "lvm2". # format = "lvm1" # Location of proc filesystem proc = "/proc" # Type of locking to use. Defaults to file-based locking (1). # Turn locking off by setting to 0 (dangerous: risks metadata corruption # if LVM2 commands get run concurrently). locking_type = 1 # Local non-LV directory that holds file-based locks while commands are # in progress. A directory like /tmp that may get wiped on reboot is OK. locking_dir = "/var/lock/lvm" # Other entries can go here to allow you to load shared libraries # e.g. if support for LVM1 metadata was compiled as a shared library use # format_libraries = "liblvm2format1.so" # Full pathnames can be given. # Search this directory first for shared libraries. # library_dir = "/lib" } activation { # Device used in place of missing stripes if activating incomplete volume. # For now, you need to set this up yourself first (e.g. with 'dmsetup') # For example, you could make it return I/O errors using the 'error' # target or make it return zeros. missing_stripe_filler = "/dev/ioerror" # Size (in KB) of each copy operation when mirroring mirror_region_size = 512 # How much stack (in KB) to reserve for use while devices suspended reserved_stack = 256 # How much memory (in KB) to reserve for use while devices suspended reserved_memory = 8192 # Nice value used while devices suspended process_priority = -18 # If volume_list is defined, each LV is only activated if there is a # match against the list. # "vgname" and "vgname/lvname" are matched exactly. # "@tag" matches any tag set in the LV or VG. # "@*" matches if any tag defined on the host is also set in the LV or VG # # volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ] } #################### # Advanced section # #################### # Metadata settings # # metadata { # Default number of copies of metadata to hold on each PV. 0, 1 or 2. # It's best to leave this at 2. # You might want to override it from the command line with 0 or 1 # when running pvcreate on new PVs which are to be added to large VGs. # pvmetadatacopies = 2 # Approximate default size of on-disk metadata areas in sectors. # You should increase this if you have large volume groups or # you want to retain a large on-disk history of your metadata changes. # pvmetadatasize = 255 # List of directories holding live copies of text format metadata. # These directories must not be on logical volumes! # It's possible to use LVM2 with a couple of directories here, # preferably on different (non-LV) filesystems, and with no other # on-disk metadata (pvmetadatacopies = 0). Or this can be in # addition to on-disk metadata areas. # The feature was originally added to simplify testing and is not # supported under low memory situations - the machine could lock up. # # Never edit any files in these directories by hand unless you # you are absolutely sure you know what you are doing! Use # the supplied toolset to make changes (e.g. vgcfgrestore). # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ] #} dmeventd { # mirror_library is the library used when monitoring a mirror device. # # "libdevmapper-event-lvm2mirror.so" attempts to recover from # failures. It removes failed devices from a volume group and # reconfigures a mirror as necessary. If no mirror library is # provided, mirrors are not monitored through dmeventd. mirror_library = "libdevmapper-event-lvm2mirror.so.2.02" # snapshot_library is the library used when monitoring a snapshot device. # # "libdevmapper-event-lvm2snapshot.so" monitors the filling of # snapshots and emits a warning through syslog, when the use of # snapshot exceedes 80%. The warning is repeated when 85%, 90% and # 95% of the snapshot are filled. snapshot_library = "libdevmapper-event-lvm2snapshot.so.2.02" } ++++++ lvm-no_chown.diff ++++++ Index: daemons/clvmd/Makefile.in =================================================================== --- daemons/clvmd/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ daemons/clvmd/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -107,7 +107,7 @@ .PHONY: install_clvmd install_clvmd: $(TARGETS) - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) clvmd \ + $(INSTALL) -D -m 555 $(STRIP) clvmd \ $(usrsbindir)/clvmd install: $(INSTALL_TARGETS) Index: doc/Makefile.in =================================================================== --- doc/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ doc/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -23,7 +23,7 @@ install: @if [ ! -e $(confdir)/$(CONFDEST) ]; then \ echo "Installing $(CONFSRC) as $(confdir)/$(CONFDEST)"; \ - @INSTALL@ -D $(OWNER) $(GROUP) -m 644 $(CONFSRC) \ + @INSTALL@ -D -m 644 $(CONFSRC) \ $(confdir)/$(CONFDEST); \ fi Index: lib/format1/Makefile.in =================================================================== --- lib/format1/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ lib/format1/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -31,7 +31,7 @@ include $(top_srcdir)/make.tmpl install: liblvm2format1.so - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/liblvm2format1.so.$(LIB_VERSION) $(LN_S) -f liblvm2format1.so.$(LIB_VERSION) $(libdir)/liblvm2format1.so Index: lib/format_pool/Makefile.in =================================================================== --- lib/format_pool/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ lib/format_pool/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -28,7 +28,7 @@ include $(top_srcdir)/make.tmpl install: liblvm2formatpool.so - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/liblvm2formatpool.so.$(LIB_VERSION) $(LN_S) -f liblvm2formatpool.so.$(LIB_VERSION) \ $(libdir)/liblvm2formatpool.so Index: lib/locking/Makefile.in =================================================================== --- lib/locking/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ lib/locking/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -24,7 +24,7 @@ include $(top_srcdir)/make.tmpl install install_cluster: liblvm2clusterlock.so - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/liblvm2clusterlock.so.$(LIB_VERSION) $(LN_S) -f liblvm2clusterlock.so.$(LIB_VERSION) \ $(libdir)/liblvm2clusterlock.so Index: lib/mirror/Makefile.in =================================================================== --- lib/mirror/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ lib/mirror/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -24,7 +24,7 @@ include $(top_srcdir)/make.tmpl install: liblvm2mirror.so - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/liblvm2mirror.so.$(LIB_VERSION) $(LN_S) -f liblvm2mirror.so.$(LIB_VERSION) $(libdir)/liblvm2mirror.so Index: lib/snapshot/Makefile.in =================================================================== --- lib/snapshot/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ lib/snapshot/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -24,7 +24,7 @@ include $(top_srcdir)/make.tmpl install: liblvm2snapshot.so - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/liblvm2snapshot.so.$(LIB_VERSION) $(LN_S) -f liblvm2snapshot.so.$(LIB_VERSION) \ $(libdir)/liblvm2snapshot.so Index: man/Makefile.in =================================================================== --- man/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ man/Makefile.in 2009-04-27 16:52:20.000000000 +0800 @@ -62,14 +62,14 @@ @for f in $(MAN8); \ do \ $(RM) $(MAN8DIR)/$$f; \ - @INSTALL@ -D $(OWNER) $(GROUP) -m 444 $$f $(MAN8DIR)/$$f; \ + @INSTALL@ -D -m 444 $$f $(MAN8DIR)/$$f; \ done @echo "Installing $(MAN5) in $(MAN5DIR)" @for f in $(MAN5); \ do \ $(RM) $(MAN5DIR)/$$f; \ - @INSTALL@ -D $(OWNER) $(GROUP) -m 444 $$f $(MAN5DIR)/$$f; \ + @INSTALL@ -D -m 444 $$f $(MAN5DIR)/$$f; \ done install_cluster: @@ -77,7 +77,7 @@ @for f in $(MAN8CLUSTER); \ do \ $(RM) $(MAN8DIR)/$$f; \ - @INSTALL@ -D $(OWNER) $(GROUP) -m 444 $$f $(MAN8DIR)/$$f; \ + @INSTALL@ -D -m 444 $$f $(MAN8DIR)/$$f; \ done install_device-mapper: @@ -85,5 +85,5 @@ @for f in $(MAN8DM); \ do \ $(RM) $(MAN8DIR)/$$f; \ - @INSTALL@ -D $(OWNER) $(GROUP) -m 444 $$f $(MAN8DIR)/$$f; \ + @INSTALL@ -D -m 444 $$f $(MAN8DIR)/$$f; \ done Index: po/Makefile.in =================================================================== --- po/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ po/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -53,13 +53,13 @@ @echo Installing translation files in $(localedir) @( \ for lang in $(LANGS); do \ - $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $$lang.mo \ + $(INSTALL) -D -m 444 $$lang.mo \ $(localedir)/$$lang/LC_MESSAGES/lvm2.mo;\ done; \ ) @( \ for lang in $(LANGS); do \ - $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $$lang.mo \ + $(INSTALL) -D -m 444 $$lang.mo \ $(localedir)/$$lang/LC_MESSAGES/device-mapper.mo;\ done; \ ) Index: scripts/Makefile.in =================================================================== --- scripts/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ scripts/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -18,9 +18,9 @@ include $(top_srcdir)/make.tmpl install: - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) lvm_dump.sh \ + $(INSTALL) -D -m 555 $(STRIP) lvm_dump.sh \ $(sbindir)/lvmdump ifeq ("@FSADM@", "yes") - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) fsadm.sh \ + $(INSTALL) -D -m 555 $(STRIP) fsadm.sh \ $(sbindir)/fsadm endif Index: tools/Makefile.in =================================================================== --- tools/Makefile.in.orig 2009-04-27 16:51:29.000000000 +0800 +++ tools/Makefile.in 2009-04-27 16:51:32.000000000 +0800 @@ -156,21 +156,21 @@ endif install_cmdlib_dynamic: liblvm2cmd.$(LIB_SUFFIX) - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) liblvm2cmd.$(LIB_SUFFIX) \ + $(INSTALL) -D -m 555 $(STRIP) liblvm2cmd.$(LIB_SUFFIX) \ $(libdir)/liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION_LVM) $(LN_S) -f liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION_LVM) $(libdir)/liblvm2cmd.$(LIB_SUFFIX) - $(INSTALL) -D $(OWNER) $(GROUP) -m 444 lvm2cmd.h \ + $(INSTALL) -D -m 444 lvm2cmd.h \ $(includedir)/lvm2cmd.h install_cmdlib_static: liblvm2cmd-static.a - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) liblvm2cmd-static.a \ + $(INSTALL) -D -m 555 $(STRIP) liblvm2cmd-static.a \ $(libdir)/liblvm2cmd.a.$(LIB_VERSION_LVM) $(LN_S) -f liblvm2cmd.a.$(LIB_VERSION_LVM) $(libdir)/liblvm2cmd.a - $(INSTALL) -D $(OWNER) $(GROUP) -m 444 lvm2cmd.h \ + $(INSTALL) -D -m 444 lvm2cmd.h \ $(includedir)/lvm2cmd.h install_tools_dynamic: lvm .commands - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) lvm \ + $(INSTALL) -D -m 555 $(STRIP) lvm \ $(sbindir)/lvm @echo Creating symbolic links for individual commands in $(sbindir) @( \ @@ -181,14 +181,14 @@ ) install_tools_static: lvm.static - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) lvm.static \ + $(INSTALL) -D -m 555 $(STRIP) lvm.static \ $(staticdir)/lvm.static install_dmsetup_dynamic: dmsetup - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$< + $(INSTALL) -D -m 555 $(STRIP) $< $(sbindir)/$< install_dmsetup_static: dmsetup.static - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$< + $(INSTALL) -D -m 555 $(STRIP) $< $(sbindir)/$< install_device-mapper: $(INSTALL_DMSETUP_TARGETS) Index: daemons/dmeventd/Makefile.in =================================================================== --- daemons/dmeventd/Makefile.in.orig 2008-11-05 01:25:32.000000000 +0800 +++ daemons/dmeventd/Makefile.in 2009-04-27 16:57:01.000000000 +0800 @@ -64,24 +64,24 @@ install_device-mapper: install install_include: - $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper-event.h \ + $(INSTALL) -D -m 444 libdevmapper-event.h \ $(includedir)/libdevmapper-event.h install_dynamic: libdevmapper-event.$(LIB_SUFFIX) - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION) $(LN_S) -f libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION) \ $(libdir)/libdevmapper-event.$(LIB_SUFFIX) install_dmeventd: dmeventd - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$< + $(INSTALL) -D -m 555 $(STRIP) $< $(sbindir)/$< install_pkgconfig: - $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper-event.pc \ + $(INSTALL) -D -m 444 libdevmapper-event.pc \ $(usrlibdir)/pkgconfig/devmapper-event.pc install_static: libdevmapper-event.a - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/libdevmapper-event.a.$(LIB_VERSION) $(LN_S) -f libdevmapper-event.a.$(LIB_VERSION) $(libdir)/libdevmapper-event.a Index: daemons/dmeventd/plugins/mirror/Makefile.in =================================================================== --- daemons/dmeventd/plugins/mirror/Makefile.in.orig 2008-11-04 06:14:26.000000000 +0800 +++ daemons/dmeventd/plugins/mirror/Makefile.in 2009-04-27 16:55:45.000000000 +0800 @@ -32,6 +32,6 @@ include $(top_srcdir)/make.tmpl install: libdevmapper-event-lvm2mirror.$(LIB_SUFFIX) - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/$<.$(LIB_VERSION) $(LN_S) -f $<.$(LIB_VERSION) $(libdir)/$< Index: daemons/dmeventd/plugins/snapshot/Makefile.in =================================================================== --- daemons/dmeventd/plugins/snapshot/Makefile.in.orig 2008-11-04 06:14:27.000000000 +0800 +++ daemons/dmeventd/plugins/snapshot/Makefile.in 2009-04-27 16:56:00.000000000 +0800 @@ -32,6 +32,6 @@ include $(top_srcdir)/make.tmpl install: libdevmapper-event-lvm2snapshot.$(LIB_SUFFIX) - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/$<.$(LIB_VERSION) $(LN_S) -f $<.$(LIB_VERSION) $(libdir)/$< Index: libdm/Makefile.in =================================================================== --- libdm/Makefile.in.orig 2008-11-15 04:59:56.000000000 +0800 +++ libdm/Makefile.in 2009-04-27 16:57:28.000000000 +0800 @@ -70,7 +70,7 @@ install_device-mapper: install install_include: - $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper.h \ + $(INSTALL) -D -m 444 libdevmapper.h \ $(includedir)/libdevmapper.h install_dynamic: install_@interface@ @@ -81,15 +81,15 @@ $(LN_S) -f libdevmapper.a.$(LIB_VERSION_DM) $(libdir)/libdevmapper.a install_ioctl: ioctl/libdevmapper.$(LIB_SUFFIX) - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION_DM) install_pkgconfig: - $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper.pc \ + $(INSTALL) -D -m 444 libdevmapper.pc \ $(usrlibdir)/pkgconfig/devmapper.pc install_ioctl_static: ioctl/libdevmapper.a - $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \ + $(INSTALL) -D -m 555 $(STRIP) $< \ $(libdir)/libdevmapper.a.$(LIB_VERSION_DM) $(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION_DM): $(interface)/%.$(LIB_SUFFIX) ++++++ lvm-pv-create-link.diff ++++++ Index: LVM2.2.02.45/tools/pvremove.c =================================================================== --- LVM2.2.02.45.orig/tools/pvremove.c 2009-04-27 16:35:32.000000000 +0800 +++ LVM2.2.02.45/tools/pvremove.c 2009-04-27 16:49:48.000000000 +0800 @@ -18,6 +18,30 @@ const char _really_wipe[] = "Really WIPE LABELS from physical volume \"%s\" of volume group \"%s\" [y/n]? "; +static const char* pv_remove_symlink(struct cmd_context* cmd, const char* name) +{ + struct physical_volume *pv; + char *pvuuid; + char pvuuid_link[70]; + + if (!(pv = pv_read(cmd, name, NULL, NULL, 0, 0))) { + return NULL; + } + + pvuuid = malloc(sizeof(char)*40); + if (pvuuid == NULL) { + return NULL; + } + + id_write_format(&pv->id, pvuuid, 40); + + snprintf(pvuuid_link, 70, "/dev/disk/by-id/lvm2-pvuuid-%s", pvuuid); + unlink(pvuuid_link); //we really don't care if it successed or not. + + free(pvuuid); + return pvuuid; +} + /* * Decide whether it is "safe" to wipe the labels on this device. * 0 indicates we may not. @@ -125,6 +149,8 @@ log_print("Labels on physical volume \"%s\" successfully wiped", pv_name); + pv_remove_symlink(cmd, pv_name); + ret = ECMD_PROCESSED; error: Index: LVM2.2.02.45/tools/pvcreate.c =================================================================== --- LVM2.2.02.45.orig/tools/pvcreate.c 2009-04-27 16:35:32.000000000 +0800 +++ LVM2.2.02.45/tools/pvcreate.c 2009-04-27 16:45:34.000000000 +0800 @@ -36,6 +36,89 @@ const char _really_init[] = "Really INITIALIZE physical volume \"%s\" of volume group \"%s\" [y/n]? "; +static const char* pv_follow_if_link (const char* path) +{ + int r; + int len = 60; + char *fpath = NULL; + char *npath = NULL; + struct stat st; + + r = lstat(path, &st); + if (r == -1) return NULL; //shouldn't happen + + if (S_ISLNK(st.st_mode)) { + while (1) { + npath = realloc(fpath, sizeof(char)*len); + if (npath == NULL) { + if (fpath != NULL) free(fpath); + return NULL; + } + fpath = npath; + + memset(fpath, 0, sizeof(char)*len); + r = readlink(path, fpath, len); + if (r != -1 && fpath[len-1] == 0) break; + if (r == -1) { + free(fpath); + return NULL; + } else { + len = len * 2; + } + } + } + else { + fpath = strdup(path); + } + return fpath; +} + + +static const char* pv_symlink_handle(struct cmd_context* cmd, const char* name, int create) +{ + struct physical_volume *pv; + char *pvuuid; + char *pvuuid_link; + + pvuuid_link = malloc(70); + if (pvuuid_link == NULL) return NULL; + + if (!(pv = pv_read(cmd, name, NULL, NULL, 0, 0))) { + free(pvuuid_link); + return NULL; + } + + pvuuid = malloc(sizeof(char)*40); + if (pvuuid == NULL) { + free(pvuuid_link); + return NULL; + } + + id_write_format(&pv->id, pvuuid, 40); + + snprintf(pvuuid_link, 70, "/dev/disk/by-id/lvm2-pvuuid-%s", pvuuid); + + //we really don't care if it successed or not. + if (create) { + const char* tname = NULL; + int r; + tname = pv_follow_if_link(name); + if (tname != NULL) { + r = symlink(tname, pvuuid_link); + free(tname); + } + else { + symlink(name, pvuuid_link); + } + } else { + //pvuuid_link is saved for future unlink + //unlink(pvuuid_link); + } + + free(pvuuid); + return pvuuid_link; +} + /* * See if we may pvcreate on this device. * 0 indicates we may not. @@ -150,6 +233,8 @@ void *pv; struct device *dev; struct dm_list mdas; + const char *oldsymlink; + if (pp->idp) { if ((dev = device_from_pvid(cmd, pp->idp)) && @@ -213,12 +298,22 @@ log_very_verbose("Writing physical volume data to disk \"%s\"", pv_name); + + oldsymlink = pv_symlink_handle(cmd, pv_name, 0); + if (!(pv_write(cmd, (struct physical_volume *)pv, &mdas, pp->labelsector))) { log_error("Failed to write physical volume \"%s\"", pv_name); + if (oldsymlink) free(oldsymlink); goto error; } + pv_symlink_handle(cmd, pv_name, 1); + if (oldsymlink) { + unlink(oldsymlink); + free(oldsymlink); + } + log_print("Physical volume \"%s\" successfully created", pv_name); unlock_vg(cmd, VG_ORPHANS); Index: LVM2.2.02.45/tools/pvchange.c =================================================================== --- LVM2.2.02.45.orig/tools/pvchange.c 2009-04-27 16:35:32.000000000 +0800 +++ LVM2.2.02.45/tools/pvchange.c 2009-04-27 16:45:18.000000000 +0800 @@ -15,6 +15,90 @@ #include "tools.h" +static const char* pv_follow_if_link (const char* path) +{ + int r; + int len = 60; + char *fpath = NULL; + char *npath = NULL; + struct stat st; + + r = lstat(path, &st); + if (r == -1) return NULL; //shouldn't happen + + if (S_ISLNK(st.st_mode)) { + while (1) { + npath = realloc(fpath, sizeof(char)*len); + if (npath == NULL) { + if (fpath != NULL) free(fpath); + return NULL; + } + fpath = npath; + + memset(fpath, 0, sizeof(char)*len); + r = readlink(path, fpath, len); + if (r != -1 && fpath[len-1] == 0) break; + if (r == -1) { + free(fpath); + return NULL; + } else { + len = len * 2; + } + } + } + else { + fpath = strdup(path); + } + return fpath; +} + +static const char* pv_symlink_handle(struct cmd_context* cmd, const char* name, int create) +{ + struct physical_volume *pv; + char *pvuuid; + char *pvuuid_link; + + pvuuid_link = malloc(70); + if (pvuuid_link == NULL) return NULL; + + + if (!(pv = pv_read(cmd, name, NULL, NULL, 0, 0))) { + free(pvuuid_link); + return NULL; + } + + pvuuid = malloc(sizeof(char)*40); + if (pvuuid == NULL) { + free(pvuuid_link); + return NULL; + } + + id_write_format(&pv->id, pvuuid, 40); + + snprintf(pvuuid_link, 70, "/dev/disk/by-id/lvm2-pvuuid-%s", pvuuid); + + //we really don't care if it successed or not. + if (create) { + const char* tname = NULL; + int r; + tname = pv_follow_if_link(name); + if (tname != NULL) { + r = symlink(tname, pvuuid_link); + free(tname); + } + else { + symlink(name, pvuuid_link); + } + } else { + //pvuuid_link is saved for future unlink + //unlink(pvuuid_link); + } + + free(pvuuid); + return pvuuid_link; +} + + /* FIXME Locking. PVs in VG. */ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv, @@ -202,11 +286,23 @@ return 0; } backup(vg); - } else if (!(pv_write(cmd, pv, NULL, INT64_C(-1)))) { - unlock_vg(cmd, vg_name); - log_error("Failed to store physical volume \"%s\"", - pv_name); - return 0; + } else { + const char* oldsymlink; + oldsymlink = pv_symlink_handle(cmd, pv_name, 0); + + if (!(pv_write(cmd, pv, NULL, INT64_C(-1)))) { + unlock_vg(cmd, vg_name); + log_error("Failed to store physical volume \"%s\"", + pv_name); + if (oldsymlink) free(oldsymlink); + return 0; + } + pv_symlink_handle(cmd, pv_name, 1); + if (oldsymlink) { + unlink(oldsymlink); + free(oldsymlink); + } + } unlock_vg(cmd, vg_name); ++++++ man_page_sectors.diff ++++++ Index: man/pvdisplay.8.in =================================================================== --- man/pvdisplay.8.in.orig 2009-04-27 16:17:35.000000000 +0800 +++ man/pvdisplay.8.in 2009-04-27 16:17:50.000000000 +0800 @@ -25,7 +25,7 @@ * physical volume device name * volume group name -* physical volume size in kilobytes +* physical volume size in sectors * internal physical volume number (obsolete) * physical volume status * physical volume (not) allocatable ++++++ mkinitrd-boot.sh ++++++ #!/bin/bash #%stage: boot #%depends: start #%modules: $dm_modules dm-mod dm-snapshot #%programs: /sbin/dmsetup /sbin/blockdev # dm-crypt dm-zero dm-mirror #%if: -n "$root_dm" # ##### Device Mapper ## ## If the root device uses device mapper, this initializes and waits for the control file ## ## Command line parameters ## ----------------------- ## ## root_dm=1 use device mapper ## load_modules # because we run before udev we need to create the device node manually mkdir /dev/mapper mknod /dev/mapper/control c 10 63 ++++++ mkinitrd-setup.sh ++++++ #!/bin/bash # #%stage: devicemapper #%depends: dmroot # # no dmsetup -> no dm if [ -x /sbin/dmsetup ]; then dm_blockdev= # if any device before was on dm we have to activate it [ "$tmp_root_dm" ] && root_dm=1 blockdev="$(dm_resolvedeps_recursive $blockdev)" [ "$?" = 0 ] && root_dm=1 # include dm when using dm based block devs [ "$DM_BLOCK" ] && root_dm=1 # include modules if [ -n "$root_dm" ] ; then # Add all dm modules dm_modules= for table in $(dmsetup table | cut -f 4 -d ' ' | sort | uniq); do if [ "$table" ] && [ "$table" != "linear" ] && [ "$table" != "striped" ] ; then dm_modules="$dm_modules dm-$table" fi done fi # include dm block var from sysconfig mkdir -p etc/sysconfig grep DM_BLOCK /etc/sysconfig/kernel > etc/sysconfig/kernel save_var root_dm fi ++++++ no_buildroot_shared.diff ++++++ Index: tools/Makefile.in =================================================================== --- tools/Makefile.in.orig 2009-04-27 16:15:35.000000000 +0800 +++ tools/Makefile.in 2009-04-27 16:15:46.000000000 +0800 @@ -95,7 +95,7 @@ LVMLIBS += -ldevmapper -DEFS += -DLVM_SHARED_PATH=\"$(exec_prefix)/sbin/lvm\" +DEFS += -DLVM_SHARED_PATH=\"/sbin/lvm\" include $(top_srcdir)/make.tmpl ++++++ no-inc-audit.diff ++++++ Index: lib/device/dev-io.c =================================================================== --- lib/device/dev-io.c.orig 2009-04-27 16:15:36.000000000 +0800 +++ lib/device/dev-io.c 2009-04-27 16:15:42.000000000 +0800 @@ -31,6 +31,7 @@ # define u64 uint64_t /* Missing without __KERNEL__ */ # undef WNOHANG /* Avoid redefinition */ # undef WUNTRACED /* Avoid redefinition */ +# define _LINUX_AUDIT_H_ /* Avoid inclusion */ # include <linux/fs.h> /* For block ioctl definitions */ # define BLKSIZE_SHIFT SECTOR_SHIFT # ifndef BLKGETSIZE64 /* fs.h out-of-date */ Index: lib/filters/filter.c =================================================================== --- lib/filters/filter.c.orig 2009-04-27 16:15:39.000000000 +0800 +++ lib/filters/filter.c 2009-04-27 16:15:42.000000000 +0800 @@ -14,6 +14,7 @@ */ #include <sys/ioctl.h> +#define _LINUX_AUDIT_H_ #include <linux/fs.h> #undef MAJOR #undef MINOR ++++++ pipe_buff-definition.diff ++++++ --- daemons/clvmd/clvmd.c +++ daemons/clvmd/clvmd.c @@ -59,6 +59,8 @@ #define ISLOCAL_CSID(c) (memcmp(c, our_csid, max_csid_len) == 0) +#include <linux/limits.h> + /* Head of the fd list. Also contains the cluster_socket details */ static struct local_client local_client_head; ++++++ pvscan_2TB_limit.diff ++++++ Index: tools/pvscan.c =================================================================== --- tools/pvscan.c.orig 2008-11-04 06:14:30.000000000 +0800 +++ tools/pvscan.c 2009-04-27 16:15:52.000000000 +0800 @@ -166,7 +166,7 @@ size_new += pv_size(pv); size_total += pv_size(pv); } else - size_total += pv_pe_count(pv) * pv_pe_size(pv); + size_total += (uint64_t)pv_pe_count(pv) * pv_pe_size(pv); } /* find maximum pv name length */ ++++++ sigterm_in_main_thread.diff ++++++ Index: LVM2.2.02.39/daemons/clvmd/clvmd.c =================================================================== --- LVM2.2.02.39.orig/daemons/clvmd/clvmd.c 2009-03-24 19:29:14.000000000 +0800 +++ LVM2.2.02.39/daemons/clvmd/clvmd.c 2009-03-24 19:34:01.000000000 +0800 @@ -348,9 +348,11 @@ signal(SIGHUP, sighup_handler); signal(SIGPIPE, SIG_IGN); - /* Block SIGUSR2 in the main process */ + /* Block SIGUSR2/SIGINT/SIGTERM in process */ sigemptyset(&ss); sigaddset(&ss, SIGUSR2); + sigaddset(&ss, SIGINT); + sigaddset(&ss, SIGTERM); sigprocmask(SIG_BLOCK, &ss, NULL); /* Initialise the LVM thread variables */ @@ -633,6 +635,11 @@ { DEBUGLOG("Using timeout of %d seconds\n", cmd_timeout); + sigset_t ss; + sigemptyset(&ss); + sigaddset(&ss, SIGINT); + sigaddset(&ss, SIGTERM); + pthread_sigmask(SIG_UNBLOCK, &ss, NULL); /* Main loop */ while (!quit) { fd_set in; @@ -771,6 +778,8 @@ } closedown: + + pthread_sigmask(SIG_BLOCK, &ss, NULL); clops->cluster_closedown(); close(local_sock); } ++++++ support-drbd-filter.diff ++++++ This is still very primitive support of drbd in lvm2. Can we use some /sys information for this ? Index: LVM2.2.02.39/lib/cache/lvmcache.c =================================================================== --- LVM2.2.02.39.orig/lib/cache/lvmcache.c 2008-06-27 23:18:31.000000000 +0800 +++ LVM2.2.02.39/lib/cache/lvmcache.c 2009-03-31 12:08:29.000000000 +0800 @@ -1119,6 +1119,13 @@ pvid, dev_name(dev), dev_name(existing->dev)); return NULL; + } else if (MAJOR(existing->dev->dev) == drbd_major() && + MAJOR(dev->dev) != drbd_major()) { + log_very_verbose("Ignoring duplicate PV %s on " + "%s - using drbd %s", + pvid, dev_name(dev), + dev_name(existing->dev)); + return NULL; } else if (MAJOR(existing->dev->dev) != md_major() && MAJOR(dev->dev) == md_major()) log_very_verbose("Duplicate PV %s on %s - " @@ -1131,6 +1138,12 @@ "using dm %s", pvid, dev_name(existing->dev), dev_name(dev)); + else if (MAJOR(existing->dev->dev) != drbd_major() && + MAJOR(dev->dev) == drbd_major()) + log_very_verbose("Duplicate PV %s on %s - " + "using drbd %s", pvid, + dev_name(existing->dev), + dev_name(dev)); /* FIXME If both dm, check dependencies */ //else if (dm_is_dm_major(MAJOR(existing->dev->dev)) && //dm_is_dm_major(MAJOR(dev->dev))) Index: LVM2.2.02.39/lib/filters/filter.c =================================================================== --- LVM2.2.02.39.orig/lib/filters/filter.c 2009-03-31 11:48:52.000000000 +0800 +++ LVM2.2.02.39/lib/filters/filter.c 2009-03-31 11:57:38.000000000 +0800 @@ -46,12 +46,20 @@ static int _md_major = -1; static int _device_mapper_major = -1; +static int _drbd_major = -1; int md_major(void) { return _md_major; } +/* FIXME: Should we consider filter out non-primary + drbd resource ?? */ +int drbd_major(void) +{ + return _drbd_major; +} + /* * Devices are only checked for partition tables if their minor number * is a multiple of the number corresponding to their type below @@ -208,6 +216,9 @@ if (!strncmp("md", line + i, 2) && isspace(*(line + i + 2))) _md_major = line_maj; + if (!strncmp("drbd", line + i, 4) && isspace(*(line + i + 4))) + _drbd_major = line_maj; + /* Look for device-mapper device */ /* FIXME Cope with multiple majors */ if (!strncmp("device-mapper", line + i, 13) && isspace(*(line + i + 13))) ++++++ sysconfig.lvm ++++++ ## Path: System/File systems/LVM ## Description: LVM configuration ## Type: string ## Default: "" # # This variable allows to only activate the LVM volume groups listed at # bootup. If it is empty, all LVM volume groups are activated at bootup. # This variable needs setting only under very special circumstances. # For almost all standard LVM installations it can safely stay empty. # LVM_VGS_ACTIVATED_ON_BOOT="" ++++++ sys_mount_instead_linux_fs.diff ++++++ Index: lib/device/dev-io.c =================================================================== --- lib/device/dev-io.c.orig 2009-04-27 16:15:42.000000000 +0800 +++ lib/device/dev-io.c 2009-04-27 16:15:49.000000000 +0800 @@ -32,7 +32,7 @@ # undef WNOHANG /* Avoid redefinition */ # undef WUNTRACED /* Avoid redefinition */ # define _LINUX_AUDIT_H_ /* Avoid inclusion */ -# include <linux/fs.h> /* For block ioctl definitions */ +# include <sys/mount.h> /* For block ioctl definitions */ # define BLKSIZE_SHIFT SECTOR_SHIFT # ifndef BLKGETSIZE64 /* fs.h out-of-date */ # define BLKGETSIZE64 _IOR(0x12, 114, size_t) Index: lib/filters/filter.c =================================================================== --- lib/filters/filter.c.orig 2009-04-27 16:15:42.000000000 +0800 +++ lib/filters/filter.c 2009-04-27 16:15:49.000000000 +0800 @@ -15,7 +15,7 @@ #include <sys/ioctl.h> #define _LINUX_AUDIT_H_ -#include <linux/fs.h> +#include <sys/mount.h> #undef MAJOR #undef MINOR #undef MKDEV ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de