From 787bbac49ae3cfd448d581eaa3a07ef733e449db Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 18 Jul 2012 15:36:14 -0500 Subject: [PATCH 001/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 1855b4d..6f1d9f4 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.1.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -38,6 +38,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_restore %changelog +* Wed Jul 18 2012 Fedora Release Engineering - 0.1.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + * Thu Apr 19 2012 Milan Broz - 0.1.4-1 - Fix thin_check man page (add -q option). - Install utilities in /usr/sbin. From cf3545504ebfd29d8397613c89efd0305a46feec Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 13 Feb 2013 13:38:00 -0600 Subject: [PATCH 002/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 6f1d9f4..927cb7a 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.1.4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -38,6 +38,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_restore %changelog +* Wed Feb 13 2013 Fedora Release Engineering - 0.1.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + * Wed Jul 18 2012 Fedora Release Engineering - 0.1.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild From 10c502701a5e21f355e8ffeea1ce8ce230b2c4ca Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Fri, 12 Jul 2013 14:18:20 +0200 Subject: [PATCH 003/135] New upstream version v0.2.1 --- .gitignore | 1 + device-mapper-persistent-data.spec | 25 ++++++++++++++++--------- sources | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 4e74606..68d35b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /thin-provisioning-tools-v0.1.4.tar.bz2 +/thin-provisioning-tools-v0.2.1.tar.bz2 diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 927cb7a..a9f4064 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -1,26 +1,28 @@ # -# Copyright (C) 2011-2012 Red Hat, Inc +# Copyright (C) 2011-2013 Red Hat, Inc # Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data -Version: 0.1.4 -Release: 3%{?dist} +Version: 0.2.1 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools -Source0: https://github.com/downloads/jthornber/thin-provisioning-tools/thin-provisioning-tools-v%{version}.tar.bz2 -BuildRequires: expat-devel, libstdc++-devel, boost-devel +Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 +# Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz +BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat %description -thin-provisioning-tools contains dump,restore and repair tools to +thin-provisioning-tools contains check,dump,restore,repair and rmap tools to manage device-mapper thin provisioning target metadata devices. %prep -%setup -q -n thin-provisioning-tools-v%{version} +%setup -q -n thin-provisioning-tools-%{version} %build -%configure --enable-debug --enable-testing +autoconf +%configure make %{?_smp_mflags} %install @@ -29,15 +31,20 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %clean %files -%doc COPYING README +%doc COPYING README.md %{_mandir}/man8/thin_dump.8.gz %{_mandir}/man8/thin_check.8.gz %{_mandir}/man8/thin_restore.8.gz %{_sbindir}/thin_dump %{_sbindir}/thin_check +%{_sbindir}/thin_repair %{_sbindir}/thin_restore +%{_sbindir}/thin_rmap %changelog +* Fri Jul 12 2013 Heinz Mauelshagen - 0.2.1-1 +- New upstream version. + * Wed Feb 13 2013 Fedora Release Engineering - 0.1.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild diff --git a/sources b/sources index f94f3db..5a86374 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -df5b067d5e4aa82a0cdf9f16783d16b8 thin-provisioning-tools-v0.1.4.tar.bz2 +122bd4414f9afdf893be2fc3d3355bb4 thin-provisioning-tools-v0.2.1.tar.bz2 From 9d194bf41b9777a3a52809d33b97fe9e2854edc2 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Tue, 16 Jul 2013 13:23:17 +0200 Subject: [PATCH 004/135] Let rpmbuild strip binaries, don't override optflags, build more verbose. --- ...mapper-persistent-data-0.2.1-nostrip.patch | 20 +++++++++++++++++++ device-mapper-persistent-data.spec | 14 ++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 device-mapper-persistent-data-0.2.1-nostrip.patch diff --git a/device-mapper-persistent-data-0.2.1-nostrip.patch b/device-mapper-persistent-data-0.2.1-nostrip.patch new file mode 100644 index 0000000..c75a4fa --- /dev/null +++ b/device-mapper-persistent-data-0.2.1-nostrip.patch @@ -0,0 +1,20 @@ +diff -up thin-provisioning-tools-0.2.1/Makefile.in~ thin-provisioning-tools-0.2.1/Makefile.in +--- thin-provisioning-tools-0.2.1/Makefile.in~ 2013-07-10 18:43:45.000000000 +0300 ++++ thin-provisioning-tools-0.2.1/Makefile.in 2013-07-15 22:32:36.294852451 +0300 +@@ -235,11 +235,11 @@ distclean: clean + + install: $(PROGRAMS) + $(INSTALL_DIR) $(BINDIR) +- $(INSTALL_PROGRAM) -s thin_check $(BINDIR) +- $(INSTALL_PROGRAM) -s thin_dump $(BINDIR) +- $(INSTALL_PROGRAM) -s thin_repair $(BINDIR) +- $(INSTALL_PROGRAM) -s thin_restore $(BINDIR) +- $(INSTALL_PROGRAM) -s thin_rmap $(BINDIR) ++ $(INSTALL_PROGRAM) thin_check $(BINDIR) ++ $(INSTALL_PROGRAM) thin_dump $(BINDIR) ++ $(INSTALL_PROGRAM) thin_repair $(BINDIR) ++ $(INSTALL_PROGRAM) thin_restore $(BINDIR) ++ $(INSTALL_PROGRAM) thin_rmap $(BINDIR) + $(INSTALL_DIR) $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8 diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index a9f4064..080af40 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,12 +4,13 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.2.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz +Patch0: %{name}-0.2.1-nostrip.patch BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat @@ -19,11 +20,12 @@ manage device-mapper thin provisioning target metadata devices. %prep %setup -q -n thin-provisioning-tools-%{version} +%patch0 -p1 %build autoconf -%configure -make %{?_smp_mflags} +%configure --with-optimisation= +make %{?_smp_mflags} V= %install make DESTDIR=%{buildroot} MANDIR=%{_mandir} install @@ -42,6 +44,12 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Tue Jul 16 2013 Heinz Mauelshagen - 0.2.1-2 +- Build with nostrip fix from Ville Skyttä + +* Mon Jul 15 2013 Ville Skyttä - 0.2.1-2 +- Let rpmbuild strip binaries, don't override optflags, build more verbose. + * Fri Jul 12 2013 Heinz Mauelshagen - 0.2.1-1 - New upstream version. From afcf52a35d83edab84d1670d1e72d0062b3fa440 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Thu, 18 Jul 2013 15:37:32 +0200 Subject: [PATCH 005/135] Supprt metadata snapshots in thin_dump tool. New thin_medata_size calculator. New man pages and man page fixes. --- ...ges-new-thin_metadata_size-and-fixes.patch | 281 ++++++++++ ...-data-0.2.1-new-thin_metadata_size.c.patch | 494 ++++++++++++++++++ ...hin_dump-support-metadata-snap-block.patch | 114 ++++ device-mapper-persistent-data.spec | 26 +- 4 files changed, 910 insertions(+), 5 deletions(-) create mode 100644 device-mapper-persistent-data-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch create mode 100644 device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch create mode 100644 device-mapper-persistent-data-0.2.1-thin_dump-support-metadata-snap-block.patch diff --git a/device-mapper-persistent-data-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch b/device-mapper-persistent-data-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch new file mode 100644 index 0000000..85af857 --- /dev/null +++ b/device-mapper-persistent-data-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch @@ -0,0 +1,281 @@ +diff --git a/Makefile.in b/Makefile.in +index 1e7bd54..b44cbd7 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -264,7 +264,10 @@ install: $(PROGRAMS) + $(INSTALL_DIR) $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8 ++ $(INSTALL_DATA) man8/thin_repair.8 $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_restore.8 $(MANPATH)/man8 ++ $(INSTALL_DATA) man8/thin_rmap.8 $(MANPATH)/man8 ++ $(INSTALL_DATA) man8/thin_metadata_size.8 $(MANPATH)/man8 + + .PHONY: install + +diff --git a/man8/thin_check.8 b/man8/thin_check.8 +index f9606e0..1489078 100644 +--- a/man8/thin_check.8 ++++ b/man8/thin_check.8 +@@ -55,7 +55,10 @@ returns an exit code of 0 for success or 1 for error. + + .SH SEE ALSO + .B thin_dump(8) ++.B thin_repair(8) + .B thin_restore(8) ++.B thin_rmap(8) ++.B thin_metadata_size(8) + + .SH AUTHOR + Joe Thornber +diff --git a/man8/thin_dump.8 b/man8/thin_dump.8 +index 697df83..e60a6e5 100644 +--- a/man8/thin_dump.8 ++++ b/man8/thin_dump.8 +@@ -9,7 +9,8 @@ thin_dump \- dump thin provisioning metadata from device or file to standard out + + .SH DESCRIPTION + .B thin_dump +-dumps thin provisioning metadata created by the device-mapper ++dumps binary thin provisioning metadata (optionally from alternate block; ++see option \-\-metadata-snap) created by the device-mapper + thin provisioning target on a device or file to standard output for + analysis or postprocessing in either XML or human readable format. + XML formated metadata can be fed into thin_restore (see +@@ -22,6 +23,10 @@ Print output in XML or human readable format. + + .IP "\fB\-r, \-\-repair\fP". + ++.IP "\fB\-m, \-\-metadata_snap\fP block#". ++Dump metadata snapshot created by device-mapper thin provisioning target at block# ++ ++ + .IP "\fB\-h, \-\-help\fP". + Print help and exit. + +@@ -45,8 +50,10 @@ returns an exit code of 0 for success or 1 for error. + + .SH SEE ALSO + .B thin_check(8) ++.B thin_repair(8) + .B thin_restore(8) +- ++.B thin_rmap(8) ++.B thin_metadata_size(8) + .SH AUTHOR + Joe Thornber + .br +diff --git a/man8/thin_metadata_size.8 b/man8/thin_metadata_size.8 +new file mode 100644 +index 0000000..33b36b3 +--- /dev/null ++++ b/man8/thin_metadata_size.8 +@@ -0,0 +1,77 @@ ++.TH THIN_METADATA_SIZE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++thin_metadata_size \- thin provisioning metadata file/device size calculator. ++ ++.SH SYNOPSIS ++.B thin_metadata_size ++.RB [ options ] ++ ++.SH DESCRIPTION ++.B thin_metadata_size ++calculates the size of the thin provisioning metadata based on the block size ++of the thin provisioned devices, the size of the thin provisioning pool and ++the maximum number of all thin prisioned devices and snapshots. Size/number ++option arguments can be followed by unit specifiers in short one character ++and long form (eg. -b1m or -b1megabytes). ++ ++.IP "\fB\-b, \-\-block-size\fP \fIBLOCKSIZE[bskKmMgGtTpPeEzZyY]\fP" ++Block size of thin provisioned devices in units of bytes,sectors,kilobytes,kibibytes,... respectively. ++Default is in sectors without a block size unit specifier. ++ ++.IP "\fB\-s, \-\-pool-size\fP \fIPOOLSIZE[bskKmMgGtTpPeEzZyY]\fP" ++Thin provisioning pool size in units of bytes,sectors,kilobytes,kibibytes,... respectively. ++Default is in sectors without a pool size unit specifier. ++ ++.IP "\fB\-m, \-\-max-thins\fP \fI#[bskKmMgGtTpPeEzZyY]\fP" ++Maximum sum of all thin provisioned devices and snapshots. ++Unit identifier supported to allow for convenient entry of large quantities, eg. 1000000 = 1M. ++Default is absolut quantity without a number unit specifier. ++ ++.IP "\fB\-u, \-\-unit\fP \fI{bskKmMgGtTpPeEzZyY}\fP" ++Output unit specifier in units of bytes,sectors,kilobytes,kibibytes,... respectively. ++Default is in sectors without an output unit specifier. ++ ++.IP "\fB\-n, \-\-numeric-only [short|long]\fP" ++Limit output to just the size number with the optional unit specifier character/string. ++ ++.IP "\fB\-h, \-\-help\fP" ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP" ++Output version information and exit. ++ ++.SH EXAMPLES ++Calculates the thin privisioning metadata device size for block size 64 kilobytes, ++pool size 1 terabytes and maximum number of thin provisioned devices and snapshots of 1000 ++in units of sectors with long output: ++.sp ++.B thin_metadata_size -b64k -s1t -m1000 ++ ++Or (using the long options instead) for block size 1 gigabyte, pool size 1 petabytes and maximum number of thin provisioned devices ++and snapshots of 1 million with numeric only output in units of gigabytes: ++.sp ++.B thin_metadata_size --block-size=1g --pool-size=1p --max-thins=1M --unit=g --numeric-only ++ ++Same as before (1g,1p,1M,numeric-only) but with unit specifier character appended: ++.sp ++.B thin_metadata_size --block-size=1giga --pool-size=1petabytes --max-thins=1mebi --unit=g --numeric-only=short ++ ++Or with unit specifier string appended: ++.sp ++.B thin_metadata_size --block-size=1giga --pool-size=1petabytes --max-thins=1mebi --unit=g -nlong ++ ++.SH DIAGNOSTICS ++.B thin_metadata_size ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B thin_dump(8) ++.B thin_check(8) ++.B thin_repair(8) ++.B thin_restore(8) ++.B thin_rmap(8) ++ ++.SH AUTHOR ++Joe Thornber ++.br ++Heinz Mauelshagen +diff --git a/man8/thin_repair.8 b/man8/thin_repair.8 +new file mode 100644 +index 0000000..69cddea +--- /dev/null ++++ b/man8/thin_repair.8 +@@ -0,0 +1,54 @@ ++.TH THIN_REPAIR 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++thin_repair \- repair thin provisioning binary metadata from device/file to device/file ++ ++.SH SYNOPSIS ++.B thin_repair ++.RB [ options ] ++.RB -i ++.I {device|file} ++.RB -o ++.I {device|file} ++ ++.SH DESCRIPTION ++.B thin_repair ++repairs binary thin provisioning metadata created by the ++respective device-mapper target processing to another device or file. ++If repaired to a metadata device, the metadata can be processed ++by the device-mapper target. ++ ++.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" ++Input file or device with binary metadata. ++ ++.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" ++Output file or device for repaired binary metadata. ++ ++.IP "\fB\-h, \-\-help\fP" ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP" ++Output version information and exit. ++ ++.SH EXAMPLE ++Repairs the binary thin provisioning metadata on file ++.B metadata ++to logical volume /dev/vg/metadata for further processing by the ++respective device-mapper target: ++.sp ++.B thin_repair -i metadata -o /dev/vg/metadata ++ ++.SH DIAGNOSTICS ++.B thin_repair ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B thin_dump(8) ++.B thin_check(8) ++.B thin_restore(8) ++.B thin_rmap(8) ++.B thin_metadata_size(8) ++ ++.SH AUTHOR ++Joe Thornber ++.br ++Heinz Mauelshagen +diff --git a/man8/thin_restore.8 b/man8/thin_restore.8 +index b4a07aa..8ab2976 100644 +--- a/man8/thin_restore.8 ++++ b/man8/thin_restore.8 +@@ -40,12 +40,15 @@ respective device-mapper target: + .B thin_restore -i metadata -o /dev/vg/metadata + + .SH DIAGNOSTICS +-.B thin_dump ++.B thin_restore + returns an exit code of 0 for success or 1 for error. + + .SH SEE ALSO + .B thin_dump(8) + .B thin_check(8) ++.B thin_repair(8) ++.B thin_rmap(8) ++.B thin_metadata_size(8) + + .SH AUTHOR + Joe Thornber +diff --git a/man8/thin_rmap.8 b/man8/thin_rmap.8 +new file mode 100644 +index 0000000..d68defb +--- /dev/null ++++ b/man8/thin_rmap.8 +@@ -0,0 +1,44 @@ ++.TH THIN_DUMP 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++thin_rmap \- output reverse map of a thin provisioned region of blocks ++ ++.SH SYNOPSIS ++.B thin_rmap ++.RB [options] ++.I {metadata device|file} ++ ++.SH DESCRIPTION ++.B thin_rmap ++outputs the reverse mapping for a region of thin provisioned pool blocks ++to the respective thin provisioned devices. ++ ++.IP "\fB\\-\-region\fP \fI\fP". ++output reverse map ++ ++.IP "\fB\-h, \-\-help\fP". ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP". ++Output version information and exit. ++ ++.SH EXAMPLES ++output reverse map for pool blocks 5..45 (denotes blocks 5 to 44 inclusive, but not block 45) ++ ++.sp ++.B thin_rmap -r 5..45 /dev/vg/pool ++ ++.SH DIAGNOSTICS ++.B thin_rmap ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B thin_check(8) ++.B thin_dump(8) ++.B thin_repair(8) ++.B thin_restore(8) ++.B thin_metadata_size(8) ++ ++.SH AUTHOR ++Joe Thornber ++.br ++Heinz Mauelshagen diff --git a/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch b/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch new file mode 100644 index 0000000..9610ca5 --- /dev/null +++ b/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch @@ -0,0 +1,494 @@ +diff --git a/Makefile.in b/Makefile.in +index a82ff67..1e7bd54 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -24,7 +24,8 @@ PROGRAMS=\ + thin_dump \ + thin_restore \ + thin_repair \ +- thin_rmap ++ thin_rmap \ ++ thin_metadata_size + + all: $(PROGRAMS) + +@@ -64,7 +65,7 @@ SOURCE=\ + + PDATA_OBJECTS=$(subst .cc,.o,$(SOURCE)) + +-PROGRAM_SOURCE=\ ++CXX_PROGRAM_SOURCE=\ + cache/check.cc \ + \ + thin-provisioning/thin_check.cc \ +@@ -73,10 +74,15 @@ PROGRAM_SOURCE=\ + thin-provisioning/thin_repair.cc \ + thin-provisioning/thin_rmap.cc + ++C_PROGRAM_SOURCE=\ ++ thin-provisioning/thin_metadata_size.c ++ ++CC:=@CC@ + CXX:=@CXX@ + OBJECTS:=$(subst .cc,.o,$(SOURCE)) + TOP_DIR:=@top_srcdir@ + TOP_BUILDDIR:=@top_builddir@ ++CFLAGS+=-g -Wall -O3 + CXXFLAGS+=-std=c++11 -g -Wall -fno-strict-aliasing + CXXFLAGS+=@CXXOPTIMISE_FLAG@ + CXXFLAGS+=@CXXDEBUG_FLAG@ +@@ -104,6 +110,14 @@ endif + + .SUFFIXES: .d + ++%.o: %.c ++ @echo " [CC] $<" ++ $(V) $(CC) -c $(INCLUDES) $(CFLAGS) -o $@ $< ++ @echo " [DEP] $<" ++ $(V) $(CC) -MM -MT $(subst .c,.o,$<) $(INCLUDES) $(CFLAGS) $< > $*.$$$$; \ ++ sed 's,\([^ :]*\)\.o[ :]*,\1.o \1.gmo $* : Makefile ,g' < $*.$$$$ > $*.d; \ ++ $(RM) $*.$$$$ ++ + %.o: %.cc + @echo " [CXX] $<" + $(V) $(CXX) -c $(INCLUDES) $(CXXFLAGS) -o $@ $< +@@ -195,6 +209,10 @@ thin_rmap: $(THIN_RMAP_OBJECTS) thin-provisioning/thin_rmap.o + @echo " [LD] $@" + $(V) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) + ++thin_metadata_size: thin-provisioning/thin_metadata_size.o ++ @echo " [LD] $@" ++ $(V) $(CC) $(CFLAGS) -o $@ $+ -lm ++ + #---------------------------------------------------------------- + # Cache tools + +@@ -221,29 +239,33 @@ cache_check: $(CACHE_CHECK_OBJECTS) cache/check.o + DEPEND_FILES=\ + $(subst .cc,.d,$(SOURCE)) \ + $(subst .cc,.d,$(TEST_SOURCE)) \ +- $(subst .cc,.d,$(PROGRAM_SOURCE)) ++ $(subst .cc,.d,$(CXX_PROGRAM_SOURCE)) \ ++ $(subst .c,.d,$(C_PROGRAM_SOURCE)) + + .PHONY: clean distclean + + clean: + find . -name \*.o -delete + find . -name \*.gmo -delete +- $(RM) $(DEPEND_FILES) $(TEST_PROGRAMS) $(PROGRAMS) $(GMOCK_OBJECTS) lib/*.a ++ find . -name \*.d -delete ++ $(RM) $(TEST_PROGRAMS) $(PROGRAMS) $(GMOCK_OBJECTS) lib/*.a + + distclean: clean + $(RM) config.cache config.log config.status configure.h version.h Makefile unit-tests/Makefile + + install: $(PROGRAMS) + $(INSTALL_DIR) $(BINDIR) +- $(INSTALL_PROGRAM) thin_check $(BINDIR) +- $(INSTALL_PROGRAM) thin_dump $(BINDIR) +- $(INSTALL_PROGRAM) thin_repair $(BINDIR) +- $(INSTALL_PROGRAM) thin_restore $(BINDIR) +- $(INSTALL_PROGRAM) thin_rmap $(BINDIR) ++ $(INSTALL_PROGRAM) -s thin_check $(BINDIR) ++ $(INSTALL_PROGRAM) -s thin_dump $(BINDIR) ++ $(INSTALL_PROGRAM) -s thin_repair $(BINDIR) ++ $(INSTALL_PROGRAM) -s thin_restore $(BINDIR) ++ $(INSTALL_PROGRAM) -s thin_rmap $(BINDIR) ++ $(INSTALL_PROGRAM) -s thin_metadata_size $(BINDIR) + $(INSTALL_DIR) $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_restore.8 $(MANPATH)/man8 ++ + .PHONY: install + + ifeq ("@TESTING@", "yes") +diff --git a/configure.in b/configure.in +index 78d88c1..8f25002 100644 +--- a/configure.in ++++ b/configure.in +@@ -30,6 +30,7 @@ dnl -- Setup the directory where autoconf has auxilary files + AC_CONFIG_AUX_DIR(autoconf) + AC_CANONICAL_TARGET([]) + AC_PROG_CXX([g++]) ++AC_PROG_CC([gcc]) + AC_LANG(C++) + + ################################################################ +diff --git a/thin-provisioning/thin_metadata_size.c b/thin-provisioning/thin_metadata_size.c +new file mode 100755 +index 0000000..1f52d51 +--- /dev/null ++++ b/thin-provisioning/thin_metadata_size.c +@@ -0,0 +1,370 @@ ++/* ++ * Copyright (C) 2013 Red Hat, GmbH ++ * ++ * Calculates device-mapper thin privisioning ++ * metadata device size based on pool, block size and ++ * maximum expected thin provisioned devices and snapshots. ++ * ++ * This file is part of the thin-provisioning-tools source. ++ * ++ * thin-provisioning-tools is free software: you can redistribute it ++ * and/or modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation, either version 3 of ++ * the License, or (at your option) any later version. ++ * ++ * thin-provisioning-tools is distributed in the hope that it will be ++ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty ++ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License along ++ * with thin-provisioning-tools. If not, see ++ * . ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "version.h" ++ ++#include ++ ++/*----------------------------------------------------------------*/ ++ ++enum numeric_options { BLOCKSIZE, POOLSIZE, MAXTHINS, NUMERIC, OPT_END}; ++enum return_units { RETURN_BYTES, RETURN_SECTORS }; ++enum numeric_type { NO_NUMBER, NUMBER, NUMBER_SHORT, NUMBER_LONG }; ++typedef unsigned bool; ++enum bool_value { false = 0, true = 1}; ++struct global { ++ char *prg; /* program name */ ++ ++ /* Unit representations in characters, strings and numeric factors. */ ++ struct { ++ char *chars; ++ char **strings; ++ unsigned long long *factors; ++ } unit; ++ ++ /* Command line option properties. */ ++ struct options { ++ unsigned unit_idx; ++ char *s[OPT_END]; ++ unsigned long long n[OPT_END]; ++ } options; ++}; ++ ++static void exit_prg(struct global *g, int ret) ++{ ++ if (g) { ++ unsigned u = OPT_END; ++ ++ while (u--) { ++ if (g->options.s[u]) ++ free (g->options.s[u]); ++ } ++ ++ free(g); ++ } ++ ++ exit(ret); ++} ++ ++static void abort_prg(struct global *g, const char *msg) ++{ ++ fprintf(stderr, "%s - %s\n", g ? g->prg : "fatal", msg); ++ exit_prg(g, 1); ++} ++ ++static int unit_index(struct global *g, char *unit_string) ++{ ++ unsigned len; ++ ++ if (!unit_string) ++ return unit_index(g, "sectors"); ++ ++ len = strlen(unit_string); ++ if (len == 1) { ++ char *o = strchr(g->unit.chars, *unit_string); ++ ++ if (o) ++ return o - g->unit.chars; ++ ++ } else { ++ char **s; ++ ++ for (s = g->unit.strings; *s; s++) ++ if (!strncmp(*s, unit_string, len)) ++ return s - g->unit.strings; ++ } ++ ++ return -1; ++} ++ ++#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) ++static struct global *init_prg(char *prg_path) ++{ ++ unsigned u; ++ static char *unit_chars = "bskKmMgGtTpPeEzZyY"; ++ static char *unit_strings[] = { "bytes", "sectors", ++ "kilobytes", "kibibytes", "megabytes", "mebibytes", ++ "gigabytes", "gibibytes", "terabytes", "tebibytes", ++ "petabytes", "pebibytes", "exabytes", "ebibytes", ++ "zetabytes", "zebibytes", "yottabytes", "yobibytes", NULL }; ++ static unsigned long long unit_factors[ARRAY_SIZE(unit_strings) - 1] = { 1, 512, 1024, 1000 }; ++ struct global *r = malloc(sizeof(*r)); ++ ++ if (!r) ++ abort_prg(r, "failed to allocate global context!"); ++ ++ memset(r, 0, sizeof(*r)); ++ ++ for (u = 4; unit_strings[u]; u += 2) { ++ unit_factors[u] = unit_factors[u-2] * unit_factors[2]; ++ unit_factors[u+1] = unit_factors[u-1] * unit_factors[3]; ++ } ++ ++ r->prg = basename(prg_path); ++ r->unit.chars = unit_chars; ++ r->unit.strings = unit_strings; ++ r->unit.factors = unit_factors; ++ r->options.unit_idx = unit_index(r, NULL); ++ ++ return r; ++} ++ ++static unsigned long long bytes_per_sector(struct global *g) ++{ ++ return g->unit.factors[unit_index(g, "sectors")]; ++} ++ ++static void check_opts(struct global *g) ++{ ++ struct options *o = &g->options; ++ ++ if (!o->n[BLOCKSIZE]) ++ abort_prg(g, "block size required!"); ++ else if (!o->n[POOLSIZE]) ++ abort_prg(g, "pool size required!"); ++ else if (!o->n[MAXTHINS]) ++ abort_prg(g, "max thins required!"); ++ else if (o->n[BLOCKSIZE] & (o->n[BLOCKSIZE] - 1)) ++ abort_prg(g, "block size must be 2^^N"); ++ else if (o->n[POOLSIZE] <= o->n[BLOCKSIZE]) ++ abort_prg(g, "pool size must be larger than block size"); ++} ++ ++static unsigned long long to_bytes(struct global *g, char *sz, enum return_units unit, int *index) ++{ ++ int idx; ++ unsigned long long r; ++ char *us = sz; ++ ++ /* Get pointer to unit identifier. */ ++ us += strspn(sz, "0123456789"); ++ if (*us) { ++ idx = unit_index(g, us); ++ if (idx < 0) ++ abort_prg(g, "Invalid unit specifier!"); ++ ++ *us = 0; ++ *index = idx; ++ } else { ++ idx = unit_index(g, NULL); ++ us = NULL; ++ *index = -1; ++ } ++ ++ r = atoll(sz) * g->unit.factors[idx]; ++ return (!us || unit == RETURN_SECTORS) ? r / bytes_per_sector(g) : r; ++} ++ ++static void printf_aligned(struct global *g, char *a, char *b, char *c, bool units, bool mandatory) ++{ ++ char buf[80]; ++ ++ strcpy(buf, b); ++ if (units) ++ strcat(buf, mandatory ? "{" :"["), strcat(buf, g->unit.chars), strcat(buf, mandatory ? "}" : "]"); ++ ++ printf("\t%-4s%-44s%s\n", a, buf, c); ++} ++ ++static void help(struct global *g) ++{ ++ printf ("Thin Provisioning Metadata Device Size Calculator.\nUsage: %s [options]\n", g->prg); ++ printf_aligned(g, "-b", "--block-size BLOCKSIZE", "Block size of thin provisioned devices.", true, false); ++ printf_aligned(g, "-s", "--pool-size SIZE", "Size of pool device.", true, false); ++ printf_aligned(g, "-m", "--max-thins #MAXTHINS", "Maximum sum of all thin devices and snapshots.", true, false); ++ printf_aligned(g, "-u", "--unit ", "Output unit specifier.", true, true); ++ printf_aligned(g, "-n", "--numeric-only [short|long]", "Output numeric value only (optionally with short/long unit identifier).", false, false); ++ printf_aligned(g, "-h", "--help", "This help.", false, false); ++ printf_aligned(g, "-V", "--version", "Print thin provisioning tools version.", false, false); ++ exit_prg(g, 0); ++} ++ ++static void version(struct global *g) ++{ ++ printf("%s\n", THIN_PROVISIONING_TOOLS_VERSION); ++ exit_prg(g, 1); ++} ++ ++static void check_unit(struct global *g, char *arg) ++{ ++ int idx = unit_index(g, arg); ++ ++ if (idx < 0) ++ abort_prg(g, "output unit specifier invalid!"); ++ ++ g->options.unit_idx = idx; ++} ++ ++static void check_numeric_option(struct global *g, char *arg) ++{ ++ if (g->options.n[NUMERIC] != NO_NUMBER) ++ abort_prg(g, "-n already given!"); ++ ++ g->options.n[NUMERIC] = NUMBER; ++ ++ if (arg) { ++ bool unit_long = !strncmp("long", arg, strlen(arg)); ++ ++ if (!*arg || (strncmp("short", arg, strlen(arg)) && !unit_long)) ++ abort_prg(g, "-n invalid option argument"); ++ ++ g->options.n[NUMERIC] = unit_long ? NUMBER_LONG : NUMBER_SHORT; ++ } ++} ++ ++static void check_size(struct global *g, enum numeric_options o, char *arg) ++{ ++ int idx; ++ bool valid_index = true; ++ ++ if (g->options.n[o]) ++ abort_prg(g, "option already given!"); ++ ++ g->options.n[o] = to_bytes(g, arg, o == MAXTHINS ? RETURN_BYTES : RETURN_SECTORS, &idx); ++ if (idx < 0) { ++ valid_index = false; ++ idx = g->options.unit_idx; ++ } ++ ++ g->options.s[o] = malloc(strlen(arg) + strlen(g->unit.strings[idx]) + 1); ++ if (!g->options.s[o]) ++ abort_prg(g, "failed to allocate string!"); ++ ++ strcpy(g->options.s[o], arg); ++ if (o != MAXTHINS || valid_index) ++ strcat(g->options.s[o], g->unit.strings[idx]); ++ ++} ++ ++static void parse_command_line(struct global *g, int argc, char **argv) ++{ ++ int c; ++ static struct option long_options[] = { ++ {"block-size", required_argument, NULL, 'b' }, ++ {"pool-size", required_argument, NULL, 's' }, ++ {"max-thins", required_argument, NULL, 'm' }, ++ {"unit", required_argument, NULL, 'u' }, ++ {"numeric-only",optional_argument, NULL, 'n' }, ++ {"help", no_argument, NULL, 'h' }, ++ {"version", no_argument, NULL, 'V' }, ++ {NULL, 0, NULL, 0 } ++ }; ++ ++ while ((c = getopt_long(argc, argv, "b:s:m:u:n::hV", long_options, NULL)) != -1) { ++ switch (c) { ++ case 'b': ++ check_size(g, BLOCKSIZE, optarg); ++ break; ++ case 's': ++ check_size(g, POOLSIZE, optarg); ++ break; ++ case 'm': ++ check_size(g, MAXTHINS, optarg); ++ break; ++ case 'u': ++ check_unit(g, optarg); ++ break; ++ case 'n': ++ check_numeric_option(g, optarg); ++ break; ++ case 'h': ++ help(g); /* exits */ ++ case 'V': ++ version(g); /* exits */ ++ default: ++ exit_prg(g, 1); ++ } ++ } ++ ++ check_opts(g); ++} ++ ++static const unsigned mappings_per_block(void) ++{ ++ const struct { ++ const unsigned node; ++ const unsigned node_header; ++ const unsigned entry; ++ } btree_size = { 4096, 64, 16 }; ++ ++ return (btree_size.node - btree_size.node_header) / btree_size.entry; ++} ++ ++static void print_precision(struct global *g, double r, unsigned idx) ++{ ++ bool full = g->options.n[NUMERIC] == NO_NUMBER; ++ double rtrunc = truncl(r); ++ ++ if (full) ++ printf("%s - ", g->prg); ++ ++ if (r == rtrunc) ++ printf("%llu", (unsigned long long) r); ++ else ++ printf(r - rtrunc < 1E-2 ? "%0.2e" : "%0.2f", r); ++ ++ if (full) ++ printf(" %s", g->unit.strings[idx]); ++ else if (g->options.n[NUMERIC] > NUMBER) { ++ if (g->options.n[NUMERIC] == NUMBER_SHORT) ++ printf("%c", g->unit.chars[idx]); ++ else ++ printf("%s", g->unit.strings[idx]); ++ } ++ ++ if (full) ++ printf(" estimated metadata area size for \"--block-size=%s --pool-size=%s --max-thins=%s\"", ++ g->options.s[BLOCKSIZE], g->options.s[POOLSIZE], g->options.s[MAXTHINS]); ++ ++ putchar('\n'); ++} ++ ++static void print_estimated_result(struct global *g) ++{ ++ double r; ++ ++ /* double-fold # of nodes, because they aren't fully populated in average */ ++ r = (1.0 + (2 * g->options.n[POOLSIZE] / g->options.n[BLOCKSIZE] / mappings_per_block() + g->options.n[MAXTHINS])); /* in 4k blocks */ ++ r *= 8 * bytes_per_sector(g); /* in bytes! */ ++ r /= g->unit.factors[g->options.unit_idx]; /* in requested unit */ ++ ++ print_precision(g, r, g->options.unit_idx); ++} ++ ++int main(int argc, char **argv) ++{ ++ struct global *g = init_prg(*argv); ++ ++ parse_command_line(g, argc, argv); ++ print_estimated_result(g); ++ exit_prg(g, 0); ++ return 0; /* Doesn't get here... */ ++} diff --git a/device-mapper-persistent-data-0.2.1-thin_dump-support-metadata-snap-block.patch b/device-mapper-persistent-data-0.2.1-thin_dump-support-metadata-snap-block.patch new file mode 100644 index 0000000..b2e9195 --- /dev/null +++ b/device-mapper-persistent-data-0.2.1-thin_dump-support-metadata-snap-block.patch @@ -0,0 +1,114 @@ +diff --git a/thin-provisioning/metadata.cc b/thin-provisioning/metadata.cc +index c841614..771325a 100644 +--- a/thin-provisioning/metadata.cc ++++ b/thin-provisioning/metadata.cc +@@ -57,15 +57,6 @@ namespace { + return tm; + } + +- superblock +- read_superblock(block_manager<>::ptr bm, block_address location = SUPERBLOCK_LOCATION) { +- superblock sb; +- block_manager<>::read_ref r = bm->read_lock(location, superblock_validator()); +- superblock_disk const *sbd = reinterpret_cast(&r.data()); +- superblock_traits::unpack(*sbd, sb); +- return sb; +- } +- + void + copy_space_maps(space_map::ptr lhs, space_map::ptr rhs) { + for (block_address b = 0; b < rhs->get_nr_blocks(); b++) { +@@ -149,10 +140,10 @@ metadata::metadata(std::string const &dev_path, open_type ot, + } + } + +-metadata::metadata(std::string const &dev_path) ++metadata::metadata(std::string const &dev_path, block_address metadata_snap) + { + tm_ = open_tm(open_bm(dev_path, false)); +- sb_ = read_superblock(tm_->get_bm()); ++ sb_ = read_superblock(tm_->get_bm(), metadata_snap); + + // We don't open the metadata sm for a held root + //metadata_sm_ = open_metadata_sm(tm_, &sb_.metadata_space_map_root_); +diff --git a/thin-provisioning/metadata.h b/thin-provisioning/metadata.h +index 250c216..9749acb 100644 +--- a/thin-provisioning/metadata.h ++++ b/thin-provisioning/metadata.h +@@ -62,10 +62,11 @@ namespace thin_provisioning { + // Deprecated: it would be better if we passed in an already + // constructed block_manager. + metadata(std::string const &dev_path, open_type ot, +- sector_t data_block_size = 128, ++ sector_t data_block_size = 128, // Only used if CREATE + block_address nr_data_blocks = 0); // Only used if CREATE + +- metadata(std::string const &dev_path); ++ metadata(std::string const &dev_path, ++ block_address metadata_snap = 0); + + // ... use these instead ... + metadata(block_manager<>::ptr bm, open_type ot, +diff --git a/thin-provisioning/superblock.cc b/thin-provisioning/superblock.cc +index c23fbc1..bf9544b 100644 +--- a/thin-provisioning/superblock.cc ++++ b/thin-provisioning/superblock.cc +@@ -126,17 +126,22 @@ namespace thin_provisioning { + } + } + +- superblock_detail::superblock read_superblock(block_manager<>::ptr bm) ++ superblock_detail::superblock read_superblock(block_manager<>::ptr bm, block_address location) + { + using namespace superblock_detail; + + superblock sb; +- auto r = bm->read_lock(SUPERBLOCK_LOCATION, superblock_validator()); ++ auto r = bm->read_lock(location, superblock_validator()); + superblock_disk const *sbd = reinterpret_cast(&r.data()); + superblock_traits::unpack(*sbd, sb); + return sb; + } + ++ superblock_detail::superblock read_superblock(block_manager<>::ptr bm) ++ { ++ return read_superblock(bm, SUPERBLOCK_LOCATION); ++ } ++ + void + check_superblock(block_manager<>::ptr bm, + superblock_detail::damage_visitor &visitor) { +diff --git a/thin-provisioning/superblock.h b/thin-provisioning/superblock.h +index e993497..a9377b0 100644 +--- a/thin-provisioning/superblock.h ++++ b/thin-provisioning/superblock.h +@@ -123,6 +123,7 @@ namespace thin_provisioning { + persistent_data::block_manager<>::validator::ptr superblock_validator(); + + superblock_detail::superblock read_superblock(persistent_data::block_manager<>::ptr bm); ++ superblock_detail::superblock read_superblock(persistent_data::block_manager<>::ptr bm, persistent_data::block_address location); + void check_superblock(persistent_data::block_manager<>::ptr bm, + superblock_detail::damage_visitor &visitor); + } +diff --git a/thin-provisioning/thin_dump.cc b/thin-provisioning/thin_dump.cc +index a4bcf66..029a635 100644 +--- a/thin-provisioning/thin_dump.cc ++++ b/thin-provisioning/thin_dump.cc +@@ -35,7 +35,7 @@ namespace { + int dump(string const &path, ostream &out, string const &format, bool repair, + block_address metadata_snap = 0) { + try { +- metadata::ptr md(new metadata(path, metadata::OPEN)); ++ metadata::ptr md(metadata_snap ? new metadata(path, metadata_snap) : new metadata(path, metadata::OPEN, 0, 0)); + emitter::ptr e; + + if (format == "xml") +@@ -63,7 +63,7 @@ namespace { + << " {-h|--help}" << endl + << " {-f|--format} {xml|human_readable}" << endl + << " {-r|--repair}" << endl +- << " {-m|--metadata-snap}" << endl ++ << " {-m|--metadata-snap} block#" << endl + << " {-o }" << endl + << " {-V|--version}" << endl; + } diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 080af40..27c6ef4 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,23 +4,29 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.2.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz Patch0: %{name}-0.2.1-nostrip.patch +Patch1: %{name}-0.2.1-thin_dump-support-metadata-snap-block.patch +Patch2: %{name}-0.2.1-new-thin_metadata_size.c.patch +Patch3: %{name}-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat %description -thin-provisioning-tools contains check,dump,restore,repair and rmap tools to -manage device-mapper thin provisioning target metadata devices. +thin-provisioning-tools contains check,dump,restore,repair,rmap and metadata_size +tools to manage device-mapper thin provisioning target metadata devices. %prep %setup -q -n thin-provisioning-tools-%{version} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build autoconf @@ -34,16 +40,26 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %files %doc COPYING README.md -%{_mandir}/man8/thin_dump.8.gz %{_mandir}/man8/thin_check.8.gz +%{_mandir}/man8/thin_dump.8.gz +%{_mandir}/man8/thin_metadata_size.8.gz +%{_mandir}/man8/thin_repair.8.gz %{_mandir}/man8/thin_restore.8.gz -%{_sbindir}/thin_dump +%{_mandir}/man8/thin_rmap.8.gz %{_sbindir}/thin_check +%{_sbindir}/thin_dump +%{_sbindir}/thin_metadata_size %{_sbindir}/thin_repair %{_sbindir}/thin_restore %{_sbindir}/thin_rmap %changelog +* Thu Jul 18 2013 Heinz Mauelshagen - 0.2.1-3 +- New thin_metadata_size tool to estimate amount of metadata space + based on block size, pool size and maximum amount of thin devs and snapshots +- support metadata snapshots in thin_dump tool +- New man pages for thin_metadata_size, thin_repair and thin_rmap and man page fixes + * Tue Jul 16 2013 Heinz Mauelshagen - 0.2.1-2 - Build with nostrip fix from Ville Skyttä From 691fcae6b7b51c98c67c1947868484116e77a0e7 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Fri, 19 Jul 2013 12:02:02 +0200 Subject: [PATCH 006/135] Update thin_metadata_size manual page thin_dump: support dumping default metadata snapshot --- ...-thin_dump-default-metadata-snapshot.patch | 166 ++++++++++++++++++ ...1-update-thin_metadata_size-man-page.patch | 31 ++++ device-mapper-persistent-data.spec | 11 +- 3 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 device-mapper-persistent-data-0.2.1-support-thin_dump-default-metadata-snapshot.patch create mode 100644 device-mapper-persistent-data-0.2.1-update-thin_metadata_size-man-page.patch diff --git a/device-mapper-persistent-data-0.2.1-support-thin_dump-default-metadata-snapshot.patch b/device-mapper-persistent-data-0.2.1-support-thin_dump-default-metadata-snapshot.patch new file mode 100644 index 0000000..4f72807 --- /dev/null +++ b/device-mapper-persistent-data-0.2.1-support-thin_dump-default-metadata-snapshot.patch @@ -0,0 +1,166 @@ +diff --git a/man8/thin_dump.8 b/man8/thin_dump.8 +index e60a6e5..b26cc2c 100644 +--- a/man8/thin_dump.8 ++++ b/man8/thin_dump.8 +@@ -23,9 +23,12 @@ Print output in XML or human readable format. + + .IP "\fB\-r, \-\-repair\fP". + +-.IP "\fB\-m, \-\-metadata_snap\fP block#". +-Dump metadata snapshot created by device-mapper thin provisioning target at block# +- ++.IP "\fB\-m, \-\-metadata_snap\fP [block#]". ++Dump metadata snapshot created by device-mapper thin provisioning target. ++If block is not provided, access the default metadata snapshot created by ++the thin provisioning device-mapper target, else try the one at block#. ++See the thin provisioning target documentation on how to create or release ++a metadata snapshot. + + .IP "\fB\-h, \-\-help\fP". + Print help and exit. +@@ -44,6 +47,13 @@ to standard output in XML format: + .sp + .B thin_dump /dev/vg/metadata + ++Dumps the thin provisioning metadata snapshot on logical volume /dev/vg/metadata ++to standard output in human readable format (not processable by ++.B thin_restore(8) ++): ++.sp ++.B thin_dump --format human_readable --metadata-snap /dev/vg/metadata ++ + .SH DIAGNOSTICS + .B thin_dump + returns an exit code of 0 for success or 1 for error. +diff --git a/thin-provisioning/metadata.cc b/thin-provisioning/metadata.cc +index 771325a..bef75ba 100644 +--- a/thin-provisioning/metadata.cc ++++ b/thin-provisioning/metadata.cc +@@ -78,6 +78,7 @@ namespace { + << "data block size " << sb.data_block_size_ << endl + << "metadata block size " << sb.metadata_block_size_ << endl + << "metadata nr blocks " << sb.metadata_nr_blocks_ << endl ++ << "metadata snapshot block " << sb.metadata_snap_ << endl + ; + } + } +diff --git a/thin-provisioning/thin_dump.cc b/thin-provisioning/thin_dump.cc +index 029a635..a844038 100644 +--- a/thin-provisioning/thin_dump.cc ++++ b/thin-provisioning/thin_dump.cc +@@ -31,23 +31,37 @@ using namespace persistent_data; + using namespace std; + using namespace thin_provisioning; + ++struct flags { ++ bool find_metadata_snap; ++ bool repair; ++}; ++ + namespace { +- int dump(string const &path, ostream &out, string const &format, bool repair, ++ int dump(string const &path, ostream *out, string const &format, struct flags &flags, + block_address metadata_snap = 0) { + try { +- metadata::ptr md(metadata_snap ? new metadata(path, metadata_snap) : new metadata(path, metadata::OPEN, 0, 0)); ++ metadata::ptr md(new metadata(path, metadata_snap)); + emitter::ptr e; ++ uint64_t metadata_snap_root = md->sb_.metadata_snap_; ++ ++ if (metadata_snap_root) { ++ md.reset(); ++ md = metadata::ptr(new metadata(path, metadata_snap_root)); ++ } else if (flags.find_metadata_snap) { ++ cerr << "no metadata snapshot found!" << endl; ++ exit(1); ++ } + + if (format == "xml") +- e = create_xml_emitter(out); ++ e = create_xml_emitter(*out); + else if (format == "human_readable") +- e = create_human_readable_emitter(out); ++ e = create_human_readable_emitter(*out); + else { + cerr << "unknown format '" << format << "'" << endl; + exit(1); + } + +- metadata_dump(md, e, repair); ++ metadata_dump(md, e, flags.repair); + + } catch (std::exception &e) { + cerr << e.what() << endl; +@@ -63,7 +77,7 @@ namespace { + << " {-h|--help}" << endl + << " {-f|--format} {xml|human_readable}" << endl + << " {-r|--repair}" << endl +- << " {-m|--metadata-snap} block#" << endl ++ << " {-m|--metadata-snap} [block#]" << endl + << " {-o }" << endl + << " {-V|--version}" << endl; + } +@@ -72,16 +86,16 @@ namespace { + int main(int argc, char **argv) + { + int c; +- bool repair = false; + char const *output = NULL; +- const char shortopts[] = "hm:o:f:rV"; ++ const char shortopts[] = "hm::o:f:rV"; ++ char *end_ptr; + string format = "xml"; + block_address metadata_snap = 0; +- char *end_ptr; ++ struct flags flags = { .find_metadata_snap = false, .repair = false }; + + const struct option longopts[] = { + { "help", no_argument, NULL, 'h'}, +- { "metadata-snap", required_argument, NULL, 'm' }, ++ { "metadata-snap", optional_argument, NULL, 'm' }, + { "output", required_argument, NULL, 'o'}, + { "format", required_argument, NULL, 'f' }, + { "repair", no_argument, NULL, 'r'}, +@@ -100,16 +114,24 @@ int main(int argc, char **argv) + break; + + case 'r': +- repair = true; ++ flags.repair = true; ++ break; ++ ++ case 's': ++ flags.find_metadata_snap = true; + break; + + case 'm': +- metadata_snap = strtoull(optarg, &end_ptr, 10); +- if (end_ptr == optarg) { +- cerr << "couldn't parse " << endl; +- usage(cerr, basename(argv[0])); +- return 1; +- } ++ if (optarg) { ++ metadata_snap = strtoull(optarg, &end_ptr, 10); ++ if (end_ptr == optarg) { ++ cerr << "couldn't parse " << endl; ++ usage(cerr, basename(argv[0])); ++ return 1; ++ } ++ } else ++ flags.find_metadata_snap = true; ++ + break; + + case 'o': +@@ -132,9 +154,5 @@ int main(int argc, char **argv) + return 1; + } + +- if (output) { +- ofstream out(output); +- return dump(argv[optind], out, format, repair, metadata_snap); +- } else +- return dump(argv[optind], cout, format, repair, metadata_snap); ++ return dump(argv[optind], output ? new ofstream(output) : &cout, format, flags, metadata_snap); + } diff --git a/device-mapper-persistent-data-0.2.1-update-thin_metadata_size-man-page.patch b/device-mapper-persistent-data-0.2.1-update-thin_metadata_size-man-page.patch new file mode 100644 index 0000000..67eaf4d --- /dev/null +++ b/device-mapper-persistent-data-0.2.1-update-thin_metadata_size-man-page.patch @@ -0,0 +1,31 @@ +diff --git a/man8/thin_metadata_size.8 b/man8/thin_metadata_size.8 +index 33b36b3..6b00e73 100644 +--- a/man8/thin_metadata_size.8 ++++ b/man8/thin_metadata_size.8 +@@ -1,6 +1,6 @@ + .TH THIN_METADATA_SIZE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- + .SH NAME +-thin_metadata_size \- thin provisioning metadata file/device size calculator. ++thin_metadata_size \- thin provisioning metadata device/file size calculator. + + .SH SYNOPSIS + .B thin_metadata_size +@@ -10,13 +10,15 @@ thin_metadata_size \- thin provisioning metadata file/device size calculator. + .B thin_metadata_size + calculates the size of the thin provisioning metadata based on the block size + of the thin provisioned devices, the size of the thin provisioning pool and +-the maximum number of all thin prisioned devices and snapshots. Size/number +-option arguments can be followed by unit specifiers in short one character +-and long form (eg. -b1m or -b1megabytes). ++the maximum number of all thin prisioned devices and snapshots. ++Because thin provisioning pools are holding widely variable contents, ++this tool is needed to provide sensible initial default size. + + .IP "\fB\-b, \-\-block-size\fP \fIBLOCKSIZE[bskKmMgGtTpPeEzZyY]\fP" + Block size of thin provisioned devices in units of bytes,sectors,kilobytes,kibibytes,... respectively. + Default is in sectors without a block size unit specifier. ++Size/number option arguments can be followed by unit specifiers in short one character ++and long form (eg. -b1m or -b1megabytes). + + .IP "\fB\-s, \-\-pool-size\fP \fIPOOLSIZE[bskKmMgGtTpPeEzZyY]\fP" + Thin provisioning pool size in units of bytes,sectors,kilobytes,kibibytes,... respectively. diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 27c6ef4..fb01680 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.2.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -14,6 +14,8 @@ Patch0: %{name}-0.2.1-nostrip.patch Patch1: %{name}-0.2.1-thin_dump-support-metadata-snap-block.patch Patch2: %{name}-0.2.1-new-thin_metadata_size.c.patch Patch3: %{name}-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch +Patch4: %{name}-0.2.1-update-thin_metadata_size-man-page.patch +Patch5: %{name}-0.2.1-support-thin_dump-default-metadata-snapshot.patch BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat @@ -23,10 +25,13 @@ tools to manage device-mapper thin provisioning target metadata devices. %prep %setup -q -n thin-provisioning-tools-%{version} +echo %{version}-%{release} > VERSION %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build autoconf @@ -54,6 +59,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Fri Jul 18 2013 Heinz Mauelshagen - 0.2.1-4 +- Update thin_metadata_size manual page +- thin_dump: support dumping default metadata snapshot + * Thu Jul 18 2013 Heinz Mauelshagen - 0.2.1-3 - New thin_metadata_size tool to estimate amount of metadata space based on block size, pool size and maximum amount of thin devs and snapshots From c49cc7d04575b922d1ffdddb7f91dc4c150ed75a Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Fri, 19 Jul 2013 13:25:11 +0200 Subject: [PATCH 007/135] avoid strip at install --- ...sistent-data-0.2.1-new-thin_metadata_size.c.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch b/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch index 9610ca5..a7fa994 100644 --- a/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch +++ b/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch @@ -90,12 +90,12 @@ index a82ff67..1e7bd54 100644 - $(INSTALL_PROGRAM) thin_repair $(BINDIR) - $(INSTALL_PROGRAM) thin_restore $(BINDIR) - $(INSTALL_PROGRAM) thin_rmap $(BINDIR) -+ $(INSTALL_PROGRAM) -s thin_check $(BINDIR) -+ $(INSTALL_PROGRAM) -s thin_dump $(BINDIR) -+ $(INSTALL_PROGRAM) -s thin_repair $(BINDIR) -+ $(INSTALL_PROGRAM) -s thin_restore $(BINDIR) -+ $(INSTALL_PROGRAM) -s thin_rmap $(BINDIR) -+ $(INSTALL_PROGRAM) -s thin_metadata_size $(BINDIR) ++ $(INSTALL_PROGRAM) thin_check $(BINDIR) ++ $(INSTALL_PROGRAM) thin_dump $(BINDIR) ++ $(INSTALL_PROGRAM) thin_repair $(BINDIR) ++ $(INSTALL_PROGRAM) thin_restore $(BINDIR) ++ $(INSTALL_PROGRAM) thin_rmap $(BINDIR) ++ $(INSTALL_PROGRAM) thin_metadata_size $(BINDIR) $(INSTALL_DIR) $(MANPATH)/man8 $(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8 $(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8 From c118e69cb7fd1e09cca0a932efe55442df1a8cea Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Thu, 25 Jul 2013 15:32:25 +0200 Subject: [PATCH 008/135] 0.2.1-5: enhance manual pages and fix typos --- ....2.1-man-page-enhancements-and-typos.patch | 160 ++++++++++++++++++ device-mapper-persistent-data.spec | 7 +- 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 device-mapper-persistent-data-0.2.1-man-page-enhancements-and-typos.patch diff --git a/device-mapper-persistent-data-0.2.1-man-page-enhancements-and-typos.patch b/device-mapper-persistent-data-0.2.1-man-page-enhancements-and-typos.patch new file mode 100644 index 0000000..4e2bdf0 --- /dev/null +++ b/device-mapper-persistent-data-0.2.1-man-page-enhancements-and-typos.patch @@ -0,0 +1,160 @@ +diff --git a/man8/thin_dump.8 b/man8/thin_dump.8 +index b26cc2c..4827e1a 100644 +--- a/man8/thin_dump.8 ++++ b/man8/thin_dump.8 +@@ -5,30 +5,37 @@ thin_dump \- dump thin provisioning metadata from device or file to standard out + .SH SYNOPSIS + .B thin_dump + .RB [options] +-.I {metadata device|file} ++.I {device|file} + + .SH DESCRIPTION + .B thin_dump + dumps binary thin provisioning metadata (optionally from alternate block; + see option \-\-metadata-snap) created by the device-mapper +-thin provisioning target on a device or file to standard output for ++thin provisioning target on a ++.I device ++or ++.I file ++to standard output for + analysis or postprocessing in either XML or human readable format. + XML formated metadata can be fed into thin_restore (see + .BR thin_restore(8) ) +-in order to put it back onto a metadata device (to process by +-the device-mapper target) or file. ++in order to put it back onto a metadata ++.I device ++(to process by the device-mapper target) or ++.I file. + + .IP "\fB\-f, \-\-format\fP \fI{xml|human_readable}\fP". + Print output in XML or human readable format. + + .IP "\fB\-r, \-\-repair\fP". ++Repair the metadata whilst dumping it. + + .IP "\fB\-m, \-\-metadata_snap\fP [block#]". + Dump metadata snapshot created by device-mapper thin provisioning target. + If block is not provided, access the default metadata snapshot created by + the thin provisioning device-mapper target, else try the one at block#. + See the thin provisioning target documentation on how to create or release +-a metadata snapshot. ++a metadata snapshot and retrieve the block number from the kernel. + + .IP "\fB\-h, \-\-help\fP". + Print help and exit. +diff --git a/man8/thin_metadata_size.8 b/man8/thin_metadata_size.8 +index 6b00e73..80e572f 100644 +--- a/man8/thin_metadata_size.8 ++++ b/man8/thin_metadata_size.8 +@@ -27,7 +27,7 @@ Default is in sectors without a pool size unit specifier. + .IP "\fB\-m, \-\-max-thins\fP \fI#[bskKmMgGtTpPeEzZyY]\fP" + Maximum sum of all thin provisioned devices and snapshots. + Unit identifier supported to allow for convenient entry of large quantities, eg. 1000000 = 1M. +-Default is absolut quantity without a number unit specifier. ++Default is absolute quantity without a number unit specifier. + + .IP "\fB\-u, \-\-unit\fP \fI{bskKmMgGtTpPeEzZyY}\fP" + Output unit specifier in units of bytes,sectors,kilobytes,kibibytes,... respectively. +@@ -43,7 +43,7 @@ Print help and exit. + Output version information and exit. + + .SH EXAMPLES +-Calculates the thin privisioning metadata device size for block size 64 kilobytes, ++Calculates the thin provisioning metadata device size for block size 64 kilobytes, + pool size 1 terabytes and maximum number of thin provisioned devices and snapshots of 1000 + in units of sectors with long output: + .sp +diff --git a/man8/thin_repair.8 b/man8/thin_repair.8 +index 69cddea..1048de5 100644 +--- a/man8/thin_repair.8 ++++ b/man8/thin_repair.8 +@@ -12,9 +12,18 @@ thin_repair \- repair thin provisioning binary metadata from device/file to devi + + .SH DESCRIPTION + .B thin_repair +-repairs binary thin provisioning metadata created by the +-respective device-mapper target processing to another device or file. +-If repaired to a metadata device, the metadata can be processed ++reads binary thin provisioning metadata created by the ++respective device-mapper target from one ++.I device ++or ++.I file ++, repairs it and writes it to another ++.I device ++or ++.I file. ++If written to a metadata ++.I device ++, the metadata can be processed + by the device-mapper target. + + .IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" +@@ -30,10 +39,10 @@ Print help and exit. + Output version information and exit. + + .SH EXAMPLE +-Repairs the binary thin provisioning metadata on file ++Reads the binary thin provisioning metadata from file + .B metadata +-to logical volume /dev/vg/metadata for further processing by the +-respective device-mapper target: ++, repairs it and writes it to logical volume /dev/vg/metadata ++for further processing by the respective device-mapper target: + .sp + .B thin_repair -i metadata -o /dev/vg/metadata + +diff --git a/man8/thin_restore.8 b/man8/thin_restore.8 +index 8ab2976..dc7eb90 100644 +--- a/man8/thin_restore.8 ++++ b/man8/thin_restore.8 +@@ -15,9 +15,14 @@ thin_restore \- restore thin provisioning metadata file to device or file + restores thin provisioning metadata created by the + respective device-mapper target dumped into an XML formatted (see + .BR thin_dump(8) ) +-file, which optionally can be preprocessed to another device or file. +-If restored to a metadata device, the metadata can be processed +-by the device-mapper target. ++.I file ++, which optionally can be preprocessed before the restore to another ++.I device ++or ++.I file. ++If restored to a metadata ++.I device ++, the metadata can be processed by the device-mapper target. + + .IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" + Input file or device with metadata. +diff --git a/man8/thin_rmap.8 b/man8/thin_rmap.8 +index d68defb..4d74520 100644 +--- a/man8/thin_rmap.8 ++++ b/man8/thin_rmap.8 +@@ -1,16 +1,20 @@ + .TH THIN_DUMP 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- + .SH NAME +-thin_rmap \- output reverse map of a thin provisioned region of blocks ++thin_rmap \- output reverse map of a thin provisioned region of blocks from metadata device or file + + .SH SYNOPSIS + .B thin_rmap + .RB [options] +-.I {metadata device|file} ++.I {device|file} + + .SH DESCRIPTION + .B thin_rmap +-outputs the reverse mapping for a region of thin provisioned pool blocks +-to the respective thin provisioned devices. ++outputs the reverse mapping stored in the metadata on a ++.I device ++or ++.I file ++between a region of thin provisioned pool blocks ++and the associated thin provisioned devices. + + .IP "\fB\\-\-region\fP \fI\fP". + output reverse map diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index fb01680..e377afd 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.2.1 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -16,6 +16,7 @@ Patch2: %{name}-0.2.1-new-thin_metadata_size.c.patch Patch3: %{name}-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch Patch4: %{name}-0.2.1-update-thin_metadata_size-man-page.patch Patch5: %{name}-0.2.1-support-thin_dump-default-metadata-snapshot.patch +Patch6: %{name}-0.2.1-man-page-enhancements-and-typos.patch BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat @@ -32,6 +33,7 @@ echo %{version}-%{release} > VERSION %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build autoconf @@ -59,6 +61,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Thu Jul 25 2013 Heinz Mauelshagen - 0.2.1-5 +- enhance manual pages and fix typos + * Fri Jul 18 2013 Heinz Mauelshagen - 0.2.1-4 - Update thin_metadata_size manual page - thin_dump: support dumping default metadata snapshot From 5c88a9978a6f78f26440bb005c093cecd11fbd04 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Tue, 30 Jul 2013 13:47:15 +0200 Subject: [PATCH 009/135] Rebuild for boost 1.54.0 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index e377afd..9e30bef 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.2.1 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -61,6 +61,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Tue Jul 30 2013 Petr Machata - 0.2.1-6 +- Rebuild for boost 1.54.0 + * Thu Jul 25 2013 Heinz Mauelshagen - 0.2.1-5 - enhance manual pages and fix typos From 1211aa83a7747d77b83d055e7345267df4da435a Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Tue, 30 Jul 2013 20:02:00 +0200 Subject: [PATCH 010/135] New upstream version 0.2.2 plus manual header fixes --- .gitignore | 1 + ...rsistent-data-0.2.2-man-pages-header.patch | 20 ++++++++++++++++++ device-mapper-persistent-data.spec | 21 ++++++------------- sources | 2 +- 4 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 device-mapper-persistent-data-0.2.2-man-pages-header.patch diff --git a/.gitignore b/.gitignore index 68d35b9..ed33cb9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /thin-provisioning-tools-v0.1.4.tar.bz2 /thin-provisioning-tools-v0.2.1.tar.bz2 +/thin-provisioning-tools-v0.2.2.tar.bz2 diff --git a/device-mapper-persistent-data-0.2.2-man-pages-header.patch b/device-mapper-persistent-data-0.2.2-man-pages-header.patch new file mode 100644 index 0000000..487c2e1 --- /dev/null +++ b/device-mapper-persistent-data-0.2.2-man-pages-header.patch @@ -0,0 +1,20 @@ +diff --git a/man8/thin_check.8 b/man8/thin_check.8 +index 1489078..a8dc81b 100644 +--- a/man8/thin_check.8 ++++ b/man8/thin_check.8 +@@ -1,4 +1,4 @@ +-.TH THIN_REPAIR 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.TH THIN_CHECK 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- + .SH NAME + thin_check \- repair thin provisioning metadata on device or file + +diff --git a/man8/thin_rmap.8 b/man8/thin_rmap.8 +index 4d74520..684c86c 100644 +--- a/man8/thin_rmap.8 ++++ b/man8/thin_rmap.8 +@@ -1,4 +1,4 @@ +-.TH THIN_DUMP 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.TH THIN_RMAP(g 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- + .SH NAME + thin_rmap \- output reverse map of a thin provisioned region of blocks from metadata device or file + diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index e377afd..e198bcc 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,20 +3,14 @@ # Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data -Version: 0.2.1 -Release: 5%{?dist} +Version: 0.2.2 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz -Patch0: %{name}-0.2.1-nostrip.patch -Patch1: %{name}-0.2.1-thin_dump-support-metadata-snap-block.patch -Patch2: %{name}-0.2.1-new-thin_metadata_size.c.patch -Patch3: %{name}-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch -Patch4: %{name}-0.2.1-update-thin_metadata_size-man-page.patch -Patch5: %{name}-0.2.1-support-thin_dump-default-metadata-snapshot.patch -Patch6: %{name}-0.2.1-man-page-enhancements-and-typos.patch +Patch0: device-mapper-persistent-data-0.2.2-man-pages-header.patch BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat @@ -28,12 +22,6 @@ tools to manage device-mapper thin provisioning target metadata devices. %setup -q -n thin-provisioning-tools-%{version} echo %{version}-%{release} > VERSION %patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 %build autoconf @@ -61,6 +49,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Tue Jul 29 2013 Heinz Mauelshagen - 0.2.2-1 +- New upstream version + * Thu Jul 25 2013 Heinz Mauelshagen - 0.2.1-5 - enhance manual pages and fix typos diff --git a/sources b/sources index 5a86374..870959c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -122bd4414f9afdf893be2fc3d3355bb4 thin-provisioning-tools-v0.2.1.tar.bz2 +1da19c34350a3d12e9754dd5cf4d60b6 thin-provisioning-tools-v0.2.2.tar.bz2 From 944747f65fbe5a6810b7873092805aaeb46a7e95 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Tue, 30 Jul 2013 20:05:35 +0200 Subject: [PATCH 011/135] Fix date in changelog entry --- device-mapper-persistent-data.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 45ca57f..1604eae 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -49,7 +49,7 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog -* Tue Jul 29 2013 Heinz Mauelshagen - 0.2.2-1 +* Tue Jul 30 2013 Heinz Mauelshagen - 0.2.2-1 - New upstream version - manual header fixes From 19bf08d4a50a235de43ead7d77f062df697ed61c Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 30 Jul 2013 20:31:33 -0500 Subject: [PATCH 012/135] rebuild against boost 1.54.0 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 1604eae..1665172 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.2.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -49,6 +49,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Tue Jul 30 2013 Dennis Gilmore - 0.2.2-1 +- rebuild against boost 1.54.0 + * Tue Jul 30 2013 Heinz Mauelshagen - 0.2.2-1 - New upstream version - manual header fixes From bad87612eca0b4ad9a5b822ea0d7b99ab7a30140 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Wed, 31 Jul 2013 16:54:32 +0200 Subject: [PATCH 013/135] New upstream version 0.2.3 --- .gitignore | 1 + device-mapper-persistent-data.spec | 11 ++++++----- sources | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index ed33cb9..6437dc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /thin-provisioning-tools-v0.1.4.tar.bz2 /thin-provisioning-tools-v0.2.1.tar.bz2 /thin-provisioning-tools-v0.2.2.tar.bz2 +/thin-provisioning-tools-v0.2.3.tar.bz2 diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 1665172..b37b9cb 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,14 +3,13 @@ # Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data -Version: 0.2.2 -Release: 2%{?dist} +Version: 0.2.3 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz -Patch0: device-mapper-persistent-data-0.2.2-man-pages-header.patch BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat @@ -21,7 +20,6 @@ tools to manage device-mapper thin provisioning target metadata devices. %prep %setup -q -n thin-provisioning-tools-%{version} echo %{version}-%{release} > VERSION -%patch0 -p1 %build autoconf @@ -49,7 +47,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog -* Tue Jul 30 2013 Dennis Gilmore - 0.2.2-1 +* Wed Jul 31 2013 Heinz Mauelshagen - 0.2.3-1 +- New upstream version + +* Tue Jul 30 2013 Dennis Gilmore - 0.2.2-2 - rebuild against boost 1.54.0 * Tue Jul 30 2013 Heinz Mauelshagen - 0.2.2-1 diff --git a/sources b/sources index 870959c..16273bb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1da19c34350a3d12e9754dd5cf4d60b6 thin-provisioning-tools-v0.2.2.tar.bz2 +3ed92934d518c69ab724cc6e165a5706 thin-provisioning-tools-v0.2.3.tar.bz2 From 93bccb1ebf6ab31a2481b3993e01909e37725576 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Tue, 17 Sep 2013 17:01:23 +0200 Subject: [PATCH 014/135] New upstream version 0.2.7 --- device-mapper-persistent-data.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index b37b9cb..b02d208 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,7 +3,7 @@ # Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data -Version: 0.2.3 +Version: 0.2.7 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -47,6 +47,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Tue Sep 17 2013 Heinz Mauelshagen - 0.2.7-1 +- New upstream version 0.2.7 + * Wed Jul 31 2013 Heinz Mauelshagen - 0.2.3-1 - New upstream version diff --git a/sources b/sources index 16273bb..656f2a2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3ed92934d518c69ab724cc6e165a5706 thin-provisioning-tools-v0.2.3.tar.bz2 +7c9573504efa2723ff442c4f9af80172 thin-provisioning-tools-v0.2.7.tar.bz2 From 70cb8d09036e20e4f3fc0eebba351f770bb0efbf Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Fri, 18 Oct 2013 16:07:51 +0200 Subject: [PATCH 015/135] New upstream version 0.2.8 introducing cache_{check,dump,repair,restore} --- .gitignore | 1 + ...stent-data-0.2.8-1-missing-man-pages.patch | 270 ++++++++++++++++++ device-mapper-persistent-data.spec | 27 +- sources | 2 +- 4 files changed, 295 insertions(+), 5 deletions(-) create mode 100644 device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch diff --git a/.gitignore b/.gitignore index 6437dc9..6c6c70b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /thin-provisioning-tools-v0.2.1.tar.bz2 /thin-provisioning-tools-v0.2.2.tar.bz2 /thin-provisioning-tools-v0.2.3.tar.bz2 +/thin-provisioning-tools-v0.2.8.tar.bz2 diff --git a/device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch b/device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch new file mode 100644 index 0000000..be0aaa1 --- /dev/null +++ b/device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch @@ -0,0 +1,270 @@ +diff --git a/man8/cache_check.8 b/man8/cache_check.8 +new file mode 100644 +index 0000000..5cc7dff +--- /dev/null ++++ b/man8/cache_check.8 +@@ -0,0 +1,62 @@ ++.TH CACHE_CHECK 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++cache_check \- repair cache metadata on device or file ++ ++.SH SYNOPSIS ++.B cache_check ++.RB [ options ] ++.I {device|file} ++ ++.SH DESCRIPTION ++.B cache_check ++checks cache metadata created by ++the device-mapper cache target on a ++.I device ++or ++.I file. ++ ++.SH OPTIONS ++.IP "\fB\-q, \-\-quiet\fP" ++Suppress output messages, return only exit code. ++ ++.IP "\fB\-h, \-\-help\fP" ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP" ++Output version information and exit. ++ ++.IP "\fB\-\-super\-block\-only\fP" ++Only check the superblock is present. ++ ++.IP "\fB\-\-skip-mappings\fP" ++Skip checking of the block mappings which make up the bulk of the ++metadata. ++ ++.IP "\fB\-\-skip-hints\fP" ++Skip checking of the policy hint values metadata. ++ ++.IP "\fB\-\-skip-discards\fP" ++Skip checking of the discard bits in the metadata. ++ ++.SH EXAMPLE ++Analyses and repairs cache metadata on logical volume ++/dev/vg/metadata: ++.sp ++.B cache_check /dev/vg/metadata ++ ++The device may not be actively used by the target ++when running. ++ ++.SH DIAGNOSTICS ++.B cache_check ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B cache_dump(8) ++.B cache_repair(8) ++.B cache_restore(8) ++ ++.SH AUTHOR ++Joe Thornber ++.br ++Heinz Mauelshagen +diff --git a/man8/cache_dump.8 b/man8/cache_dump.8 +new file mode 100644 +index 0000000..a0c2924 +--- /dev/null ++++ b/man8/cache_dump.8 +@@ -0,0 +1,59 @@ ++.TH CACHE_DUMP 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++cache_dump \- dump cache metadata from device or file to standard output ++ ++.SH SYNOPSIS ++.B cache_dump ++.RB [options] ++.I {device|file} ++ ++.SH DESCRIPTION ++.B cache_dump ++dumps binary cache metadata created by ++the device-mapper cache target on a ++.I device ++or ++.I file ++to standard output for ++analysis or postprocessing in XML format. ++XML formated metadata can be fed into cache_restore (see ++.BR cache_restore(8) ) ++in order to put it back onto a metadata ++.I device ++(to process by the device-mapper target) or ++.I file. ++ ++.IP "\fB\-r, \-\-repair\fP". ++Repair the metadata whilst dumping it. ++ ++.IP "\fB\-h, \-\-help\fP". ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP". ++Output version information and exit. ++ ++.SH EXAMPLES ++Dumps the cache metadata on logical volume /dev/vg/metadata ++to standard output in XML format: ++.sp ++.B cache_dump /dev/vg/metadata ++ ++.SH EXAMPLES ++Dumps the cache metadata on logical volume /dev/vg/metadata ++whilst repairing it to standard output in XML format: ++.sp ++.B cache_dump --repair /dev/vg/metadata ++ ++.SH DIAGNOSTICS ++.B cache_dump ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B cache_check(8) ++.B cache_repair(8) ++.B cache_restore(8) ++ ++.SH AUTHOR ++Joe Thornber ++.br ++Heinz Mauelshagen +diff --git a/man8/cache_repair.8 b/man8/cache_repair.8 +new file mode 100644 +index 0000000..ef04a7f +--- /dev/null ++++ b/man8/cache_repair.8 +@@ -0,0 +1,61 @@ ++.TH CACHE_REPAIR 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++cache_repair \- repair cache binary metadata from device/file to device/file ++ ++.SH SYNOPSIS ++.B cache_repair ++.RB [ options ] ++.RB -i ++.I {device|file} ++.RB -o ++.I {device|file} ++ ++.SH DESCRIPTION ++.B cache_repair ++reads binary cache metadata created by the ++respective device-mapper target from one ++.I device ++or ++.I file ++, repairs it and writes it to another ++.I device ++or ++.I file. ++If written to a metadata ++.I device ++, the metadata can be processed ++by the device-mapper target. ++ ++.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" ++Input file or device with binary metadata. ++ ++.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" ++Output file or device for repaired binary metadata. ++ ++.IP "\fB\-h, \-\-help\fP" ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP" ++Output version information and exit. ++ ++.SH EXAMPLE ++Reads the binary cache metadata from file ++.B metadata ++, repairs it and writes it to logical volume /dev/vg/metadata ++for further processing by the respective device-mapper target: ++.sp ++.B cache_repair -i metadata -o /dev/vg/metadata ++ ++.SH DIAGNOSTICS ++.B cache_repair ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B cache_dump(8) ++.B cache_check(8) ++.B cache_restore(8) ++ ++.SH AUTHOR ++Joe Thornber ++.br ++Heinz Mauelshagen +diff --git a/man8/cache_restore.8 b/man8/cache_restore.8 +new file mode 100644 +index 0000000..5f9fdca +--- /dev/null ++++ b/man8/cache_restore.8 +@@ -0,0 +1,64 @@ ++.TH CACHE_RESTORE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++cache_restore \- restore cache metadata file to device or file ++ ++.SH SYNOPSIS ++.B cache_restore ++.RB [ options ] ++.RB -i ++.I {device|file} ++.RB -o ++.I {device|file} ++ ++.SH DESCRIPTION ++.B cache_restore ++restores cache metadata created by the respective ++device-mapper target dumped into an XML formatted (see ++.BR cache_dump(8) ) ++.I file ++, which optionally can be preprocessed before the restore to another ++.I device ++or ++.I file. ++If restored to a metadata ++.I device ++, the metadata can be processed by the device-mapper target. ++ ++.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" ++Input file or device with metadata. ++ ++.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" ++Output file or device. ++ ++.IP "\fB{\-\-debug-override-metadata-version}\fP \fI\fP" ++ONLY FOR DEBUGGING PURPOSES: ++.br ++override the version stored in the metadata. ++ ++.IP "\fB\-h, \-\-help\fP" ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP" ++Output version information and exit. ++ ++.SH EXAMPLE ++Restores the XML formatted cache metadata on file ++.B metadata ++to logical volume /dev/vg/metadata for further processing by the ++respective device-mapper target: ++.sp ++.B cache_restore -i metadata -o /dev/vg/metadata ++ ++.SH DIAGNOSTICS ++.B cache_restore ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B cache_dump(8) ++.B cache_check(8) ++.B cache_repair(8) ++ ++.SH AUTHOR ++Joe Thornber ++.br ++Heinz Mauelshagen diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index b02d208..ff9140a 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,22 +3,30 @@ # Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data -Version: 0.2.7 +Version: 0.2.8 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz +Patch0: device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat %description -thin-provisioning-tools contains check,dump,restore,repair,rmap and metadata_size -tools to manage device-mapper thin provisioning target metadata devices. - + BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel + Requires: expat + + %description +thin-provisioning-tools contains check,dump,restore,repair,rmap +and metadata_size tools to manage device-mapper thin provisioning +target metadata devices; cache check,dump,restore and repair tools +to manage device-mapper cache metadata devices are included. + %prep %setup -q -n thin-provisioning-tools-%{version} +%patch0 -p1 echo %{version}-%{release} > VERSION %build @@ -33,12 +41,20 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %files %doc COPYING README.md +%{_mandir}/man8/cache_check.8.gz +%{_mandir}/man8/cache_dump.8.gz +%{_mandir}/man8/cache_restore.8.gz +%{_mandir}/man8/cache_repair.8.gz %{_mandir}/man8/thin_check.8.gz %{_mandir}/man8/thin_dump.8.gz %{_mandir}/man8/thin_metadata_size.8.gz %{_mandir}/man8/thin_repair.8.gz %{_mandir}/man8/thin_restore.8.gz %{_mandir}/man8/thin_rmap.8.gz +%{_sbindir}/cache_check +%{_sbindir}/cache_dump +%{_sbindir}/cache_restore +%{_sbindir}/cache_repair %{_sbindir}/thin_check %{_sbindir}/thin_dump %{_sbindir}/thin_metadata_size @@ -47,6 +63,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Fri Oct 18 2013 Heinz Mauelshagen - 0.2.8-1 +- New upstream version 0.2.8 introducing cache_{check,dump,repair,restore} + * Tue Sep 17 2013 Heinz Mauelshagen - 0.2.7-1 - New upstream version 0.2.7 diff --git a/sources b/sources index 656f2a2..0cde143 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7c9573504efa2723ff442c4f9af80172 thin-provisioning-tools-v0.2.7.tar.bz2 +c8799aab7032030b78439cd774f3b072 thin-provisioning-tools-v0.2.8.tar.bz2 From 18673315e83ae1684c90aea7eea33ef3e8875bf6 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Fri, 18 Oct 2013 17:17:23 +0200 Subject: [PATCH 016/135] add missing files to Makefile.in to install --- ...istent-data-0.2.8-1-missing-installs.patch | 24 +++++++++++++++++++ device-mapper-persistent-data.spec | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 device-mapper-persistent-data-0.2.8-1-missing-installs.patch diff --git a/device-mapper-persistent-data-0.2.8-1-missing-installs.patch b/device-mapper-persistent-data-0.2.8-1-missing-installs.patch new file mode 100644 index 0000000..59e9840 --- /dev/null +++ b/device-mapper-persistent-data-0.2.8-1-missing-installs.patch @@ -0,0 +1,24 @@ +--- thin-provisioning-tools-0.2.8/Makefile.in.orig 2013-10-18 17:11:34.320772851 +0200 ++++ thin-provisioning-tools-0.2.8/Makefile.in 2013-10-18 17:11:09.938219484 +0200 +@@ -299,6 +299,10 @@ + + install: $(PROGRAMS) + $(INSTALL_DIR) $(BINDIR) ++ $(INSTALL_PROGRAM) cache_check $(BINDIR) ++ $(INSTALL_PROGRAM) cache_dump $(BINDIR) ++ $(INSTALL_PROGRAM) cache_repair $(BINDIR) ++ $(INSTALL_PROGRAM) cache_restore $(BINDIR) + $(INSTALL_PROGRAM) thin_check $(BINDIR) + $(INSTALL_PROGRAM) thin_dump $(BINDIR) + $(INSTALL_PROGRAM) thin_repair $(BINDIR) +@@ -306,6 +310,10 @@ + $(INSTALL_PROGRAM) thin_rmap $(BINDIR) + $(INSTALL_PROGRAM) thin_metadata_size $(BINDIR) + $(INSTALL_DIR) $(MANPATH)/man8 ++ $(INSTALL_DATA) man8/cache_check.8 $(MANPATH)/man8 ++ $(INSTALL_DATA) man8/cache_dump.8 $(MANPATH)/man8 ++ $(INSTALL_DATA) man8/cache_repair.8 $(MANPATH)/man8 ++ $(INSTALL_DATA) man8/cache_restore.8 $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8 + $(INSTALL_DATA) man8/thin_repair.8 $(MANPATH)/man8 diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index ff9140a..655483a 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -11,6 +11,7 @@ URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz Patch0: device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch +Patch1: device-mapper-persistent-data-0.2.8-1-missing-installs.patch BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat @@ -27,6 +28,7 @@ to manage device-mapper cache metadata devices are included. %prep %setup -q -n thin-provisioning-tools-%{version} %patch0 -p1 +%patch1 -p1 echo %{version}-%{release} > VERSION %build From 9f61a23fdbbeb2152e5f75a9351af17fcc97daa9 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Thu, 27 Mar 2014 16:26:31 +0100 Subject: [PATCH 017/135] New upstream version 0.3.0 introducing era_{check,dump,invalidate} --- .gitignore | 1 + device-mapper-persistent-data.spec | 16 ++++++++++------ sources | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 6c6c70b..a2a73f7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /thin-provisioning-tools-v0.2.2.tar.bz2 /thin-provisioning-tools-v0.2.3.tar.bz2 /thin-provisioning-tools-v0.2.8.tar.bz2 +/thin-provisioning-tools-v0.3.0.tar.bz2 diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 655483a..743a487 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,15 +3,13 @@ # Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data -Version: 0.2.8 +Version: 0.3.0 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz -Patch0: device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch -Patch1: device-mapper-persistent-data-0.2.8-1-missing-installs.patch BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel Requires: expat @@ -23,12 +21,12 @@ Requires: expat thin-provisioning-tools contains check,dump,restore,repair,rmap and metadata_size tools to manage device-mapper thin provisioning target metadata devices; cache check,dump,restore and repair tools -to manage device-mapper cache metadata devices are included. +to manage device-mapper cache metadata devices are included and +era array, check, detail, dump and invalidate to support +snapshot eras %prep %setup -q -n thin-provisioning-tools-%{version} -%patch0 -p1 -%patch1 -p1 echo %{version}-%{release} > VERSION %build @@ -57,6 +55,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/cache_dump %{_sbindir}/cache_restore %{_sbindir}/cache_repair +%{_sbindir}/era_check +%{_sbindir}/era_dump +%{_sbindir}/era_invalidate %{_sbindir}/thin_check %{_sbindir}/thin_dump %{_sbindir}/thin_metadata_size @@ -65,6 +66,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Thu Mar 27 2014 Heinz Mauelshagen - 0.3.0-1 +- New upstream version 0.3.0 introducing era_{check,dump,invalidate} + * Fri Oct 18 2013 Heinz Mauelshagen - 0.2.8-1 - New upstream version 0.2.8 introducing cache_{check,dump,repair,restore} diff --git a/sources b/sources index 0cde143..e94b596 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c8799aab7032030b78439cd774f3b072 thin-provisioning-tools-v0.2.8.tar.bz2 +c18a3640a1581a9926f39d561d4ccbd2 thin-provisioning-tools-v0.3.0.tar.bz2 From e9af3e69898c942422779ecd9253d1305486c576 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Fri, 11 Apr 2014 11:04:33 +0200 Subject: [PATCH 018/135] New upstream version 0.3.2 fixing needs_check flag processing --- .gitignore | 1 + device-mapper-persistent-data.spec | 10 ++++++---- sources | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a2a73f7..6a08d70 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /thin-provisioning-tools-v0.2.3.tar.bz2 /thin-provisioning-tools-v0.2.8.tar.bz2 /thin-provisioning-tools-v0.3.0.tar.bz2 +/thin-provisioning-tools-v0.3.2.tar.bz2 diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 743a487..cdc6b59 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -1,9 +1,9 @@ # -# Copyright (C) 2011-2013 Red Hat, Inc +# Copyright (C) 2011-2014 Red Hat, Inc # Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data -Version: 0.3.0 +Version: 0.3.2 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -22,8 +22,7 @@ thin-provisioning-tools contains check,dump,restore,repair,rmap and metadata_size tools to manage device-mapper thin provisioning target metadata devices; cache check,dump,restore and repair tools to manage device-mapper cache metadata devices are included and -era array, check, detail, dump and invalidate to support -snapshot eras +era check, dump and invalidate to support manage eras %prep %setup -q -n thin-provisioning-tools-%{version} @@ -66,6 +65,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Fri Apr 11 2014 Heinz Mauelshagen - 0.3.2-1 +- New upstream version 0.3.2 fixing needs_check flag processing + * Thu Mar 27 2014 Heinz Mauelshagen - 0.3.0-1 - New upstream version 0.3.0 introducing era_{check,dump,invalidate} diff --git a/sources b/sources index e94b596..2e92956 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c18a3640a1581a9926f39d561d4ccbd2 thin-provisioning-tools-v0.3.0.tar.bz2 +d739827615bdc12ddb789baef6738a1c thin-provisioning-tools-v0.3.2.tar.bz2 From 51a54a90f996cbbf84c1d313371a4d181d6efc65 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Thu, 22 May 2014 22:33:09 +0200 Subject: [PATCH 019/135] Rebuild for boost 1.55.0 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index cdc6b59..841605e 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.3.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -65,6 +65,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Thu May 22 2014 Petr Machata - 0.3.2-2 +- Rebuild for boost 1.55.0 + * Fri Apr 11 2014 Heinz Mauelshagen - 0.3.2-1 - New upstream version 0.3.2 fixing needs_check flag processing From aab46dbd3c642648b32a7d8c783534bb5a7698cc Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 7 Jun 2014 02:12:57 -0500 Subject: [PATCH 020/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 841605e..b9cfdff 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.3.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -65,6 +65,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Sat Jun 07 2014 Fedora Release Engineering - 0.3.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Thu May 22 2014 Petr Machata - 0.3.2-2 - Rebuild for boost 1.55.0 From a4b87b027347d4c88ccc2982381407ac87c20010 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 16 Aug 2014 02:37:20 +0000 Subject: [PATCH 021/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index b9cfdff..dd31f02 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper thin provisioning tools Name: device-mapper-persistent-data Version: 0.3.2 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -65,6 +65,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Sat Aug 16 2014 Fedora Release Engineering - 0.3.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Sat Jun 07 2014 Fedora Release Engineering - 0.3.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 44a227cacdb62d1d4ea018643587e5201b0b9853 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Wed, 29 Oct 2014 13:44:15 +0100 Subject: [PATCH 022/135] New upstream version 0.4.1 adding tools and enhancing performance --- ...pper-persistent-data-0.4.1-bz1085620.patch | 15 +++ ...sistent-data-0.4.1-missing-man-pages.patch | 116 ++++++++++++++++++ device-mapper-persistent-data.spec | 40 +++--- sources | 2 +- 4 files changed, 158 insertions(+), 15 deletions(-) create mode 100644 device-mapper-persistent-data-0.4.1-bz1085620.patch create mode 100644 device-mapper-persistent-data-0.4.1-missing-man-pages.patch diff --git a/device-mapper-persistent-data-0.4.1-bz1085620.patch b/device-mapper-persistent-data-0.4.1-bz1085620.patch new file mode 100644 index 0000000..6fa4163 --- /dev/null +++ b/device-mapper-persistent-data-0.4.1-bz1085620.patch @@ -0,0 +1,15 @@ +--- thin-provisioning-tools-0.4.1/man8/thin_check.8.orig 2014-10-28 14:19:02.800420873 +0100 ++++ thin-provisioning-tools-0.4.1/man8/thin_check.8 2014-10-28 14:19:47.335924554 +0100 +@@ -25,6 +25,12 @@ + .IP "\fB\-V, \-\-version\fP" + Output version information and exit. + ++.IP "\fB\-\-clear\-needs\-check\-flag\fP" ++Clear the needs-check-flag in case the check of the thin pool metadata succeeded. ++If the metadata check failed, the flag is not cleared and a thin_repair run is ++needed to fix any issues. ++After thin_repair succeeded, you may run thin_check again. ++ + .IP "\fB\-\-super\-block\-only\fP" + Only check the superblock is present. + diff --git a/device-mapper-persistent-data-0.4.1-missing-man-pages.patch b/device-mapper-persistent-data-0.4.1-missing-man-pages.patch new file mode 100644 index 0000000..ac2e687 --- /dev/null +++ b/device-mapper-persistent-data-0.4.1-missing-man-pages.patch @@ -0,0 +1,116 @@ +--- thin-provisioning-tools-0.4.1/man8/era_restore.8.orig 2014-10-28 14:24:43.356272471 +0100 ++++ thin-provisioning-tools-0.4.1/man8/era_restore.8 2014-10-28 14:28:56.358133852 +0100 +@@ -0,0 +1,63 @@ ++.TH ERA_RESTORE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++era_restore \- restore era metadata file to device or file ++ ++.SH SYNOPSIS ++.B era_restore ++.RB [ options ] ++.RB -i ++.I {device|file} ++.RB -o ++.I {device|file} ++ ++.SH DESCRIPTION ++.B era_restore ++restores binary era metadata created by the ++respective device-mapper target dumped into an XML formatted (see ++.BR era_dump(8) ) ++.I file ++, which optionally can be preprocessed before the restore to another ++.I device ++or ++.I file. ++If restored to a metadata ++.I device ++, the metadata can be processed by the device-mapper target. ++ ++.IP "\fB\-q, \-\-quiet\fP" ++Suppress output messages, return only exit code. ++ ++.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" ++Input file or device with metadata. ++ ++.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" ++Output file or device. ++ ++.IP "\fB\-h, \-\-help\fP" ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP" ++Output version information and exit. ++ ++.SH EXAMPLE ++Restores the XML formatted era metadata on file ++.B metadata ++to logical volume /dev/vg/metadata for further processing by the ++respective device-mapper target: ++.sp ++.B era_restore -i metadata -o /dev/vg/metadata ++ ++.SH DIAGNOSTICS ++.B era_restore ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B era_check(8) ++.B era_dump(8) ++.B era_invaidate(8) ++.B era_restore(8) ++ ++.SH AUTHOR ++Joe Thornber ++.br ++Heinz Mauelshagen +--- thin-provisioning-tools-0.4.1/man8/cache_metadata_size.8.orig 2014-10-28 14:31:49.116087709 +0100 ++++ thin-provisioning-tools-0.4.1/man8/cache_metadata_size.8 2014-10-28 14:50:29.337238755 +0100 +@@ -0,0 +1,47 @@ ++.TH CACHE_METADATA_SIZE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++cache_metadata_size \- cache metadata device/file size calculator. ++ ++.SH SYNOPSIS ++.B cache_metadata_size ++.RB [ options ] ++ ++.SH DESCRIPTION ++.B cache_metadata_size ++calculates the size of the cache metadata based on the block size ++of the cache device and the cache block size. ++All relates to the size of the fast device (eg, SSD), rather ++than the whole cached (i.e. origin) device. ++ ++.IP "\fB\\-\-block\-size \fP ++Block size of cache in units of sectors. ++ ++.IP "\fB\\-\-device\-size \fP ++Device size of the cache device in units of sectors. ++ ++.IP "\fB\\-\-nr\-blocks \fP ++Capacity of the cache in number of blocks. ++ ++.IP "\fB\-h, \-\-help\fP" ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP" ++Output version information and exit. ++ ++.SH EXAMPLES ++Calculates the cache metadata device size for block size 256 sectors.and device size of 2GiB ++.sp ++.B cache_metadata_size --block-size 256 --device-size $((2*1024*1024)) ++ ++.SH DIAGNOSTICS ++.B cache_metadata_size ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B cache_check(8) ++.B cache_dump(8) ++.B cache_repair(8) ++.B cache_restore(8) ++ ++.SH AUTHOR ++Heinz Mauelshagen diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index dd31f02..28e6e32 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -1,31 +1,32 @@ # # Copyright (C) 2011-2014 Red Hat, Inc # -Summary: Device-mapper thin provisioning tools +Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.3.2 -Release: 4%{?dist} +Version: 0.4.1 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz -BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel +BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat +Patch0: device-mapper-persistent-data-0.4.1-bz1085620.patch +Patch1: device-mapper-persistent-data-0.4.1-missing-man-pages.patch %description - BuildRequires: autoconf, expat-devel, libstdc++-devel, boost-devel - Requires: expat - - %description thin-provisioning-tools contains check,dump,restore,repair,rmap and metadata_size tools to manage device-mapper thin provisioning -target metadata devices; cache check,dump,restore and repair tools -to manage device-mapper cache metadata devices are included and -era check, dump and invalidate to support manage eras - +target metadata devices; cache check,dump,metadata_size,restore +and repair tools to manage device-mapper cache metadata devices +are included and era check, dump, restore and invalidate to manage +snapshot eras + %prep %setup -q -n thin-provisioning-tools-%{version} +%patch0 -p1 +%patch1 -p1 echo %{version}-%{release} > VERSION %build @@ -44,26 +45,37 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_mandir}/man8/cache_dump.8.gz %{_mandir}/man8/cache_restore.8.gz %{_mandir}/man8/cache_repair.8.gz +%{_mandir}/man8/era_check.8.gz +%{_mandir}/man8/era_dump.8.gz +%{_mandir}/man8/era_invalidate.8.gz %{_mandir}/man8/thin_check.8.gz %{_mandir}/man8/thin_dump.8.gz %{_mandir}/man8/thin_metadata_size.8.gz -%{_mandir}/man8/thin_repair.8.gz %{_mandir}/man8/thin_restore.8.gz +%{_mandir}/man8/thin_repair.8.gz %{_mandir}/man8/thin_rmap.8.gz +%{_sbindir}/pdata_tools %{_sbindir}/cache_check %{_sbindir}/cache_dump +%{_sbindir}/cache_metadata_size %{_sbindir}/cache_restore %{_sbindir}/cache_repair %{_sbindir}/era_check %{_sbindir}/era_dump +%{_sbindir}/era_restore %{_sbindir}/era_invalidate %{_sbindir}/thin_check %{_sbindir}/thin_dump %{_sbindir}/thin_metadata_size -%{_sbindir}/thin_repair %{_sbindir}/thin_restore +%{_sbindir}/thin_repair %{_sbindir}/thin_rmap +%changelog +* Tue Oct 29 2014 Heinz Mauelshagen - 0.4.1-1 +- New upstream version +- Manual header additions/fixes + %changelog * Sat Aug 16 2014 Fedora Release Engineering - 0.3.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild diff --git a/sources b/sources index 2e92956..e3c7ae7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d739827615bdc12ddb789baef6738a1c thin-provisioning-tools-v0.3.2.tar.bz2 +a1d5ac4bd865360dff6ac20ec00573cc thin-provisioning-tools-v0.4.1.tar.bz2 From 7a3ac27c458c2479f2c5bad59b36f8764db19f9a Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Wed, 29 Oct 2014 13:51:01 +0100 Subject: [PATCH 023/135] New upstream version 0.4.1 adding tools and enhancing performance --- device-mapper-persistent-data.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 28e6e32..122f393 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -76,7 +76,6 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install - New upstream version - Manual header additions/fixes -%changelog * Sat Aug 16 2014 Fedora Release Engineering - 0.3.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild From e4d966d2d13e5b975fed4246d27404259b3082b8 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Wed, 12 Nov 2014 18:53:28 +0100 Subject: [PATCH 024/135] Resolves: bz#1159466 --- device-mapper-persistent-data-0.4.1-avoid-strip.patch | 11 +++++++++++ device-mapper-persistent-data.spec | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 device-mapper-persistent-data-0.4.1-avoid-strip.patch diff --git a/device-mapper-persistent-data-0.4.1-avoid-strip.patch b/device-mapper-persistent-data-0.4.1-avoid-strip.patch new file mode 100644 index 0000000..f7babda --- /dev/null +++ b/device-mapper-persistent-data-0.4.1-avoid-strip.patch @@ -0,0 +1,11 @@ +--- a/Makefile.in 2014-11-12 18:46:30.282251378 +0100 ++++ b/Makefile.in 2014-11-12 18:46:56.108608255 +0100 +@@ -108,7 +108,7 @@ + vpath %.cc $(TOP_DIR) + + INSTALL_DIR = $(INSTALL) -m 755 -d +-INSTALL_PROGRAM = $(INSTALL) -m 755 -s ++INSTALL_PROGRAM = $(INSTALL) -m 755 + INSTALL_DATA = $(INSTALL) -p -m 644 + + ifeq ("@TESTING@", "yes") diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 122f393..1d2c655 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.4.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -14,6 +14,7 @@ BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat Patch0: device-mapper-persistent-data-0.4.1-bz1085620.patch Patch1: device-mapper-persistent-data-0.4.1-missing-man-pages.patch +Patch2: device-mapper-persistent-data-0.4.1-avoid-strip.patch %description thin-provisioning-tools contains check,dump,restore,repair,rmap @@ -27,6 +28,7 @@ snapshot eras %setup -q -n thin-provisioning-tools-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 echo %{version}-%{release} > VERSION %build @@ -72,6 +74,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Tue Oct 29 2014 Heinz Mauelshagen - 0.4.1-2 +- Resolves: bz#1159466 + * Tue Oct 29 2014 Heinz Mauelshagen - 0.4.1-1 - New upstream version - Manual header additions/fixes From ef64c79098d80f2b485c8b385838450930afce18 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Mon, 26 Jan 2015 20:31:54 +0100 Subject: [PATCH 025/135] Rebuild for boost 1.57.0 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 1d2c655..d3c57e5 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.4.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -74,6 +74,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Mon Jan 26 2015 Petr Machata - 0.4.1-3 +- Rebuild for boost 1.57.0 + * Tue Oct 29 2014 Heinz Mauelshagen - 0.4.1-2 - Resolves: bz#1159466 From 6e89b7444ef78e98b951dfb001c00438875e5d5f Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Sat, 2 May 2015 13:19:05 +0200 Subject: [PATCH 026/135] Rebuilt for GCC 5 C++11 ABI change --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index d3c57e5..32ec750 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.4.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -74,6 +74,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_rmap %changelog +* Sat May 02 2015 Kalev Lember - 0.4.1-4 +- Rebuilt for GCC 5 C++11 ABI change + * Mon Jan 26 2015 Petr Machata - 0.4.1-3 - Rebuild for boost 1.57.0 From 2f00308a6f9e9388788d7f169ec94e214f07b64f Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 10 Jun 2015 12:58:22 +0200 Subject: [PATCH 027/135] New upstream release. --- ....2.1-man-page-enhancements-and-typos.patch | 160 ------ ...ges-new-thin_metadata_size-and-fixes.patch | 281 ---------- ...-data-0.2.1-new-thin_metadata_size.c.patch | 494 ------------------ ...mapper-persistent-data-0.2.1-nostrip.patch | 20 - ...-thin_dump-default-metadata-snapshot.patch | 166 ------ ...hin_dump-support-metadata-snap-block.patch | 114 ---- ...1-update-thin_metadata_size-man-page.patch | 31 -- ...rsistent-data-0.2.2-man-pages-header.patch | 20 - ...istent-data-0.2.8-1-missing-installs.patch | 24 - ...stent-data-0.2.8-1-missing-man-pages.patch | 270 ---------- ...er-persistent-data-0.4.1-avoid-strip.patch | 11 - ...pper-persistent-data-0.4.1-bz1085620.patch | 15 - ...sistent-data-0.4.1-missing-man-pages.patch | 116 ---- device-mapper-persistent-data.spec | 35 +- sources | 2 +- 15 files changed, 23 insertions(+), 1736 deletions(-) delete mode 100644 device-mapper-persistent-data-0.2.1-man-page-enhancements-and-typos.patch delete mode 100644 device-mapper-persistent-data-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch delete mode 100644 device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch delete mode 100644 device-mapper-persistent-data-0.2.1-nostrip.patch delete mode 100644 device-mapper-persistent-data-0.2.1-support-thin_dump-default-metadata-snapshot.patch delete mode 100644 device-mapper-persistent-data-0.2.1-thin_dump-support-metadata-snap-block.patch delete mode 100644 device-mapper-persistent-data-0.2.1-update-thin_metadata_size-man-page.patch delete mode 100644 device-mapper-persistent-data-0.2.2-man-pages-header.patch delete mode 100644 device-mapper-persistent-data-0.2.8-1-missing-installs.patch delete mode 100644 device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch delete mode 100644 device-mapper-persistent-data-0.4.1-avoid-strip.patch delete mode 100644 device-mapper-persistent-data-0.4.1-bz1085620.patch delete mode 100644 device-mapper-persistent-data-0.4.1-missing-man-pages.patch diff --git a/device-mapper-persistent-data-0.2.1-man-page-enhancements-and-typos.patch b/device-mapper-persistent-data-0.2.1-man-page-enhancements-and-typos.patch deleted file mode 100644 index 4e2bdf0..0000000 --- a/device-mapper-persistent-data-0.2.1-man-page-enhancements-and-typos.patch +++ /dev/null @@ -1,160 +0,0 @@ -diff --git a/man8/thin_dump.8 b/man8/thin_dump.8 -index b26cc2c..4827e1a 100644 ---- a/man8/thin_dump.8 -+++ b/man8/thin_dump.8 -@@ -5,30 +5,37 @@ thin_dump \- dump thin provisioning metadata from device or file to standard out - .SH SYNOPSIS - .B thin_dump - .RB [options] --.I {metadata device|file} -+.I {device|file} - - .SH DESCRIPTION - .B thin_dump - dumps binary thin provisioning metadata (optionally from alternate block; - see option \-\-metadata-snap) created by the device-mapper --thin provisioning target on a device or file to standard output for -+thin provisioning target on a -+.I device -+or -+.I file -+to standard output for - analysis or postprocessing in either XML or human readable format. - XML formated metadata can be fed into thin_restore (see - .BR thin_restore(8) ) --in order to put it back onto a metadata device (to process by --the device-mapper target) or file. -+in order to put it back onto a metadata -+.I device -+(to process by the device-mapper target) or -+.I file. - - .IP "\fB\-f, \-\-format\fP \fI{xml|human_readable}\fP". - Print output in XML or human readable format. - - .IP "\fB\-r, \-\-repair\fP". -+Repair the metadata whilst dumping it. - - .IP "\fB\-m, \-\-metadata_snap\fP [block#]". - Dump metadata snapshot created by device-mapper thin provisioning target. - If block is not provided, access the default metadata snapshot created by - the thin provisioning device-mapper target, else try the one at block#. - See the thin provisioning target documentation on how to create or release --a metadata snapshot. -+a metadata snapshot and retrieve the block number from the kernel. - - .IP "\fB\-h, \-\-help\fP". - Print help and exit. -diff --git a/man8/thin_metadata_size.8 b/man8/thin_metadata_size.8 -index 6b00e73..80e572f 100644 ---- a/man8/thin_metadata_size.8 -+++ b/man8/thin_metadata_size.8 -@@ -27,7 +27,7 @@ Default is in sectors without a pool size unit specifier. - .IP "\fB\-m, \-\-max-thins\fP \fI#[bskKmMgGtTpPeEzZyY]\fP" - Maximum sum of all thin provisioned devices and snapshots. - Unit identifier supported to allow for convenient entry of large quantities, eg. 1000000 = 1M. --Default is absolut quantity without a number unit specifier. -+Default is absolute quantity without a number unit specifier. - - .IP "\fB\-u, \-\-unit\fP \fI{bskKmMgGtTpPeEzZyY}\fP" - Output unit specifier in units of bytes,sectors,kilobytes,kibibytes,... respectively. -@@ -43,7 +43,7 @@ Print help and exit. - Output version information and exit. - - .SH EXAMPLES --Calculates the thin privisioning metadata device size for block size 64 kilobytes, -+Calculates the thin provisioning metadata device size for block size 64 kilobytes, - pool size 1 terabytes and maximum number of thin provisioned devices and snapshots of 1000 - in units of sectors with long output: - .sp -diff --git a/man8/thin_repair.8 b/man8/thin_repair.8 -index 69cddea..1048de5 100644 ---- a/man8/thin_repair.8 -+++ b/man8/thin_repair.8 -@@ -12,9 +12,18 @@ thin_repair \- repair thin provisioning binary metadata from device/file to devi - - .SH DESCRIPTION - .B thin_repair --repairs binary thin provisioning metadata created by the --respective device-mapper target processing to another device or file. --If repaired to a metadata device, the metadata can be processed -+reads binary thin provisioning metadata created by the -+respective device-mapper target from one -+.I device -+or -+.I file -+, repairs it and writes it to another -+.I device -+or -+.I file. -+If written to a metadata -+.I device -+, the metadata can be processed - by the device-mapper target. - - .IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" -@@ -30,10 +39,10 @@ Print help and exit. - Output version information and exit. - - .SH EXAMPLE --Repairs the binary thin provisioning metadata on file -+Reads the binary thin provisioning metadata from file - .B metadata --to logical volume /dev/vg/metadata for further processing by the --respective device-mapper target: -+, repairs it and writes it to logical volume /dev/vg/metadata -+for further processing by the respective device-mapper target: - .sp - .B thin_repair -i metadata -o /dev/vg/metadata - -diff --git a/man8/thin_restore.8 b/man8/thin_restore.8 -index 8ab2976..dc7eb90 100644 ---- a/man8/thin_restore.8 -+++ b/man8/thin_restore.8 -@@ -15,9 +15,14 @@ thin_restore \- restore thin provisioning metadata file to device or file - restores thin provisioning metadata created by the - respective device-mapper target dumped into an XML formatted (see - .BR thin_dump(8) ) --file, which optionally can be preprocessed to another device or file. --If restored to a metadata device, the metadata can be processed --by the device-mapper target. -+.I file -+, which optionally can be preprocessed before the restore to another -+.I device -+or -+.I file. -+If restored to a metadata -+.I device -+, the metadata can be processed by the device-mapper target. - - .IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" - Input file or device with metadata. -diff --git a/man8/thin_rmap.8 b/man8/thin_rmap.8 -index d68defb..4d74520 100644 ---- a/man8/thin_rmap.8 -+++ b/man8/thin_rmap.8 -@@ -1,16 +1,20 @@ - .TH THIN_DUMP 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- - .SH NAME --thin_rmap \- output reverse map of a thin provisioned region of blocks -+thin_rmap \- output reverse map of a thin provisioned region of blocks from metadata device or file - - .SH SYNOPSIS - .B thin_rmap - .RB [options] --.I {metadata device|file} -+.I {device|file} - - .SH DESCRIPTION - .B thin_rmap --outputs the reverse mapping for a region of thin provisioned pool blocks --to the respective thin provisioned devices. -+outputs the reverse mapping stored in the metadata on a -+.I device -+or -+.I file -+between a region of thin provisioned pool blocks -+and the associated thin provisioned devices. - - .IP "\fB\\-\-region\fP \fI\fP". - output reverse map diff --git a/device-mapper-persistent-data-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch b/device-mapper-persistent-data-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch deleted file mode 100644 index 85af857..0000000 --- a/device-mapper-persistent-data-0.2.1-man-pages-new-thin_metadata_size-and-fixes.patch +++ /dev/null @@ -1,281 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index 1e7bd54..b44cbd7 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -264,7 +264,10 @@ install: $(PROGRAMS) - $(INSTALL_DIR) $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8 -+ $(INSTALL_DATA) man8/thin_repair.8 $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_restore.8 $(MANPATH)/man8 -+ $(INSTALL_DATA) man8/thin_rmap.8 $(MANPATH)/man8 -+ $(INSTALL_DATA) man8/thin_metadata_size.8 $(MANPATH)/man8 - - .PHONY: install - -diff --git a/man8/thin_check.8 b/man8/thin_check.8 -index f9606e0..1489078 100644 ---- a/man8/thin_check.8 -+++ b/man8/thin_check.8 -@@ -55,7 +55,10 @@ returns an exit code of 0 for success or 1 for error. - - .SH SEE ALSO - .B thin_dump(8) -+.B thin_repair(8) - .B thin_restore(8) -+.B thin_rmap(8) -+.B thin_metadata_size(8) - - .SH AUTHOR - Joe Thornber -diff --git a/man8/thin_dump.8 b/man8/thin_dump.8 -index 697df83..e60a6e5 100644 ---- a/man8/thin_dump.8 -+++ b/man8/thin_dump.8 -@@ -9,7 +9,8 @@ thin_dump \- dump thin provisioning metadata from device or file to standard out - - .SH DESCRIPTION - .B thin_dump --dumps thin provisioning metadata created by the device-mapper -+dumps binary thin provisioning metadata (optionally from alternate block; -+see option \-\-metadata-snap) created by the device-mapper - thin provisioning target on a device or file to standard output for - analysis or postprocessing in either XML or human readable format. - XML formated metadata can be fed into thin_restore (see -@@ -22,6 +23,10 @@ Print output in XML or human readable format. - - .IP "\fB\-r, \-\-repair\fP". - -+.IP "\fB\-m, \-\-metadata_snap\fP block#". -+Dump metadata snapshot created by device-mapper thin provisioning target at block# -+ -+ - .IP "\fB\-h, \-\-help\fP". - Print help and exit. - -@@ -45,8 +50,10 @@ returns an exit code of 0 for success or 1 for error. - - .SH SEE ALSO - .B thin_check(8) -+.B thin_repair(8) - .B thin_restore(8) -- -+.B thin_rmap(8) -+.B thin_metadata_size(8) - .SH AUTHOR - Joe Thornber - .br -diff --git a/man8/thin_metadata_size.8 b/man8/thin_metadata_size.8 -new file mode 100644 -index 0000000..33b36b3 ---- /dev/null -+++ b/man8/thin_metadata_size.8 -@@ -0,0 +1,77 @@ -+.TH THIN_METADATA_SIZE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+thin_metadata_size \- thin provisioning metadata file/device size calculator. -+ -+.SH SYNOPSIS -+.B thin_metadata_size -+.RB [ options ] -+ -+.SH DESCRIPTION -+.B thin_metadata_size -+calculates the size of the thin provisioning metadata based on the block size -+of the thin provisioned devices, the size of the thin provisioning pool and -+the maximum number of all thin prisioned devices and snapshots. Size/number -+option arguments can be followed by unit specifiers in short one character -+and long form (eg. -b1m or -b1megabytes). -+ -+.IP "\fB\-b, \-\-block-size\fP \fIBLOCKSIZE[bskKmMgGtTpPeEzZyY]\fP" -+Block size of thin provisioned devices in units of bytes,sectors,kilobytes,kibibytes,... respectively. -+Default is in sectors without a block size unit specifier. -+ -+.IP "\fB\-s, \-\-pool-size\fP \fIPOOLSIZE[bskKmMgGtTpPeEzZyY]\fP" -+Thin provisioning pool size in units of bytes,sectors,kilobytes,kibibytes,... respectively. -+Default is in sectors without a pool size unit specifier. -+ -+.IP "\fB\-m, \-\-max-thins\fP \fI#[bskKmMgGtTpPeEzZyY]\fP" -+Maximum sum of all thin provisioned devices and snapshots. -+Unit identifier supported to allow for convenient entry of large quantities, eg. 1000000 = 1M. -+Default is absolut quantity without a number unit specifier. -+ -+.IP "\fB\-u, \-\-unit\fP \fI{bskKmMgGtTpPeEzZyY}\fP" -+Output unit specifier in units of bytes,sectors,kilobytes,kibibytes,... respectively. -+Default is in sectors without an output unit specifier. -+ -+.IP "\fB\-n, \-\-numeric-only [short|long]\fP" -+Limit output to just the size number with the optional unit specifier character/string. -+ -+.IP "\fB\-h, \-\-help\fP" -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP" -+Output version information and exit. -+ -+.SH EXAMPLES -+Calculates the thin privisioning metadata device size for block size 64 kilobytes, -+pool size 1 terabytes and maximum number of thin provisioned devices and snapshots of 1000 -+in units of sectors with long output: -+.sp -+.B thin_metadata_size -b64k -s1t -m1000 -+ -+Or (using the long options instead) for block size 1 gigabyte, pool size 1 petabytes and maximum number of thin provisioned devices -+and snapshots of 1 million with numeric only output in units of gigabytes: -+.sp -+.B thin_metadata_size --block-size=1g --pool-size=1p --max-thins=1M --unit=g --numeric-only -+ -+Same as before (1g,1p,1M,numeric-only) but with unit specifier character appended: -+.sp -+.B thin_metadata_size --block-size=1giga --pool-size=1petabytes --max-thins=1mebi --unit=g --numeric-only=short -+ -+Or with unit specifier string appended: -+.sp -+.B thin_metadata_size --block-size=1giga --pool-size=1petabytes --max-thins=1mebi --unit=g -nlong -+ -+.SH DIAGNOSTICS -+.B thin_metadata_size -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B thin_dump(8) -+.B thin_check(8) -+.B thin_repair(8) -+.B thin_restore(8) -+.B thin_rmap(8) -+ -+.SH AUTHOR -+Joe Thornber -+.br -+Heinz Mauelshagen -diff --git a/man8/thin_repair.8 b/man8/thin_repair.8 -new file mode 100644 -index 0000000..69cddea ---- /dev/null -+++ b/man8/thin_repair.8 -@@ -0,0 +1,54 @@ -+.TH THIN_REPAIR 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+thin_repair \- repair thin provisioning binary metadata from device/file to device/file -+ -+.SH SYNOPSIS -+.B thin_repair -+.RB [ options ] -+.RB -i -+.I {device|file} -+.RB -o -+.I {device|file} -+ -+.SH DESCRIPTION -+.B thin_repair -+repairs binary thin provisioning metadata created by the -+respective device-mapper target processing to another device or file. -+If repaired to a metadata device, the metadata can be processed -+by the device-mapper target. -+ -+.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" -+Input file or device with binary metadata. -+ -+.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" -+Output file or device for repaired binary metadata. -+ -+.IP "\fB\-h, \-\-help\fP" -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP" -+Output version information and exit. -+ -+.SH EXAMPLE -+Repairs the binary thin provisioning metadata on file -+.B metadata -+to logical volume /dev/vg/metadata for further processing by the -+respective device-mapper target: -+.sp -+.B thin_repair -i metadata -o /dev/vg/metadata -+ -+.SH DIAGNOSTICS -+.B thin_repair -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B thin_dump(8) -+.B thin_check(8) -+.B thin_restore(8) -+.B thin_rmap(8) -+.B thin_metadata_size(8) -+ -+.SH AUTHOR -+Joe Thornber -+.br -+Heinz Mauelshagen -diff --git a/man8/thin_restore.8 b/man8/thin_restore.8 -index b4a07aa..8ab2976 100644 ---- a/man8/thin_restore.8 -+++ b/man8/thin_restore.8 -@@ -40,12 +40,15 @@ respective device-mapper target: - .B thin_restore -i metadata -o /dev/vg/metadata - - .SH DIAGNOSTICS --.B thin_dump -+.B thin_restore - returns an exit code of 0 for success or 1 for error. - - .SH SEE ALSO - .B thin_dump(8) - .B thin_check(8) -+.B thin_repair(8) -+.B thin_rmap(8) -+.B thin_metadata_size(8) - - .SH AUTHOR - Joe Thornber -diff --git a/man8/thin_rmap.8 b/man8/thin_rmap.8 -new file mode 100644 -index 0000000..d68defb ---- /dev/null -+++ b/man8/thin_rmap.8 -@@ -0,0 +1,44 @@ -+.TH THIN_DUMP 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+thin_rmap \- output reverse map of a thin provisioned region of blocks -+ -+.SH SYNOPSIS -+.B thin_rmap -+.RB [options] -+.I {metadata device|file} -+ -+.SH DESCRIPTION -+.B thin_rmap -+outputs the reverse mapping for a region of thin provisioned pool blocks -+to the respective thin provisioned devices. -+ -+.IP "\fB\\-\-region\fP \fI\fP". -+output reverse map -+ -+.IP "\fB\-h, \-\-help\fP". -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP". -+Output version information and exit. -+ -+.SH EXAMPLES -+output reverse map for pool blocks 5..45 (denotes blocks 5 to 44 inclusive, but not block 45) -+ -+.sp -+.B thin_rmap -r 5..45 /dev/vg/pool -+ -+.SH DIAGNOSTICS -+.B thin_rmap -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B thin_check(8) -+.B thin_dump(8) -+.B thin_repair(8) -+.B thin_restore(8) -+.B thin_metadata_size(8) -+ -+.SH AUTHOR -+Joe Thornber -+.br -+Heinz Mauelshagen diff --git a/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch b/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch deleted file mode 100644 index a7fa994..0000000 --- a/device-mapper-persistent-data-0.2.1-new-thin_metadata_size.c.patch +++ /dev/null @@ -1,494 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index a82ff67..1e7bd54 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -24,7 +24,8 @@ PROGRAMS=\ - thin_dump \ - thin_restore \ - thin_repair \ -- thin_rmap -+ thin_rmap \ -+ thin_metadata_size - - all: $(PROGRAMS) - -@@ -64,7 +65,7 @@ SOURCE=\ - - PDATA_OBJECTS=$(subst .cc,.o,$(SOURCE)) - --PROGRAM_SOURCE=\ -+CXX_PROGRAM_SOURCE=\ - cache/check.cc \ - \ - thin-provisioning/thin_check.cc \ -@@ -73,10 +74,15 @@ PROGRAM_SOURCE=\ - thin-provisioning/thin_repair.cc \ - thin-provisioning/thin_rmap.cc - -+C_PROGRAM_SOURCE=\ -+ thin-provisioning/thin_metadata_size.c -+ -+CC:=@CC@ - CXX:=@CXX@ - OBJECTS:=$(subst .cc,.o,$(SOURCE)) - TOP_DIR:=@top_srcdir@ - TOP_BUILDDIR:=@top_builddir@ -+CFLAGS+=-g -Wall -O3 - CXXFLAGS+=-std=c++11 -g -Wall -fno-strict-aliasing - CXXFLAGS+=@CXXOPTIMISE_FLAG@ - CXXFLAGS+=@CXXDEBUG_FLAG@ -@@ -104,6 +110,14 @@ endif - - .SUFFIXES: .d - -+%.o: %.c -+ @echo " [CC] $<" -+ $(V) $(CC) -c $(INCLUDES) $(CFLAGS) -o $@ $< -+ @echo " [DEP] $<" -+ $(V) $(CC) -MM -MT $(subst .c,.o,$<) $(INCLUDES) $(CFLAGS) $< > $*.$$$$; \ -+ sed 's,\([^ :]*\)\.o[ :]*,\1.o \1.gmo $* : Makefile ,g' < $*.$$$$ > $*.d; \ -+ $(RM) $*.$$$$ -+ - %.o: %.cc - @echo " [CXX] $<" - $(V) $(CXX) -c $(INCLUDES) $(CXXFLAGS) -o $@ $< -@@ -195,6 +209,10 @@ thin_rmap: $(THIN_RMAP_OBJECTS) thin-provisioning/thin_rmap.o - @echo " [LD] $@" - $(V) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) - -+thin_metadata_size: thin-provisioning/thin_metadata_size.o -+ @echo " [LD] $@" -+ $(V) $(CC) $(CFLAGS) -o $@ $+ -lm -+ - #---------------------------------------------------------------- - # Cache tools - -@@ -221,29 +239,33 @@ cache_check: $(CACHE_CHECK_OBJECTS) cache/check.o - DEPEND_FILES=\ - $(subst .cc,.d,$(SOURCE)) \ - $(subst .cc,.d,$(TEST_SOURCE)) \ -- $(subst .cc,.d,$(PROGRAM_SOURCE)) -+ $(subst .cc,.d,$(CXX_PROGRAM_SOURCE)) \ -+ $(subst .c,.d,$(C_PROGRAM_SOURCE)) - - .PHONY: clean distclean - - clean: - find . -name \*.o -delete - find . -name \*.gmo -delete -- $(RM) $(DEPEND_FILES) $(TEST_PROGRAMS) $(PROGRAMS) $(GMOCK_OBJECTS) lib/*.a -+ find . -name \*.d -delete -+ $(RM) $(TEST_PROGRAMS) $(PROGRAMS) $(GMOCK_OBJECTS) lib/*.a - - distclean: clean - $(RM) config.cache config.log config.status configure.h version.h Makefile unit-tests/Makefile - - install: $(PROGRAMS) - $(INSTALL_DIR) $(BINDIR) -- $(INSTALL_PROGRAM) thin_check $(BINDIR) -- $(INSTALL_PROGRAM) thin_dump $(BINDIR) -- $(INSTALL_PROGRAM) thin_repair $(BINDIR) -- $(INSTALL_PROGRAM) thin_restore $(BINDIR) -- $(INSTALL_PROGRAM) thin_rmap $(BINDIR) -+ $(INSTALL_PROGRAM) thin_check $(BINDIR) -+ $(INSTALL_PROGRAM) thin_dump $(BINDIR) -+ $(INSTALL_PROGRAM) thin_repair $(BINDIR) -+ $(INSTALL_PROGRAM) thin_restore $(BINDIR) -+ $(INSTALL_PROGRAM) thin_rmap $(BINDIR) -+ $(INSTALL_PROGRAM) thin_metadata_size $(BINDIR) - $(INSTALL_DIR) $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_restore.8 $(MANPATH)/man8 -+ - .PHONY: install - - ifeq ("@TESTING@", "yes") -diff --git a/configure.in b/configure.in -index 78d88c1..8f25002 100644 ---- a/configure.in -+++ b/configure.in -@@ -30,6 +30,7 @@ dnl -- Setup the directory where autoconf has auxilary files - AC_CONFIG_AUX_DIR(autoconf) - AC_CANONICAL_TARGET([]) - AC_PROG_CXX([g++]) -+AC_PROG_CC([gcc]) - AC_LANG(C++) - - ################################################################ -diff --git a/thin-provisioning/thin_metadata_size.c b/thin-provisioning/thin_metadata_size.c -new file mode 100755 -index 0000000..1f52d51 ---- /dev/null -+++ b/thin-provisioning/thin_metadata_size.c -@@ -0,0 +1,370 @@ -+/* -+ * Copyright (C) 2013 Red Hat, GmbH -+ * -+ * Calculates device-mapper thin privisioning -+ * metadata device size based on pool, block size and -+ * maximum expected thin provisioned devices and snapshots. -+ * -+ * This file is part of the thin-provisioning-tools source. -+ * -+ * thin-provisioning-tools is free software: you can redistribute it -+ * and/or modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation, either version 3 of -+ * the License, or (at your option) any later version. -+ * -+ * thin-provisioning-tools is distributed in the hope that it will be -+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty -+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License along -+ * with thin-provisioning-tools. If not, see -+ * . -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include "version.h" -+ -+#include -+ -+/*----------------------------------------------------------------*/ -+ -+enum numeric_options { BLOCKSIZE, POOLSIZE, MAXTHINS, NUMERIC, OPT_END}; -+enum return_units { RETURN_BYTES, RETURN_SECTORS }; -+enum numeric_type { NO_NUMBER, NUMBER, NUMBER_SHORT, NUMBER_LONG }; -+typedef unsigned bool; -+enum bool_value { false = 0, true = 1}; -+struct global { -+ char *prg; /* program name */ -+ -+ /* Unit representations in characters, strings and numeric factors. */ -+ struct { -+ char *chars; -+ char **strings; -+ unsigned long long *factors; -+ } unit; -+ -+ /* Command line option properties. */ -+ struct options { -+ unsigned unit_idx; -+ char *s[OPT_END]; -+ unsigned long long n[OPT_END]; -+ } options; -+}; -+ -+static void exit_prg(struct global *g, int ret) -+{ -+ if (g) { -+ unsigned u = OPT_END; -+ -+ while (u--) { -+ if (g->options.s[u]) -+ free (g->options.s[u]); -+ } -+ -+ free(g); -+ } -+ -+ exit(ret); -+} -+ -+static void abort_prg(struct global *g, const char *msg) -+{ -+ fprintf(stderr, "%s - %s\n", g ? g->prg : "fatal", msg); -+ exit_prg(g, 1); -+} -+ -+static int unit_index(struct global *g, char *unit_string) -+{ -+ unsigned len; -+ -+ if (!unit_string) -+ return unit_index(g, "sectors"); -+ -+ len = strlen(unit_string); -+ if (len == 1) { -+ char *o = strchr(g->unit.chars, *unit_string); -+ -+ if (o) -+ return o - g->unit.chars; -+ -+ } else { -+ char **s; -+ -+ for (s = g->unit.strings; *s; s++) -+ if (!strncmp(*s, unit_string, len)) -+ return s - g->unit.strings; -+ } -+ -+ return -1; -+} -+ -+#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) -+static struct global *init_prg(char *prg_path) -+{ -+ unsigned u; -+ static char *unit_chars = "bskKmMgGtTpPeEzZyY"; -+ static char *unit_strings[] = { "bytes", "sectors", -+ "kilobytes", "kibibytes", "megabytes", "mebibytes", -+ "gigabytes", "gibibytes", "terabytes", "tebibytes", -+ "petabytes", "pebibytes", "exabytes", "ebibytes", -+ "zetabytes", "zebibytes", "yottabytes", "yobibytes", NULL }; -+ static unsigned long long unit_factors[ARRAY_SIZE(unit_strings) - 1] = { 1, 512, 1024, 1000 }; -+ struct global *r = malloc(sizeof(*r)); -+ -+ if (!r) -+ abort_prg(r, "failed to allocate global context!"); -+ -+ memset(r, 0, sizeof(*r)); -+ -+ for (u = 4; unit_strings[u]; u += 2) { -+ unit_factors[u] = unit_factors[u-2] * unit_factors[2]; -+ unit_factors[u+1] = unit_factors[u-1] * unit_factors[3]; -+ } -+ -+ r->prg = basename(prg_path); -+ r->unit.chars = unit_chars; -+ r->unit.strings = unit_strings; -+ r->unit.factors = unit_factors; -+ r->options.unit_idx = unit_index(r, NULL); -+ -+ return r; -+} -+ -+static unsigned long long bytes_per_sector(struct global *g) -+{ -+ return g->unit.factors[unit_index(g, "sectors")]; -+} -+ -+static void check_opts(struct global *g) -+{ -+ struct options *o = &g->options; -+ -+ if (!o->n[BLOCKSIZE]) -+ abort_prg(g, "block size required!"); -+ else if (!o->n[POOLSIZE]) -+ abort_prg(g, "pool size required!"); -+ else if (!o->n[MAXTHINS]) -+ abort_prg(g, "max thins required!"); -+ else if (o->n[BLOCKSIZE] & (o->n[BLOCKSIZE] - 1)) -+ abort_prg(g, "block size must be 2^^N"); -+ else if (o->n[POOLSIZE] <= o->n[BLOCKSIZE]) -+ abort_prg(g, "pool size must be larger than block size"); -+} -+ -+static unsigned long long to_bytes(struct global *g, char *sz, enum return_units unit, int *index) -+{ -+ int idx; -+ unsigned long long r; -+ char *us = sz; -+ -+ /* Get pointer to unit identifier. */ -+ us += strspn(sz, "0123456789"); -+ if (*us) { -+ idx = unit_index(g, us); -+ if (idx < 0) -+ abort_prg(g, "Invalid unit specifier!"); -+ -+ *us = 0; -+ *index = idx; -+ } else { -+ idx = unit_index(g, NULL); -+ us = NULL; -+ *index = -1; -+ } -+ -+ r = atoll(sz) * g->unit.factors[idx]; -+ return (!us || unit == RETURN_SECTORS) ? r / bytes_per_sector(g) : r; -+} -+ -+static void printf_aligned(struct global *g, char *a, char *b, char *c, bool units, bool mandatory) -+{ -+ char buf[80]; -+ -+ strcpy(buf, b); -+ if (units) -+ strcat(buf, mandatory ? "{" :"["), strcat(buf, g->unit.chars), strcat(buf, mandatory ? "}" : "]"); -+ -+ printf("\t%-4s%-44s%s\n", a, buf, c); -+} -+ -+static void help(struct global *g) -+{ -+ printf ("Thin Provisioning Metadata Device Size Calculator.\nUsage: %s [options]\n", g->prg); -+ printf_aligned(g, "-b", "--block-size BLOCKSIZE", "Block size of thin provisioned devices.", true, false); -+ printf_aligned(g, "-s", "--pool-size SIZE", "Size of pool device.", true, false); -+ printf_aligned(g, "-m", "--max-thins #MAXTHINS", "Maximum sum of all thin devices and snapshots.", true, false); -+ printf_aligned(g, "-u", "--unit ", "Output unit specifier.", true, true); -+ printf_aligned(g, "-n", "--numeric-only [short|long]", "Output numeric value only (optionally with short/long unit identifier).", false, false); -+ printf_aligned(g, "-h", "--help", "This help.", false, false); -+ printf_aligned(g, "-V", "--version", "Print thin provisioning tools version.", false, false); -+ exit_prg(g, 0); -+} -+ -+static void version(struct global *g) -+{ -+ printf("%s\n", THIN_PROVISIONING_TOOLS_VERSION); -+ exit_prg(g, 1); -+} -+ -+static void check_unit(struct global *g, char *arg) -+{ -+ int idx = unit_index(g, arg); -+ -+ if (idx < 0) -+ abort_prg(g, "output unit specifier invalid!"); -+ -+ g->options.unit_idx = idx; -+} -+ -+static void check_numeric_option(struct global *g, char *arg) -+{ -+ if (g->options.n[NUMERIC] != NO_NUMBER) -+ abort_prg(g, "-n already given!"); -+ -+ g->options.n[NUMERIC] = NUMBER; -+ -+ if (arg) { -+ bool unit_long = !strncmp("long", arg, strlen(arg)); -+ -+ if (!*arg || (strncmp("short", arg, strlen(arg)) && !unit_long)) -+ abort_prg(g, "-n invalid option argument"); -+ -+ g->options.n[NUMERIC] = unit_long ? NUMBER_LONG : NUMBER_SHORT; -+ } -+} -+ -+static void check_size(struct global *g, enum numeric_options o, char *arg) -+{ -+ int idx; -+ bool valid_index = true; -+ -+ if (g->options.n[o]) -+ abort_prg(g, "option already given!"); -+ -+ g->options.n[o] = to_bytes(g, arg, o == MAXTHINS ? RETURN_BYTES : RETURN_SECTORS, &idx); -+ if (idx < 0) { -+ valid_index = false; -+ idx = g->options.unit_idx; -+ } -+ -+ g->options.s[o] = malloc(strlen(arg) + strlen(g->unit.strings[idx]) + 1); -+ if (!g->options.s[o]) -+ abort_prg(g, "failed to allocate string!"); -+ -+ strcpy(g->options.s[o], arg); -+ if (o != MAXTHINS || valid_index) -+ strcat(g->options.s[o], g->unit.strings[idx]); -+ -+} -+ -+static void parse_command_line(struct global *g, int argc, char **argv) -+{ -+ int c; -+ static struct option long_options[] = { -+ {"block-size", required_argument, NULL, 'b' }, -+ {"pool-size", required_argument, NULL, 's' }, -+ {"max-thins", required_argument, NULL, 'm' }, -+ {"unit", required_argument, NULL, 'u' }, -+ {"numeric-only",optional_argument, NULL, 'n' }, -+ {"help", no_argument, NULL, 'h' }, -+ {"version", no_argument, NULL, 'V' }, -+ {NULL, 0, NULL, 0 } -+ }; -+ -+ while ((c = getopt_long(argc, argv, "b:s:m:u:n::hV", long_options, NULL)) != -1) { -+ switch (c) { -+ case 'b': -+ check_size(g, BLOCKSIZE, optarg); -+ break; -+ case 's': -+ check_size(g, POOLSIZE, optarg); -+ break; -+ case 'm': -+ check_size(g, MAXTHINS, optarg); -+ break; -+ case 'u': -+ check_unit(g, optarg); -+ break; -+ case 'n': -+ check_numeric_option(g, optarg); -+ break; -+ case 'h': -+ help(g); /* exits */ -+ case 'V': -+ version(g); /* exits */ -+ default: -+ exit_prg(g, 1); -+ } -+ } -+ -+ check_opts(g); -+} -+ -+static const unsigned mappings_per_block(void) -+{ -+ const struct { -+ const unsigned node; -+ const unsigned node_header; -+ const unsigned entry; -+ } btree_size = { 4096, 64, 16 }; -+ -+ return (btree_size.node - btree_size.node_header) / btree_size.entry; -+} -+ -+static void print_precision(struct global *g, double r, unsigned idx) -+{ -+ bool full = g->options.n[NUMERIC] == NO_NUMBER; -+ double rtrunc = truncl(r); -+ -+ if (full) -+ printf("%s - ", g->prg); -+ -+ if (r == rtrunc) -+ printf("%llu", (unsigned long long) r); -+ else -+ printf(r - rtrunc < 1E-2 ? "%0.2e" : "%0.2f", r); -+ -+ if (full) -+ printf(" %s", g->unit.strings[idx]); -+ else if (g->options.n[NUMERIC] > NUMBER) { -+ if (g->options.n[NUMERIC] == NUMBER_SHORT) -+ printf("%c", g->unit.chars[idx]); -+ else -+ printf("%s", g->unit.strings[idx]); -+ } -+ -+ if (full) -+ printf(" estimated metadata area size for \"--block-size=%s --pool-size=%s --max-thins=%s\"", -+ g->options.s[BLOCKSIZE], g->options.s[POOLSIZE], g->options.s[MAXTHINS]); -+ -+ putchar('\n'); -+} -+ -+static void print_estimated_result(struct global *g) -+{ -+ double r; -+ -+ /* double-fold # of nodes, because they aren't fully populated in average */ -+ r = (1.0 + (2 * g->options.n[POOLSIZE] / g->options.n[BLOCKSIZE] / mappings_per_block() + g->options.n[MAXTHINS])); /* in 4k blocks */ -+ r *= 8 * bytes_per_sector(g); /* in bytes! */ -+ r /= g->unit.factors[g->options.unit_idx]; /* in requested unit */ -+ -+ print_precision(g, r, g->options.unit_idx); -+} -+ -+int main(int argc, char **argv) -+{ -+ struct global *g = init_prg(*argv); -+ -+ parse_command_line(g, argc, argv); -+ print_estimated_result(g); -+ exit_prg(g, 0); -+ return 0; /* Doesn't get here... */ -+} diff --git a/device-mapper-persistent-data-0.2.1-nostrip.patch b/device-mapper-persistent-data-0.2.1-nostrip.patch deleted file mode 100644 index c75a4fa..0000000 --- a/device-mapper-persistent-data-0.2.1-nostrip.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -up thin-provisioning-tools-0.2.1/Makefile.in~ thin-provisioning-tools-0.2.1/Makefile.in ---- thin-provisioning-tools-0.2.1/Makefile.in~ 2013-07-10 18:43:45.000000000 +0300 -+++ thin-provisioning-tools-0.2.1/Makefile.in 2013-07-15 22:32:36.294852451 +0300 -@@ -235,11 +235,11 @@ distclean: clean - - install: $(PROGRAMS) - $(INSTALL_DIR) $(BINDIR) -- $(INSTALL_PROGRAM) -s thin_check $(BINDIR) -- $(INSTALL_PROGRAM) -s thin_dump $(BINDIR) -- $(INSTALL_PROGRAM) -s thin_repair $(BINDIR) -- $(INSTALL_PROGRAM) -s thin_restore $(BINDIR) -- $(INSTALL_PROGRAM) -s thin_rmap $(BINDIR) -+ $(INSTALL_PROGRAM) thin_check $(BINDIR) -+ $(INSTALL_PROGRAM) thin_dump $(BINDIR) -+ $(INSTALL_PROGRAM) thin_repair $(BINDIR) -+ $(INSTALL_PROGRAM) thin_restore $(BINDIR) -+ $(INSTALL_PROGRAM) thin_rmap $(BINDIR) - $(INSTALL_DIR) $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8 diff --git a/device-mapper-persistent-data-0.2.1-support-thin_dump-default-metadata-snapshot.patch b/device-mapper-persistent-data-0.2.1-support-thin_dump-default-metadata-snapshot.patch deleted file mode 100644 index 4f72807..0000000 --- a/device-mapper-persistent-data-0.2.1-support-thin_dump-default-metadata-snapshot.patch +++ /dev/null @@ -1,166 +0,0 @@ -diff --git a/man8/thin_dump.8 b/man8/thin_dump.8 -index e60a6e5..b26cc2c 100644 ---- a/man8/thin_dump.8 -+++ b/man8/thin_dump.8 -@@ -23,9 +23,12 @@ Print output in XML or human readable format. - - .IP "\fB\-r, \-\-repair\fP". - --.IP "\fB\-m, \-\-metadata_snap\fP block#". --Dump metadata snapshot created by device-mapper thin provisioning target at block# -- -+.IP "\fB\-m, \-\-metadata_snap\fP [block#]". -+Dump metadata snapshot created by device-mapper thin provisioning target. -+If block is not provided, access the default metadata snapshot created by -+the thin provisioning device-mapper target, else try the one at block#. -+See the thin provisioning target documentation on how to create or release -+a metadata snapshot. - - .IP "\fB\-h, \-\-help\fP". - Print help and exit. -@@ -44,6 +47,13 @@ to standard output in XML format: - .sp - .B thin_dump /dev/vg/metadata - -+Dumps the thin provisioning metadata snapshot on logical volume /dev/vg/metadata -+to standard output in human readable format (not processable by -+.B thin_restore(8) -+): -+.sp -+.B thin_dump --format human_readable --metadata-snap /dev/vg/metadata -+ - .SH DIAGNOSTICS - .B thin_dump - returns an exit code of 0 for success or 1 for error. -diff --git a/thin-provisioning/metadata.cc b/thin-provisioning/metadata.cc -index 771325a..bef75ba 100644 ---- a/thin-provisioning/metadata.cc -+++ b/thin-provisioning/metadata.cc -@@ -78,6 +78,7 @@ namespace { - << "data block size " << sb.data_block_size_ << endl - << "metadata block size " << sb.metadata_block_size_ << endl - << "metadata nr blocks " << sb.metadata_nr_blocks_ << endl -+ << "metadata snapshot block " << sb.metadata_snap_ << endl - ; - } - } -diff --git a/thin-provisioning/thin_dump.cc b/thin-provisioning/thin_dump.cc -index 029a635..a844038 100644 ---- a/thin-provisioning/thin_dump.cc -+++ b/thin-provisioning/thin_dump.cc -@@ -31,23 +31,37 @@ using namespace persistent_data; - using namespace std; - using namespace thin_provisioning; - -+struct flags { -+ bool find_metadata_snap; -+ bool repair; -+}; -+ - namespace { -- int dump(string const &path, ostream &out, string const &format, bool repair, -+ int dump(string const &path, ostream *out, string const &format, struct flags &flags, - block_address metadata_snap = 0) { - try { -- metadata::ptr md(metadata_snap ? new metadata(path, metadata_snap) : new metadata(path, metadata::OPEN, 0, 0)); -+ metadata::ptr md(new metadata(path, metadata_snap)); - emitter::ptr e; -+ uint64_t metadata_snap_root = md->sb_.metadata_snap_; -+ -+ if (metadata_snap_root) { -+ md.reset(); -+ md = metadata::ptr(new metadata(path, metadata_snap_root)); -+ } else if (flags.find_metadata_snap) { -+ cerr << "no metadata snapshot found!" << endl; -+ exit(1); -+ } - - if (format == "xml") -- e = create_xml_emitter(out); -+ e = create_xml_emitter(*out); - else if (format == "human_readable") -- e = create_human_readable_emitter(out); -+ e = create_human_readable_emitter(*out); - else { - cerr << "unknown format '" << format << "'" << endl; - exit(1); - } - -- metadata_dump(md, e, repair); -+ metadata_dump(md, e, flags.repair); - - } catch (std::exception &e) { - cerr << e.what() << endl; -@@ -63,7 +77,7 @@ namespace { - << " {-h|--help}" << endl - << " {-f|--format} {xml|human_readable}" << endl - << " {-r|--repair}" << endl -- << " {-m|--metadata-snap} block#" << endl -+ << " {-m|--metadata-snap} [block#]" << endl - << " {-o }" << endl - << " {-V|--version}" << endl; - } -@@ -72,16 +86,16 @@ namespace { - int main(int argc, char **argv) - { - int c; -- bool repair = false; - char const *output = NULL; -- const char shortopts[] = "hm:o:f:rV"; -+ const char shortopts[] = "hm::o:f:rV"; -+ char *end_ptr; - string format = "xml"; - block_address metadata_snap = 0; -- char *end_ptr; -+ struct flags flags = { .find_metadata_snap = false, .repair = false }; - - const struct option longopts[] = { - { "help", no_argument, NULL, 'h'}, -- { "metadata-snap", required_argument, NULL, 'm' }, -+ { "metadata-snap", optional_argument, NULL, 'm' }, - { "output", required_argument, NULL, 'o'}, - { "format", required_argument, NULL, 'f' }, - { "repair", no_argument, NULL, 'r'}, -@@ -100,16 +114,24 @@ int main(int argc, char **argv) - break; - - case 'r': -- repair = true; -+ flags.repair = true; -+ break; -+ -+ case 's': -+ flags.find_metadata_snap = true; - break; - - case 'm': -- metadata_snap = strtoull(optarg, &end_ptr, 10); -- if (end_ptr == optarg) { -- cerr << "couldn't parse " << endl; -- usage(cerr, basename(argv[0])); -- return 1; -- } -+ if (optarg) { -+ metadata_snap = strtoull(optarg, &end_ptr, 10); -+ if (end_ptr == optarg) { -+ cerr << "couldn't parse " << endl; -+ usage(cerr, basename(argv[0])); -+ return 1; -+ } -+ } else -+ flags.find_metadata_snap = true; -+ - break; - - case 'o': -@@ -132,9 +154,5 @@ int main(int argc, char **argv) - return 1; - } - -- if (output) { -- ofstream out(output); -- return dump(argv[optind], out, format, repair, metadata_snap); -- } else -- return dump(argv[optind], cout, format, repair, metadata_snap); -+ return dump(argv[optind], output ? new ofstream(output) : &cout, format, flags, metadata_snap); - } diff --git a/device-mapper-persistent-data-0.2.1-thin_dump-support-metadata-snap-block.patch b/device-mapper-persistent-data-0.2.1-thin_dump-support-metadata-snap-block.patch deleted file mode 100644 index b2e9195..0000000 --- a/device-mapper-persistent-data-0.2.1-thin_dump-support-metadata-snap-block.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff --git a/thin-provisioning/metadata.cc b/thin-provisioning/metadata.cc -index c841614..771325a 100644 ---- a/thin-provisioning/metadata.cc -+++ b/thin-provisioning/metadata.cc -@@ -57,15 +57,6 @@ namespace { - return tm; - } - -- superblock -- read_superblock(block_manager<>::ptr bm, block_address location = SUPERBLOCK_LOCATION) { -- superblock sb; -- block_manager<>::read_ref r = bm->read_lock(location, superblock_validator()); -- superblock_disk const *sbd = reinterpret_cast(&r.data()); -- superblock_traits::unpack(*sbd, sb); -- return sb; -- } -- - void - copy_space_maps(space_map::ptr lhs, space_map::ptr rhs) { - for (block_address b = 0; b < rhs->get_nr_blocks(); b++) { -@@ -149,10 +140,10 @@ metadata::metadata(std::string const &dev_path, open_type ot, - } - } - --metadata::metadata(std::string const &dev_path) -+metadata::metadata(std::string const &dev_path, block_address metadata_snap) - { - tm_ = open_tm(open_bm(dev_path, false)); -- sb_ = read_superblock(tm_->get_bm()); -+ sb_ = read_superblock(tm_->get_bm(), metadata_snap); - - // We don't open the metadata sm for a held root - //metadata_sm_ = open_metadata_sm(tm_, &sb_.metadata_space_map_root_); -diff --git a/thin-provisioning/metadata.h b/thin-provisioning/metadata.h -index 250c216..9749acb 100644 ---- a/thin-provisioning/metadata.h -+++ b/thin-provisioning/metadata.h -@@ -62,10 +62,11 @@ namespace thin_provisioning { - // Deprecated: it would be better if we passed in an already - // constructed block_manager. - metadata(std::string const &dev_path, open_type ot, -- sector_t data_block_size = 128, -+ sector_t data_block_size = 128, // Only used if CREATE - block_address nr_data_blocks = 0); // Only used if CREATE - -- metadata(std::string const &dev_path); -+ metadata(std::string const &dev_path, -+ block_address metadata_snap = 0); - - // ... use these instead ... - metadata(block_manager<>::ptr bm, open_type ot, -diff --git a/thin-provisioning/superblock.cc b/thin-provisioning/superblock.cc -index c23fbc1..bf9544b 100644 ---- a/thin-provisioning/superblock.cc -+++ b/thin-provisioning/superblock.cc -@@ -126,17 +126,22 @@ namespace thin_provisioning { - } - } - -- superblock_detail::superblock read_superblock(block_manager<>::ptr bm) -+ superblock_detail::superblock read_superblock(block_manager<>::ptr bm, block_address location) - { - using namespace superblock_detail; - - superblock sb; -- auto r = bm->read_lock(SUPERBLOCK_LOCATION, superblock_validator()); -+ auto r = bm->read_lock(location, superblock_validator()); - superblock_disk const *sbd = reinterpret_cast(&r.data()); - superblock_traits::unpack(*sbd, sb); - return sb; - } - -+ superblock_detail::superblock read_superblock(block_manager<>::ptr bm) -+ { -+ return read_superblock(bm, SUPERBLOCK_LOCATION); -+ } -+ - void - check_superblock(block_manager<>::ptr bm, - superblock_detail::damage_visitor &visitor) { -diff --git a/thin-provisioning/superblock.h b/thin-provisioning/superblock.h -index e993497..a9377b0 100644 ---- a/thin-provisioning/superblock.h -+++ b/thin-provisioning/superblock.h -@@ -123,6 +123,7 @@ namespace thin_provisioning { - persistent_data::block_manager<>::validator::ptr superblock_validator(); - - superblock_detail::superblock read_superblock(persistent_data::block_manager<>::ptr bm); -+ superblock_detail::superblock read_superblock(persistent_data::block_manager<>::ptr bm, persistent_data::block_address location); - void check_superblock(persistent_data::block_manager<>::ptr bm, - superblock_detail::damage_visitor &visitor); - } -diff --git a/thin-provisioning/thin_dump.cc b/thin-provisioning/thin_dump.cc -index a4bcf66..029a635 100644 ---- a/thin-provisioning/thin_dump.cc -+++ b/thin-provisioning/thin_dump.cc -@@ -35,7 +35,7 @@ namespace { - int dump(string const &path, ostream &out, string const &format, bool repair, - block_address metadata_snap = 0) { - try { -- metadata::ptr md(new metadata(path, metadata::OPEN)); -+ metadata::ptr md(metadata_snap ? new metadata(path, metadata_snap) : new metadata(path, metadata::OPEN, 0, 0)); - emitter::ptr e; - - if (format == "xml") -@@ -63,7 +63,7 @@ namespace { - << " {-h|--help}" << endl - << " {-f|--format} {xml|human_readable}" << endl - << " {-r|--repair}" << endl -- << " {-m|--metadata-snap}" << endl -+ << " {-m|--metadata-snap} block#" << endl - << " {-o }" << endl - << " {-V|--version}" << endl; - } diff --git a/device-mapper-persistent-data-0.2.1-update-thin_metadata_size-man-page.patch b/device-mapper-persistent-data-0.2.1-update-thin_metadata_size-man-page.patch deleted file mode 100644 index 67eaf4d..0000000 --- a/device-mapper-persistent-data-0.2.1-update-thin_metadata_size-man-page.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/man8/thin_metadata_size.8 b/man8/thin_metadata_size.8 -index 33b36b3..6b00e73 100644 ---- a/man8/thin_metadata_size.8 -+++ b/man8/thin_metadata_size.8 -@@ -1,6 +1,6 @@ - .TH THIN_METADATA_SIZE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- - .SH NAME --thin_metadata_size \- thin provisioning metadata file/device size calculator. -+thin_metadata_size \- thin provisioning metadata device/file size calculator. - - .SH SYNOPSIS - .B thin_metadata_size -@@ -10,13 +10,15 @@ thin_metadata_size \- thin provisioning metadata file/device size calculator. - .B thin_metadata_size - calculates the size of the thin provisioning metadata based on the block size - of the thin provisioned devices, the size of the thin provisioning pool and --the maximum number of all thin prisioned devices and snapshots. Size/number --option arguments can be followed by unit specifiers in short one character --and long form (eg. -b1m or -b1megabytes). -+the maximum number of all thin prisioned devices and snapshots. -+Because thin provisioning pools are holding widely variable contents, -+this tool is needed to provide sensible initial default size. - - .IP "\fB\-b, \-\-block-size\fP \fIBLOCKSIZE[bskKmMgGtTpPeEzZyY]\fP" - Block size of thin provisioned devices in units of bytes,sectors,kilobytes,kibibytes,... respectively. - Default is in sectors without a block size unit specifier. -+Size/number option arguments can be followed by unit specifiers in short one character -+and long form (eg. -b1m or -b1megabytes). - - .IP "\fB\-s, \-\-pool-size\fP \fIPOOLSIZE[bskKmMgGtTpPeEzZyY]\fP" - Thin provisioning pool size in units of bytes,sectors,kilobytes,kibibytes,... respectively. diff --git a/device-mapper-persistent-data-0.2.2-man-pages-header.patch b/device-mapper-persistent-data-0.2.2-man-pages-header.patch deleted file mode 100644 index 487c2e1..0000000 --- a/device-mapper-persistent-data-0.2.2-man-pages-header.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/man8/thin_check.8 b/man8/thin_check.8 -index 1489078..a8dc81b 100644 ---- a/man8/thin_check.8 -+++ b/man8/thin_check.8 -@@ -1,4 +1,4 @@ --.TH THIN_REPAIR 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.TH THIN_CHECK 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- - .SH NAME - thin_check \- repair thin provisioning metadata on device or file - -diff --git a/man8/thin_rmap.8 b/man8/thin_rmap.8 -index 4d74520..684c86c 100644 ---- a/man8/thin_rmap.8 -+++ b/man8/thin_rmap.8 -@@ -1,4 +1,4 @@ --.TH THIN_DUMP 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.TH THIN_RMAP(g 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- - .SH NAME - thin_rmap \- output reverse map of a thin provisioned region of blocks from metadata device or file - diff --git a/device-mapper-persistent-data-0.2.8-1-missing-installs.patch b/device-mapper-persistent-data-0.2.8-1-missing-installs.patch deleted file mode 100644 index 59e9840..0000000 --- a/device-mapper-persistent-data-0.2.8-1-missing-installs.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- thin-provisioning-tools-0.2.8/Makefile.in.orig 2013-10-18 17:11:34.320772851 +0200 -+++ thin-provisioning-tools-0.2.8/Makefile.in 2013-10-18 17:11:09.938219484 +0200 -@@ -299,6 +299,10 @@ - - install: $(PROGRAMS) - $(INSTALL_DIR) $(BINDIR) -+ $(INSTALL_PROGRAM) cache_check $(BINDIR) -+ $(INSTALL_PROGRAM) cache_dump $(BINDIR) -+ $(INSTALL_PROGRAM) cache_repair $(BINDIR) -+ $(INSTALL_PROGRAM) cache_restore $(BINDIR) - $(INSTALL_PROGRAM) thin_check $(BINDIR) - $(INSTALL_PROGRAM) thin_dump $(BINDIR) - $(INSTALL_PROGRAM) thin_repair $(BINDIR) -@@ -306,6 +310,10 @@ - $(INSTALL_PROGRAM) thin_rmap $(BINDIR) - $(INSTALL_PROGRAM) thin_metadata_size $(BINDIR) - $(INSTALL_DIR) $(MANPATH)/man8 -+ $(INSTALL_DATA) man8/cache_check.8 $(MANPATH)/man8 -+ $(INSTALL_DATA) man8/cache_dump.8 $(MANPATH)/man8 -+ $(INSTALL_DATA) man8/cache_repair.8 $(MANPATH)/man8 -+ $(INSTALL_DATA) man8/cache_restore.8 $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8 - $(INSTALL_DATA) man8/thin_repair.8 $(MANPATH)/man8 diff --git a/device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch b/device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch deleted file mode 100644 index be0aaa1..0000000 --- a/device-mapper-persistent-data-0.2.8-1-missing-man-pages.patch +++ /dev/null @@ -1,270 +0,0 @@ -diff --git a/man8/cache_check.8 b/man8/cache_check.8 -new file mode 100644 -index 0000000..5cc7dff ---- /dev/null -+++ b/man8/cache_check.8 -@@ -0,0 +1,62 @@ -+.TH CACHE_CHECK 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+cache_check \- repair cache metadata on device or file -+ -+.SH SYNOPSIS -+.B cache_check -+.RB [ options ] -+.I {device|file} -+ -+.SH DESCRIPTION -+.B cache_check -+checks cache metadata created by -+the device-mapper cache target on a -+.I device -+or -+.I file. -+ -+.SH OPTIONS -+.IP "\fB\-q, \-\-quiet\fP" -+Suppress output messages, return only exit code. -+ -+.IP "\fB\-h, \-\-help\fP" -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP" -+Output version information and exit. -+ -+.IP "\fB\-\-super\-block\-only\fP" -+Only check the superblock is present. -+ -+.IP "\fB\-\-skip-mappings\fP" -+Skip checking of the block mappings which make up the bulk of the -+metadata. -+ -+.IP "\fB\-\-skip-hints\fP" -+Skip checking of the policy hint values metadata. -+ -+.IP "\fB\-\-skip-discards\fP" -+Skip checking of the discard bits in the metadata. -+ -+.SH EXAMPLE -+Analyses and repairs cache metadata on logical volume -+/dev/vg/metadata: -+.sp -+.B cache_check /dev/vg/metadata -+ -+The device may not be actively used by the target -+when running. -+ -+.SH DIAGNOSTICS -+.B cache_check -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B cache_dump(8) -+.B cache_repair(8) -+.B cache_restore(8) -+ -+.SH AUTHOR -+Joe Thornber -+.br -+Heinz Mauelshagen -diff --git a/man8/cache_dump.8 b/man8/cache_dump.8 -new file mode 100644 -index 0000000..a0c2924 ---- /dev/null -+++ b/man8/cache_dump.8 -@@ -0,0 +1,59 @@ -+.TH CACHE_DUMP 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+cache_dump \- dump cache metadata from device or file to standard output -+ -+.SH SYNOPSIS -+.B cache_dump -+.RB [options] -+.I {device|file} -+ -+.SH DESCRIPTION -+.B cache_dump -+dumps binary cache metadata created by -+the device-mapper cache target on a -+.I device -+or -+.I file -+to standard output for -+analysis or postprocessing in XML format. -+XML formated metadata can be fed into cache_restore (see -+.BR cache_restore(8) ) -+in order to put it back onto a metadata -+.I device -+(to process by the device-mapper target) or -+.I file. -+ -+.IP "\fB\-r, \-\-repair\fP". -+Repair the metadata whilst dumping it. -+ -+.IP "\fB\-h, \-\-help\fP". -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP". -+Output version information and exit. -+ -+.SH EXAMPLES -+Dumps the cache metadata on logical volume /dev/vg/metadata -+to standard output in XML format: -+.sp -+.B cache_dump /dev/vg/metadata -+ -+.SH EXAMPLES -+Dumps the cache metadata on logical volume /dev/vg/metadata -+whilst repairing it to standard output in XML format: -+.sp -+.B cache_dump --repair /dev/vg/metadata -+ -+.SH DIAGNOSTICS -+.B cache_dump -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B cache_check(8) -+.B cache_repair(8) -+.B cache_restore(8) -+ -+.SH AUTHOR -+Joe Thornber -+.br -+Heinz Mauelshagen -diff --git a/man8/cache_repair.8 b/man8/cache_repair.8 -new file mode 100644 -index 0000000..ef04a7f ---- /dev/null -+++ b/man8/cache_repair.8 -@@ -0,0 +1,61 @@ -+.TH CACHE_REPAIR 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+cache_repair \- repair cache binary metadata from device/file to device/file -+ -+.SH SYNOPSIS -+.B cache_repair -+.RB [ options ] -+.RB -i -+.I {device|file} -+.RB -o -+.I {device|file} -+ -+.SH DESCRIPTION -+.B cache_repair -+reads binary cache metadata created by the -+respective device-mapper target from one -+.I device -+or -+.I file -+, repairs it and writes it to another -+.I device -+or -+.I file. -+If written to a metadata -+.I device -+, the metadata can be processed -+by the device-mapper target. -+ -+.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" -+Input file or device with binary metadata. -+ -+.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" -+Output file or device for repaired binary metadata. -+ -+.IP "\fB\-h, \-\-help\fP" -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP" -+Output version information and exit. -+ -+.SH EXAMPLE -+Reads the binary cache metadata from file -+.B metadata -+, repairs it and writes it to logical volume /dev/vg/metadata -+for further processing by the respective device-mapper target: -+.sp -+.B cache_repair -i metadata -o /dev/vg/metadata -+ -+.SH DIAGNOSTICS -+.B cache_repair -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B cache_dump(8) -+.B cache_check(8) -+.B cache_restore(8) -+ -+.SH AUTHOR -+Joe Thornber -+.br -+Heinz Mauelshagen -diff --git a/man8/cache_restore.8 b/man8/cache_restore.8 -new file mode 100644 -index 0000000..5f9fdca ---- /dev/null -+++ b/man8/cache_restore.8 -@@ -0,0 +1,64 @@ -+.TH CACHE_RESTORE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+cache_restore \- restore cache metadata file to device or file -+ -+.SH SYNOPSIS -+.B cache_restore -+.RB [ options ] -+.RB -i -+.I {device|file} -+.RB -o -+.I {device|file} -+ -+.SH DESCRIPTION -+.B cache_restore -+restores cache metadata created by the respective -+device-mapper target dumped into an XML formatted (see -+.BR cache_dump(8) ) -+.I file -+, which optionally can be preprocessed before the restore to another -+.I device -+or -+.I file. -+If restored to a metadata -+.I device -+, the metadata can be processed by the device-mapper target. -+ -+.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" -+Input file or device with metadata. -+ -+.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" -+Output file or device. -+ -+.IP "\fB{\-\-debug-override-metadata-version}\fP \fI\fP" -+ONLY FOR DEBUGGING PURPOSES: -+.br -+override the version stored in the metadata. -+ -+.IP "\fB\-h, \-\-help\fP" -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP" -+Output version information and exit. -+ -+.SH EXAMPLE -+Restores the XML formatted cache metadata on file -+.B metadata -+to logical volume /dev/vg/metadata for further processing by the -+respective device-mapper target: -+.sp -+.B cache_restore -i metadata -o /dev/vg/metadata -+ -+.SH DIAGNOSTICS -+.B cache_restore -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B cache_dump(8) -+.B cache_check(8) -+.B cache_repair(8) -+ -+.SH AUTHOR -+Joe Thornber -+.br -+Heinz Mauelshagen diff --git a/device-mapper-persistent-data-0.4.1-avoid-strip.patch b/device-mapper-persistent-data-0.4.1-avoid-strip.patch deleted file mode 100644 index f7babda..0000000 --- a/device-mapper-persistent-data-0.4.1-avoid-strip.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile.in 2014-11-12 18:46:30.282251378 +0100 -+++ b/Makefile.in 2014-11-12 18:46:56.108608255 +0100 -@@ -108,7 +108,7 @@ - vpath %.cc $(TOP_DIR) - - INSTALL_DIR = $(INSTALL) -m 755 -d --INSTALL_PROGRAM = $(INSTALL) -m 755 -s -+INSTALL_PROGRAM = $(INSTALL) -m 755 - INSTALL_DATA = $(INSTALL) -p -m 644 - - ifeq ("@TESTING@", "yes") diff --git a/device-mapper-persistent-data-0.4.1-bz1085620.patch b/device-mapper-persistent-data-0.4.1-bz1085620.patch deleted file mode 100644 index 6fa4163..0000000 --- a/device-mapper-persistent-data-0.4.1-bz1085620.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- thin-provisioning-tools-0.4.1/man8/thin_check.8.orig 2014-10-28 14:19:02.800420873 +0100 -+++ thin-provisioning-tools-0.4.1/man8/thin_check.8 2014-10-28 14:19:47.335924554 +0100 -@@ -25,6 +25,12 @@ - .IP "\fB\-V, \-\-version\fP" - Output version information and exit. - -+.IP "\fB\-\-clear\-needs\-check\-flag\fP" -+Clear the needs-check-flag in case the check of the thin pool metadata succeeded. -+If the metadata check failed, the flag is not cleared and a thin_repair run is -+needed to fix any issues. -+After thin_repair succeeded, you may run thin_check again. -+ - .IP "\fB\-\-super\-block\-only\fP" - Only check the superblock is present. - diff --git a/device-mapper-persistent-data-0.4.1-missing-man-pages.patch b/device-mapper-persistent-data-0.4.1-missing-man-pages.patch deleted file mode 100644 index ac2e687..0000000 --- a/device-mapper-persistent-data-0.4.1-missing-man-pages.patch +++ /dev/null @@ -1,116 +0,0 @@ ---- thin-provisioning-tools-0.4.1/man8/era_restore.8.orig 2014-10-28 14:24:43.356272471 +0100 -+++ thin-provisioning-tools-0.4.1/man8/era_restore.8 2014-10-28 14:28:56.358133852 +0100 -@@ -0,0 +1,63 @@ -+.TH ERA_RESTORE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+era_restore \- restore era metadata file to device or file -+ -+.SH SYNOPSIS -+.B era_restore -+.RB [ options ] -+.RB -i -+.I {device|file} -+.RB -o -+.I {device|file} -+ -+.SH DESCRIPTION -+.B era_restore -+restores binary era metadata created by the -+respective device-mapper target dumped into an XML formatted (see -+.BR era_dump(8) ) -+.I file -+, which optionally can be preprocessed before the restore to another -+.I device -+or -+.I file. -+If restored to a metadata -+.I device -+, the metadata can be processed by the device-mapper target. -+ -+.IP "\fB\-q, \-\-quiet\fP" -+Suppress output messages, return only exit code. -+ -+.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" -+Input file or device with metadata. -+ -+.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" -+Output file or device. -+ -+.IP "\fB\-h, \-\-help\fP" -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP" -+Output version information and exit. -+ -+.SH EXAMPLE -+Restores the XML formatted era metadata on file -+.B metadata -+to logical volume /dev/vg/metadata for further processing by the -+respective device-mapper target: -+.sp -+.B era_restore -i metadata -o /dev/vg/metadata -+ -+.SH DIAGNOSTICS -+.B era_restore -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B era_check(8) -+.B era_dump(8) -+.B era_invaidate(8) -+.B era_restore(8) -+ -+.SH AUTHOR -+Joe Thornber -+.br -+Heinz Mauelshagen ---- thin-provisioning-tools-0.4.1/man8/cache_metadata_size.8.orig 2014-10-28 14:31:49.116087709 +0100 -+++ thin-provisioning-tools-0.4.1/man8/cache_metadata_size.8 2014-10-28 14:50:29.337238755 +0100 -@@ -0,0 +1,47 @@ -+.TH CACHE_METADATA_SIZE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+cache_metadata_size \- cache metadata device/file size calculator. -+ -+.SH SYNOPSIS -+.B cache_metadata_size -+.RB [ options ] -+ -+.SH DESCRIPTION -+.B cache_metadata_size -+calculates the size of the cache metadata based on the block size -+of the cache device and the cache block size. -+All relates to the size of the fast device (eg, SSD), rather -+than the whole cached (i.e. origin) device. -+ -+.IP "\fB\\-\-block\-size \fP -+Block size of cache in units of sectors. -+ -+.IP "\fB\\-\-device\-size \fP -+Device size of the cache device in units of sectors. -+ -+.IP "\fB\\-\-nr\-blocks \fP -+Capacity of the cache in number of blocks. -+ -+.IP "\fB\-h, \-\-help\fP" -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP" -+Output version information and exit. -+ -+.SH EXAMPLES -+Calculates the cache metadata device size for block size 256 sectors.and device size of 2GiB -+.sp -+.B cache_metadata_size --block-size 256 --device-size $((2*1024*1024)) -+ -+.SH DIAGNOSTICS -+.B cache_metadata_size -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B cache_check(8) -+.B cache_dump(8) -+.B cache_repair(8) -+.B cache_restore(8) -+ -+.SH AUTHOR -+Heinz Mauelshagen diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 32ec750..98e070e 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -1,20 +1,21 @@ # -# Copyright (C) 2011-2014 Red Hat, Inc +# Copyright (C) 2011-2015 Red Hat, Inc # Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.4.1 -Release: 4%{?dist} +Version: 0.4.2 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools -Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.bz2 +Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.gz # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz +Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch +Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch +Patch2: device-mapper-persistent-avoid-strip.patch + BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat -Patch0: device-mapper-persistent-data-0.4.1-bz1085620.patch -Patch1: device-mapper-persistent-data-0.4.1-missing-man-pages.patch -Patch2: device-mapper-persistent-data-0.4.1-avoid-strip.patch %description thin-provisioning-tools contains check,dump,restore,repair,rmap @@ -26,9 +27,9 @@ snapshot eras %prep %setup -q -n thin-provisioning-tools-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%patch0 -p1 -b .clear_needs_check_flag +%patch1 -p1 -b .man_pages +%patch2 -p1 -b .avoid_strip echo %{version}-%{release} > VERSION %build @@ -51,11 +52,13 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_mandir}/man8/era_dump.8.gz %{_mandir}/man8/era_invalidate.8.gz %{_mandir}/man8/thin_check.8.gz +%{_mandir}/man8/thin_delta.8.gz %{_mandir}/man8/thin_dump.8.gz %{_mandir}/man8/thin_metadata_size.8.gz %{_mandir}/man8/thin_restore.8.gz %{_mandir}/man8/thin_repair.8.gz %{_mandir}/man8/thin_rmap.8.gz +%{_mandir}/man8/thin_trim.8.gz %{_sbindir}/pdata_tools %{_sbindir}/cache_check %{_sbindir}/cache_dump @@ -67,23 +70,29 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/era_restore %{_sbindir}/era_invalidate %{_sbindir}/thin_check +%{_sbindir}/thin_delta %{_sbindir}/thin_dump %{_sbindir}/thin_metadata_size %{_sbindir}/thin_restore %{_sbindir}/thin_repair %{_sbindir}/thin_rmap +%{_sbindir}/thin_trim %changelog +* Mon Jun 08 2015 Peter Rajnoha - 0.4.2-1 +- New thin_delta and thin_trim commands. +- Update to latest upstream release. + * Sat May 02 2015 Kalev Lember - 0.4.1-4 - Rebuilt for GCC 5 C++11 ABI change * Mon Jan 26 2015 Petr Machata - 0.4.1-3 - Rebuild for boost 1.57.0 -* Tue Oct 29 2014 Heinz Mauelshagen - 0.4.1-2 +* Wed Oct 29 2014 Heinz Mauelshagen - 0.4.1-2 - Resolves: bz#1159466 -* Tue Oct 29 2014 Heinz Mauelshagen - 0.4.1-1 +* Wed Oct 29 2014 Heinz Mauelshagen - 0.4.1-1 - New upstream version - Manual header additions/fixes @@ -124,7 +133,7 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install * Thu Jul 25 2013 Heinz Mauelshagen - 0.2.1-5 - enhance manual pages and fix typos -* Fri Jul 18 2013 Heinz Mauelshagen - 0.2.1-4 +* Thu Jul 18 2013 Heinz Mauelshagen - 0.2.1-4 - Update thin_metadata_size manual page - thin_dump: support dumping default metadata snapshot diff --git a/sources b/sources index e3c7ae7..5140f5a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a1d5ac4bd865360dff6ac20ec00573cc thin-provisioning-tools-v0.4.1.tar.bz2 +08f28c58471128b04745f8a080b12d03 thin-provisioning-tools-v0.4.2.tar.gz From 5f5f0e1228523ee9bb0c5a071fd185553f74ae66 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 10 Jun 2015 13:32:28 +0200 Subject: [PATCH 028/135] New upstream release. --- device-mapper-persistent-avoid-strip.patch | 11 ++ ...re-and-cache_metadata_size-man-pages.patch | 116 ++++++++++++++++++ ...data-document-clear-needs-check-flag.patch | 15 +++ 3 files changed, 142 insertions(+) create mode 100644 device-mapper-persistent-avoid-strip.patch create mode 100644 device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch create mode 100644 device-mapper-persistent-data-document-clear-needs-check-flag.patch diff --git a/device-mapper-persistent-avoid-strip.patch b/device-mapper-persistent-avoid-strip.patch new file mode 100644 index 0000000..f7babda --- /dev/null +++ b/device-mapper-persistent-avoid-strip.patch @@ -0,0 +1,11 @@ +--- a/Makefile.in 2014-11-12 18:46:30.282251378 +0100 ++++ b/Makefile.in 2014-11-12 18:46:56.108608255 +0100 +@@ -108,7 +108,7 @@ + vpath %.cc $(TOP_DIR) + + INSTALL_DIR = $(INSTALL) -m 755 -d +-INSTALL_PROGRAM = $(INSTALL) -m 755 -s ++INSTALL_PROGRAM = $(INSTALL) -m 755 + INSTALL_DATA = $(INSTALL) -p -m 644 + + ifeq ("@TESTING@", "yes") diff --git a/device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch b/device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch new file mode 100644 index 0000000..ac2e687 --- /dev/null +++ b/device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch @@ -0,0 +1,116 @@ +--- thin-provisioning-tools-0.4.1/man8/era_restore.8.orig 2014-10-28 14:24:43.356272471 +0100 ++++ thin-provisioning-tools-0.4.1/man8/era_restore.8 2014-10-28 14:28:56.358133852 +0100 +@@ -0,0 +1,63 @@ ++.TH ERA_RESTORE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++era_restore \- restore era metadata file to device or file ++ ++.SH SYNOPSIS ++.B era_restore ++.RB [ options ] ++.RB -i ++.I {device|file} ++.RB -o ++.I {device|file} ++ ++.SH DESCRIPTION ++.B era_restore ++restores binary era metadata created by the ++respective device-mapper target dumped into an XML formatted (see ++.BR era_dump(8) ) ++.I file ++, which optionally can be preprocessed before the restore to another ++.I device ++or ++.I file. ++If restored to a metadata ++.I device ++, the metadata can be processed by the device-mapper target. ++ ++.IP "\fB\-q, \-\-quiet\fP" ++Suppress output messages, return only exit code. ++ ++.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" ++Input file or device with metadata. ++ ++.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" ++Output file or device. ++ ++.IP "\fB\-h, \-\-help\fP" ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP" ++Output version information and exit. ++ ++.SH EXAMPLE ++Restores the XML formatted era metadata on file ++.B metadata ++to logical volume /dev/vg/metadata for further processing by the ++respective device-mapper target: ++.sp ++.B era_restore -i metadata -o /dev/vg/metadata ++ ++.SH DIAGNOSTICS ++.B era_restore ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B era_check(8) ++.B era_dump(8) ++.B era_invaidate(8) ++.B era_restore(8) ++ ++.SH AUTHOR ++Joe Thornber ++.br ++Heinz Mauelshagen +--- thin-provisioning-tools-0.4.1/man8/cache_metadata_size.8.orig 2014-10-28 14:31:49.116087709 +0100 ++++ thin-provisioning-tools-0.4.1/man8/cache_metadata_size.8 2014-10-28 14:50:29.337238755 +0100 +@@ -0,0 +1,47 @@ ++.TH CACHE_METADATA_SIZE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- ++.SH NAME ++cache_metadata_size \- cache metadata device/file size calculator. ++ ++.SH SYNOPSIS ++.B cache_metadata_size ++.RB [ options ] ++ ++.SH DESCRIPTION ++.B cache_metadata_size ++calculates the size of the cache metadata based on the block size ++of the cache device and the cache block size. ++All relates to the size of the fast device (eg, SSD), rather ++than the whole cached (i.e. origin) device. ++ ++.IP "\fB\\-\-block\-size \fP ++Block size of cache in units of sectors. ++ ++.IP "\fB\\-\-device\-size \fP ++Device size of the cache device in units of sectors. ++ ++.IP "\fB\\-\-nr\-blocks \fP ++Capacity of the cache in number of blocks. ++ ++.IP "\fB\-h, \-\-help\fP" ++Print help and exit. ++ ++.IP "\fB\-V, \-\-version\fP" ++Output version information and exit. ++ ++.SH EXAMPLES ++Calculates the cache metadata device size for block size 256 sectors.and device size of 2GiB ++.sp ++.B cache_metadata_size --block-size 256 --device-size $((2*1024*1024)) ++ ++.SH DIAGNOSTICS ++.B cache_metadata_size ++returns an exit code of 0 for success or 1 for error. ++ ++.SH SEE ALSO ++.B cache_check(8) ++.B cache_dump(8) ++.B cache_repair(8) ++.B cache_restore(8) ++ ++.SH AUTHOR ++Heinz Mauelshagen diff --git a/device-mapper-persistent-data-document-clear-needs-check-flag.patch b/device-mapper-persistent-data-document-clear-needs-check-flag.patch new file mode 100644 index 0000000..6fa4163 --- /dev/null +++ b/device-mapper-persistent-data-document-clear-needs-check-flag.patch @@ -0,0 +1,15 @@ +--- thin-provisioning-tools-0.4.1/man8/thin_check.8.orig 2014-10-28 14:19:02.800420873 +0100 ++++ thin-provisioning-tools-0.4.1/man8/thin_check.8 2014-10-28 14:19:47.335924554 +0100 +@@ -25,6 +25,12 @@ + .IP "\fB\-V, \-\-version\fP" + Output version information and exit. + ++.IP "\fB\-\-clear\-needs\-check\-flag\fP" ++Clear the needs-check-flag in case the check of the thin pool metadata succeeded. ++If the metadata check failed, the flag is not cleared and a thin_repair run is ++needed to fix any issues. ++After thin_repair succeeded, you may run thin_check again. ++ + .IP "\fB\-\-super\-block\-only\fP" + Only check the superblock is present. + From 1812d33a51762106a5f3d05ca718c9f6409a126a Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 17 Jun 2015 03:58:15 +0000 Subject: [PATCH 029/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 98e070e..8ef93d4 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.4.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -79,6 +79,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Wed Jun 17 2015 Fedora Release Engineering - 0.4.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Mon Jun 08 2015 Peter Rajnoha - 0.4.2-1 - New thin_delta and thin_trim commands. - Update to latest upstream release. From cc79a1927d9a4351af88ded260d69a538bafd2cc Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Mon, 22 Jun 2015 14:37:58 +0200 Subject: [PATCH 030/135] New upstream release. --- .gitignore | 1 + device-mapper-persistent-data.spec | 9 +++++++-- sources | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6a08d70..2e80777 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /thin-provisioning-tools-v0.2.8.tar.bz2 /thin-provisioning-tools-v0.3.0.tar.bz2 /thin-provisioning-tools-v0.3.2.tar.bz2 +/thin-provisioning-tools-0.5.0.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 8ef93d4..1b9566e 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,8 +3,8 @@ # Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.4.2 -Release: 2%{?dist} +Version: 0.5.0 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -79,6 +79,11 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Mon Jun 22 2015 Peter Rajnoha - 0.5.0-1 +- Add space map checking for thin_check. +- Add --clear-needs-check option for cache_check. +- Update to latest upstream release. + * Wed Jun 17 2015 Fedora Release Engineering - 0.4.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/sources b/sources index 5140f5a..747e892 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -08f28c58471128b04745f8a080b12d03 thin-provisioning-tools-v0.4.2.tar.gz +e95c00f8c28aa3636a1fa940b19d257d thin-provisioning-tools-0.5.0.tar.gz From 66641de0f977a1eeadb9b2875410a9873d49245f Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Mon, 22 Jun 2015 14:39:17 +0200 Subject: [PATCH 031/135] Fix link to source. --- device-mapper-persistent-data.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 1b9566e..7c5051f 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools -Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-v%{version}.tar.gz +Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%{version}.tar.gz # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch From 86a94835f6993c2f97c1e565cffae908042e2f3e Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 25 Jun 2015 13:42:53 +0200 Subject: [PATCH 032/135] Update to version 0.5.1 containing a bug fix. --- .gitignore | 1 + device-mapper-persistent-data.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2e80777..2726836 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /thin-provisioning-tools-v0.3.0.tar.bz2 /thin-provisioning-tools-v0.3.2.tar.bz2 /thin-provisioning-tools-0.5.0.tar.gz +/thin-provisioning-tools-0.5.1.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 7c5051f..00880e9 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,7 +3,7 @@ # Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.5.0 +Version: 0.5.1 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -79,6 +79,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Thu Jun 25 2015 Peter Rajnoha - 0.5.1-1 +- Fix crash if tools are given a very large metadata device to restore to. + * Mon Jun 22 2015 Peter Rajnoha - 0.5.0-1 - Add space map checking for thin_check. - Add --clear-needs-check option for cache_check. diff --git a/sources b/sources index 747e892..017ff34 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e95c00f8c28aa3636a1fa940b19d257d thin-provisioning-tools-0.5.0.tar.gz +66188681d3e0a3a023f70ae4a94d2df5 thin-provisioning-tools-0.5.1.tar.gz From 20c2ae43f9a0a9de1ab68cf2452c77f115694fe8 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Fri, 3 Jul 2015 14:19:48 +0200 Subject: [PATCH 033/135] Update to version 0.5.2 containing a bug fix. --- .gitignore | 1 + device-mapper-persistent-data.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2726836..656fcfe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /thin-provisioning-tools-v0.3.2.tar.bz2 /thin-provisioning-tools-0.5.0.tar.gz /thin-provisioning-tools-0.5.1.tar.gz +/thin-provisioning-tools-0.5.2.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 00880e9..2bf1ba8 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,7 +3,7 @@ # Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.5.1 +Version: 0.5.2 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -79,6 +79,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Fri Jul 03 2015 Peter Rajnoha - 0.5.2-1 +- Fix bug in damage reporting in thin_dump and thin_check. + * Thu Jun 25 2015 Peter Rajnoha - 0.5.1-1 - Fix crash if tools are given a very large metadata device to restore to. diff --git a/sources b/sources index 017ff34..9dc96f2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -66188681d3e0a3a023f70ae4a94d2df5 thin-provisioning-tools-0.5.1.tar.gz +bfa3be1b6d7543270610f6a3bf74da72 thin-provisioning-tools-0.5.2.tar.gz From fc57c16ec977dc82031289696cb8f646df706c9e Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Tue, 7 Jul 2015 16:01:32 +0200 Subject: [PATCH 034/135] Update to version 0.5.3. --- .gitignore | 1 + device-mapper-persistent-data.spec | 6 +++++- sources | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 656fcfe..e3335b4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /thin-provisioning-tools-0.5.0.tar.gz /thin-provisioning-tools-0.5.1.tar.gz /thin-provisioning-tools-0.5.2.tar.gz +/thin-provisioning-tools-0.5.3.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 2bf1ba8..ed869b5 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,7 +3,7 @@ # Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.5.2 +Version: 0.5.3 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -79,6 +79,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Fri Jul 03 2015 Peter Rajnoha - 0.5.3-1 +- Tools now open the metadata device in O_EXCL mode to stop + running the tools on active metadata. + * Fri Jul 03 2015 Peter Rajnoha - 0.5.2-1 - Fix bug in damage reporting in thin_dump and thin_check. diff --git a/sources b/sources index 9dc96f2..181f6a6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bfa3be1b6d7543270610f6a3bf74da72 thin-provisioning-tools-0.5.2.tar.gz +b5e371c81b85366cfaa06dd21cd436cd thin-provisioning-tools-0.5.3.tar.gz From 854d454495ac600945cfb7480371ad1f7a1a8b07 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Fri, 17 Jul 2015 15:43:18 +0200 Subject: [PATCH 035/135] Update to version 0.5.4 containing a bug fix. --- .gitignore | 1 + ...-data-fix-cache-check-exclusive-open.patch | 36 +++++++++++++++++++ device-mapper-persistent-data.spec | 9 ++++- sources | 2 +- 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 device-mapper-persistent-data-fix-cache-check-exclusive-open.patch diff --git a/.gitignore b/.gitignore index e3335b4..842b6ef 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /thin-provisioning-tools-0.5.1.tar.gz /thin-provisioning-tools-0.5.2.tar.gz /thin-provisioning-tools-0.5.3.tar.gz +/thin-provisioning-tools-0.5.4.tar.gz diff --git a/device-mapper-persistent-data-fix-cache-check-exclusive-open.patch b/device-mapper-persistent-data-fix-cache-check-exclusive-open.patch new file mode 100644 index 0000000..028eb8c --- /dev/null +++ b/device-mapper-persistent-data-fix-cache-check-exclusive-open.patch @@ -0,0 +1,36 @@ + VERSION | 2 +- + caching/cache_check.cc | 7 ++++--- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/VERSION b/VERSION +index cb0c939..7d85683 100644 +--- a/VERSION ++++ b/VERSION +@@ -1 +1 @@ +-0.5.2 ++0.5.4 +diff --git a/caching/cache_check.cc b/caching/cache_check.cc +index 005159e..9bd34be 100644 +--- a/caching/cache_check.cc ++++ b/caching/cache_check.cc +@@ -220,7 +220,9 @@ namespace { + write_superblock(bm, sb); + } + +- error_state metadata_check(block_manager<>::ptr bm, flags const &fs) { ++ error_state metadata_check(string const &path, flags const &fs) { ++ block_manager<>::ptr bm = open_bm(path, block_manager<>::READ_ONLY); ++ + nested_output out(cerr, 2); + if (fs.quiet_) + out.disable(); +@@ -295,8 +297,7 @@ namespace { + throw runtime_error(msg.str()); + } + +- block_manager<>::ptr bm = open_bm(path, block_manager<>::READ_ONLY); +- err = metadata_check(bm, fs); ++ err = metadata_check(path, fs); + + bool success = false; + diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index ed869b5..742cd6d 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,7 +3,7 @@ # Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.5.3 +Version: 0.5.4 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -13,6 +13,7 @@ Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provi Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch Patch2: device-mapper-persistent-avoid-strip.patch +Patch3: device-mapper-persistent-data-fix-cache-check-exclusive-open.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat @@ -30,6 +31,7 @@ snapshot eras %patch0 -p1 -b .clear_needs_check_flag %patch1 -p1 -b .man_pages %patch2 -p1 -b .avoid_strip +%patch3 -p1 -b .cache_check_excl echo %{version}-%{release} > VERSION %build @@ -79,6 +81,11 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Fri Jul 17 2015 Peter Rajnoha - 0.5.4-1 +- Fix cache_check with --clear-needs-check-flag option to + make sure metadata device is not open already by the tool + when open with O_EXCL mode is requested. + * Fri Jul 03 2015 Peter Rajnoha - 0.5.3-1 - Tools now open the metadata device in O_EXCL mode to stop running the tools on active metadata. diff --git a/sources b/sources index 181f6a6..0749834 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b5e371c81b85366cfaa06dd21cd436cd thin-provisioning-tools-0.5.3.tar.gz +4feeedca8c9e16fd4830156d8511a601 thin-provisioning-tools-0.5.4.tar.gz From 3fb2f8386a7426021ff9d311d82278349d3fe9c8 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Wed, 22 Jul 2015 18:22:02 +0200 Subject: [PATCH 036/135] rebuild for Boost 1.58 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 742cd6d..8bbc504 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.5.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -81,6 +81,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Wed Jul 22 2015 David Tardon - 0.5.4-2 +- rebuild for Boost 1.58 + * Fri Jul 17 2015 Peter Rajnoha - 0.5.4-1 - Fix cache_check with --clear-needs-check-flag option to make sure metadata device is not open already by the tool From 4653be1d64e6246ab2dc4da403b920a0de144b31 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 29 Jul 2015 12:09:12 -0500 Subject: [PATCH 037/135] - Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 8bbc504..e80ff1c 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.5.4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -81,6 +81,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Wed Jul 29 2015 Fedora Release Engineering - 0.5.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 + * Wed Jul 22 2015 David Tardon - 0.5.4-2 - rebuild for Boost 1.58 From 7b3b0cf9d96014d3a099a09bf532c807407d43f2 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 13 Aug 2015 16:19:38 +0200 Subject: [PATCH 038/135] New upstream release v0.5.5. --- .gitignore | 1 + device-mapper-persistent-data.spec | 11 +++++++---- sources | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 842b6ef..a966de3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /thin-provisioning-tools-0.5.2.tar.gz /thin-provisioning-tools-0.5.3.tar.gz /thin-provisioning-tools-0.5.4.tar.gz +/thin-provisioning-tools-0.5.5.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index e80ff1c..ea9a4c8 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,8 +3,8 @@ # Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.5.4 -Release: 3%{?dist} +Version: 0.5.5 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -13,7 +13,6 @@ Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provi Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch Patch2: device-mapper-persistent-avoid-strip.patch -Patch3: device-mapper-persistent-data-fix-cache-check-exclusive-open.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat @@ -31,7 +30,6 @@ snapshot eras %patch0 -p1 -b .clear_needs_check_flag %patch1 -p1 -b .man_pages %patch2 -p1 -b .avoid_strip -%patch3 -p1 -b .cache_check_excl echo %{version}-%{release} > VERSION %build @@ -81,6 +79,11 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Thu Aug 13 2015 Peter Rajnoha - 0.5.5-1 +- Support thin_delta's --metadata_snap option without specifying snap location. +- Update man pages to make it clearer that tools shoulnd't be run on live metadata. +- Fix bugs in the metadata reference counting for thin_check. + * Wed Jul 29 2015 Fedora Release Engineering - 0.5.4-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 diff --git a/sources b/sources index 0749834..8e77b3d 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ 4feeedca8c9e16fd4830156d8511a601 thin-provisioning-tools-0.5.4.tar.gz +6aa3d8294e66d967ac7c3d524e9835d2 thin-provisioning-tools-0.5.5.tar.gz From 70a39d44f8b63dba1463ac8e22589f43231e624a Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 27 Aug 2015 21:20:04 +0100 Subject: [PATCH 039/135] Rebuilt for Boost 1.59 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index ea9a4c8..a3cbbda 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.5.5 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -79,6 +79,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Thu Aug 27 2015 Jonathan Wakely - 0.5.5-2 +- Rebuilt for Boost 1.59 + * Thu Aug 13 2015 Peter Rajnoha - 0.5.5-1 - Support thin_delta's --metadata_snap option without specifying snap location. - Update man pages to make it clearer that tools shoulnd't be run on live metadata. From ac257c3d7b2c34baca8a289dce974603709663ff Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 15 Jan 2016 04:20:45 +0000 Subject: [PATCH 040/135] Rebuilt for Boost 1.60 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index a3cbbda..9a0bbd8 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.5.5 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -79,6 +79,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Fri Jan 15 2016 Jonathan Wakely - 0.5.5-3 +- Rebuilt for Boost 1.60 + * Thu Aug 27 2015 Jonathan Wakely - 0.5.5-2 - Rebuilt for Boost 1.59 From 44d473425492c4fc75a05fb80d967c9a466d2730 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 20 Jan 2016 13:54:28 +0100 Subject: [PATCH 041/135] New upstream release v0.5.6. --- .gitignore | 1 + device-mapper-persistent-data.spec | 8 ++++++-- sources | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a966de3..3fba183 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /thin-provisioning-tools-0.5.3.tar.gz /thin-provisioning-tools-0.5.4.tar.gz /thin-provisioning-tools-0.5.5.tar.gz +/thin-provisioning-tools-0.5.6.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 9a0bbd8..bc98af2 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,8 +3,8 @@ # Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.5.5 -Release: 3%{?dist} +Version: 0.5.6 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -79,6 +79,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Wed Jan 20 2016 Peter Rajnoha - 0.5.6-1 +- era_invalidate may be run on live metadata if the --metadata-snap + option is given. + * Fri Jan 15 2016 Jonathan Wakely - 0.5.5-3 - Rebuilt for Boost 1.60 diff --git a/sources b/sources index 8e77b3d..c78e0fb 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -4feeedca8c9e16fd4830156d8511a601 thin-provisioning-tools-0.5.4.tar.gz -6aa3d8294e66d967ac7c3d524e9835d2 thin-provisioning-tools-0.5.5.tar.gz +292a9a15e0f494dd752947342eb7f5cd thin-provisioning-tools-0.5.6.tar.gz From bcbdabcaa43441569cab6e44d2c4833963c720c5 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 20 Jan 2016 17:00:10 +0100 Subject: [PATCH 042/135] New upstream release v0.6.0. --- .gitignore | 1 + device-mapper-persistent-avoid-strip.patch | 11 ----------- device-mapper-persistent-data.spec | 7 ++++--- sources | 2 +- 4 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 device-mapper-persistent-avoid-strip.patch diff --git a/.gitignore b/.gitignore index 3fba183..b5effe2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /thin-provisioning-tools-0.5.4.tar.gz /thin-provisioning-tools-0.5.5.tar.gz /thin-provisioning-tools-0.5.6.tar.gz +/thin-provisioning-tools-0.6.0.tar.gz diff --git a/device-mapper-persistent-avoid-strip.patch b/device-mapper-persistent-avoid-strip.patch deleted file mode 100644 index f7babda..0000000 --- a/device-mapper-persistent-avoid-strip.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile.in 2014-11-12 18:46:30.282251378 +0100 -+++ b/Makefile.in 2014-11-12 18:46:56.108608255 +0100 -@@ -108,7 +108,7 @@ - vpath %.cc $(TOP_DIR) - - INSTALL_DIR = $(INSTALL) -m 755 -d --INSTALL_PROGRAM = $(INSTALL) -m 755 -s -+INSTALL_PROGRAM = $(INSTALL) -m 755 - INSTALL_DATA = $(INSTALL) -p -m 644 - - ifeq ("@TESTING@", "yes") diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index bc98af2..b142bbc 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,7 +3,7 @@ # Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.5.6 +Version: 0.6.0 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -12,7 +12,6 @@ Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provi # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch -Patch2: device-mapper-persistent-avoid-strip.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat @@ -29,7 +28,6 @@ snapshot eras %setup -q -n thin-provisioning-tools-%{version} %patch0 -p1 -b .clear_needs_check_flag %patch1 -p1 -b .man_pages -%patch2 -p1 -b .avoid_strip echo %{version}-%{release} > VERSION %build @@ -79,6 +77,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Wed Jan 20 2016 Peter Rajnoha - 0.6.0-1 +- New thin_ls command. + * Wed Jan 20 2016 Peter Rajnoha - 0.5.6-1 - era_invalidate may be run on live metadata if the --metadata-snap option is given. diff --git a/sources b/sources index c78e0fb..f5e8450 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -292a9a15e0f494dd752947342eb7f5cd thin-provisioning-tools-0.5.6.tar.gz +0005f9c569a180042bf15bd2b0728f18 thin-provisioning-tools-0.6.0.tar.gz From 8579281e34b5f4cbc8db10b0e3d3700fccf4bb63 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 20 Jan 2016 17:35:15 +0100 Subject: [PATCH 043/135] New upstream release v0.6.0. --- ...e-mapper-persistent-data-avoid-strip.patch | 11 ++++++ ...-data-fix-cache-check-exclusive-open.patch | 36 ------------------- device-mapper-persistent-data.spec | 4 +++ 3 files changed, 15 insertions(+), 36 deletions(-) create mode 100644 device-mapper-persistent-data-avoid-strip.patch delete mode 100644 device-mapper-persistent-data-fix-cache-check-exclusive-open.patch diff --git a/device-mapper-persistent-data-avoid-strip.patch b/device-mapper-persistent-data-avoid-strip.patch new file mode 100644 index 0000000..3b7379a --- /dev/null +++ b/device-mapper-persistent-data-avoid-strip.patch @@ -0,0 +1,11 @@ +diff -purN thin-provisioning-tools-0.6.0.orig/Makefile.in thin-provisioning-tools-0.6.0.new/Makefile.in +--- thin-provisioning-tools-0.6.0.orig/Makefile.in 2016-01-20 16:43:21.000000000 +0100 ++++ thin-provisioning-tools-0.6.0.new/Makefile.in 2016-01-20 17:26:11.943664295 +0100 +@@ -174,7 +174,6 @@ distclean: clean + install: bin/pdata_tools + $(INSTALL_DIR) $(BINDIR) + $(INSTALL_PROGRAM) bin/pdata_tools $(BINDIR) +- $(STRIP) $(BINDIR)/pdata_tools + ln -s -f pdata_tools $(BINDIR)/cache_check + ln -s -f pdata_tools $(BINDIR)/cache_dump + ln -s -f pdata_tools $(BINDIR)/cache_metadata_size diff --git a/device-mapper-persistent-data-fix-cache-check-exclusive-open.patch b/device-mapper-persistent-data-fix-cache-check-exclusive-open.patch deleted file mode 100644 index 028eb8c..0000000 --- a/device-mapper-persistent-data-fix-cache-check-exclusive-open.patch +++ /dev/null @@ -1,36 +0,0 @@ - VERSION | 2 +- - caching/cache_check.cc | 7 ++++--- - 2 files changed, 5 insertions(+), 4 deletions(-) - -diff --git a/VERSION b/VERSION -index cb0c939..7d85683 100644 ---- a/VERSION -+++ b/VERSION -@@ -1 +1 @@ --0.5.2 -+0.5.4 -diff --git a/caching/cache_check.cc b/caching/cache_check.cc -index 005159e..9bd34be 100644 ---- a/caching/cache_check.cc -+++ b/caching/cache_check.cc -@@ -220,7 +220,9 @@ namespace { - write_superblock(bm, sb); - } - -- error_state metadata_check(block_manager<>::ptr bm, flags const &fs) { -+ error_state metadata_check(string const &path, flags const &fs) { -+ block_manager<>::ptr bm = open_bm(path, block_manager<>::READ_ONLY); -+ - nested_output out(cerr, 2); - if (fs.quiet_) - out.disable(); -@@ -295,8 +297,7 @@ namespace { - throw runtime_error(msg.str()); - } - -- block_manager<>::ptr bm = open_bm(path, block_manager<>::READ_ONLY); -- err = metadata_check(bm, fs); -+ err = metadata_check(path, fs); - - bool success = false; - diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index b142bbc..aefeb90 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -12,6 +12,7 @@ Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provi # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch +Patch2: device-mapper-persistent-data-avoid-strip.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat @@ -28,6 +29,7 @@ snapshot eras %setup -q -n thin-provisioning-tools-%{version} %patch0 -p1 -b .clear_needs_check_flag %patch1 -p1 -b .man_pages +%patch2 -p1 -b .avoid_strip echo %{version}-%{release} > VERSION %build @@ -52,6 +54,7 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_mandir}/man8/thin_check.8.gz %{_mandir}/man8/thin_delta.8.gz %{_mandir}/man8/thin_dump.8.gz +%{_mandir}/man8/thin_ls.8.gz %{_mandir}/man8/thin_metadata_size.8.gz %{_mandir}/man8/thin_restore.8.gz %{_mandir}/man8/thin_repair.8.gz @@ -70,6 +73,7 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_check %{_sbindir}/thin_delta %{_sbindir}/thin_dump +%{_sbindir}/thin_ls %{_sbindir}/thin_metadata_size %{_sbindir}/thin_restore %{_sbindir}/thin_repair From dc1e2176c52208d902f086ed64f275aaa8cf0f69 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 3 Feb 2016 18:39:21 +0000 Subject: [PATCH 044/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index aefeb90..8c9d222 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.6.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -81,6 +81,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Wed Feb 03 2016 Fedora Release Engineering - 0.6.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Wed Jan 20 2016 Peter Rajnoha - 0.6.0-1 - New thin_ls command. From 99ea430f9dbaf4571313c58d64b1a082132675f8 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Tue, 16 Feb 2016 19:41:50 +0100 Subject: [PATCH 045/135] New upstream release v0.6.2-rc3. --- .gitignore | 1 + device-mapper-persistent-data.spec | 21 ++++++++++++++++----- sources | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index b5effe2..c0af248 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /thin-provisioning-tools-0.5.5.tar.gz /thin-provisioning-tools-0.5.6.tar.gz /thin-provisioning-tools-0.6.0.tar.gz +/thin-provisioning-tools-0.6.2-rc3.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 8c9d222..e33f6a4 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -1,14 +1,18 @@ # -# Copyright (C) 2011-2015 Red Hat, Inc +# Copyright (C) 2011-2016 Red Hat, Inc # + +%define pre_release_upstream -rc3 +%define pre_release rc3 + Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.6.0 -Release: 2%{?dist} +Version: 0.6.2 +Release: 0.1.%{pre_release}%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools -Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%{version}.tar.gz +Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%{version}%{pre_release_upstream}.tar.gz # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch @@ -26,7 +30,7 @@ are included and era check, dump, restore and invalidate to manage snapshot eras %prep -%setup -q -n thin-provisioning-tools-%{version} +%setup -q -n thin-provisioning-tools-%{version}%{pre_release_upstream} %patch0 -p1 -b .clear_needs_check_flag %patch1 -p1 -b .man_pages %patch2 -p1 -b .avoid_strip @@ -81,6 +85,13 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Mon Feb 15 2016 Peter Rajnoha - 0.6.2-0.1.rc3 +- Fix recent regression in thin_repair. +- Force g++-98 dialect. + +* Mon Feb 15 2016 Peter Rajnoha - 0.6.2-0.1.rc1 +- Fix bug in thin_dump when using metadata snaps. + * Wed Feb 03 2016 Fedora Release Engineering - 0.6.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index f5e8450..f3d4bb5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0005f9c569a180042bf15bd2b0728f18 thin-provisioning-tools-0.6.0.tar.gz +6652d2774db40decd5dcfaa26ea9ec7c thin-provisioning-tools-0.6.2-rc3.tar.gz From 18f5b7e6e179bfb36e00a653394452711ef9a3dc Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 17 Feb 2016 12:58:16 +0100 Subject: [PATCH 046/135] New upstream release v0.6.2-rc4. --- .gitignore | 1 + device-mapper-persistent-data.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c0af248..5bf4bf9 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /thin-provisioning-tools-0.5.6.tar.gz /thin-provisioning-tools-0.6.0.tar.gz /thin-provisioning-tools-0.6.2-rc3.tar.gz +/thin-provisioning-tools-0.6.2-rc4.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index e33f6a4..a6cdf55 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,8 +2,8 @@ # Copyright (C) 2011-2016 Red Hat, Inc # -%define pre_release_upstream -rc3 -%define pre_release rc3 +%define pre_release_upstream -rc4 +%define pre_release rc4 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data @@ -85,6 +85,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Mon Feb 15 2016 Peter Rajnoha - 0.6.2-0.1.rc4 +- Fix bug in mapping comparison while using thin_delta. + * Mon Feb 15 2016 Peter Rajnoha - 0.6.2-0.1.rc3 - Fix recent regression in thin_repair. - Force g++-98 dialect. diff --git a/sources b/sources index f3d4bb5..337ce81 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6652d2774db40decd5dcfaa26ea9ec7c thin-provisioning-tools-0.6.2-rc3.tar.gz +95209856957fcb1299f8bbf1c473ba50 thin-provisioning-tools-0.6.2-rc4.tar.gz From 90fbaa7a9d84a7c88202e23d64b21a05ad9bddda Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 18 Feb 2016 16:35:29 +0100 Subject: [PATCH 047/135] New upstream release v0.6.2-rc5. --- .gitignore | 1 + device-mapper-persistent-data.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5bf4bf9..2dc78a9 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /thin-provisioning-tools-0.6.0.tar.gz /thin-provisioning-tools-0.6.2-rc3.tar.gz /thin-provisioning-tools-0.6.2-rc4.tar.gz +/thin-provisioning-tools-0.6.2-rc5.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index a6cdf55..0c276eb 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,8 +2,8 @@ # Copyright (C) 2011-2016 Red Hat, Inc # -%define pre_release_upstream -rc4 -%define pre_release rc4 +%define pre_release_upstream -rc5 +%define pre_release rc5 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data @@ -85,6 +85,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Thu Feb 18 2016 Peter Rajnoha - 0.6.2-0.1.rc5 +- Fixes for thin_delta. + * Mon Feb 15 2016 Peter Rajnoha - 0.6.2-0.1.rc4 - Fix bug in mapping comparison while using thin_delta. diff --git a/sources b/sources index 337ce81..c79aa47 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -95209856957fcb1299f8bbf1c473ba50 thin-provisioning-tools-0.6.2-rc4.tar.gz +5c35bdb6654208f688e5d236e9b98fb4 thin-provisioning-tools-0.6.2-rc5.tar.gz From 9e4b69ab08fee2c6db104fe4c9911bbbf8bd208d Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 9 Mar 2016 08:49:37 +0100 Subject: [PATCH 048/135] New upstream release v0.6.2-rc6. --- device-mapper-persistent-data.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 0c276eb..e4797ac 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,8 +2,8 @@ # Copyright (C) 2011-2016 Red Hat, Inc # -%define pre_release_upstream -rc5 -%define pre_release rc5 +%define pre_release_upstream -rc6 +%define pre_release rc6 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data @@ -85,6 +85,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Wed Mar 09 2016 Peter Rajnoha - 0.6.2-0.1.rc6 +- Add new fields to thin_ls: MAPPED_BYTES, EXCLUSIVE_BYTES and SHARED_BYTES. + * Thu Feb 18 2016 Peter Rajnoha - 0.6.2-0.1.rc5 - Fixes for thin_delta. From 0e6c2c5e66df86f7f7e2e2f1ab1a51428a6e2267 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 9 Mar 2016 08:58:22 +0100 Subject: [PATCH 049/135] New upstream release v0.6.2-rc6. --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2dc78a9..ef5a6b2 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /thin-provisioning-tools-0.6.2-rc3.tar.gz /thin-provisioning-tools-0.6.2-rc4.tar.gz /thin-provisioning-tools-0.6.2-rc5.tar.gz +/thin-provisioning-tools-0.6.2-rc6.tar.gz diff --git a/sources b/sources index c79aa47..1c5fb95 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5c35bdb6654208f688e5d236e9b98fb4 thin-provisioning-tools-0.6.2-rc5.tar.gz +471e51f7b3dcea7ac92135e4093e8727 thin-provisioning-tools-0.6.2-rc6.tar.gz From 5c01a0ad21e64779e378153709af76829c3442fc Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Tue, 22 Mar 2016 09:33:08 +0100 Subject: [PATCH 050/135] New upstream release v0.6.2-rc7. --- .gitignore | 1 + device-mapper-persistent-data.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ef5a6b2..1ae61c5 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /thin-provisioning-tools-0.6.2-rc4.tar.gz /thin-provisioning-tools-0.6.2-rc5.tar.gz /thin-provisioning-tools-0.6.2-rc6.tar.gz +/thin-provisioning-tools-0.6.2-rc7.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index e4797ac..1b2d5b8 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,8 +2,8 @@ # Copyright (C) 2011-2016 Red Hat, Inc # -%define pre_release_upstream -rc6 -%define pre_release rc6 +%define pre_release_upstream -rc7 +%define pre_release rc7 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data @@ -85,6 +85,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Tue Mar 22 2016 Peter Rajnoha - 0.6.2-0.1.rc7 +- Fixes for thin_repair. + * Wed Mar 09 2016 Peter Rajnoha - 0.6.2-0.1.rc6 - Add new fields to thin_ls: MAPPED_BYTES, EXCLUSIVE_BYTES and SHARED_BYTES. diff --git a/sources b/sources index 1c5fb95..35295c2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -471e51f7b3dcea7ac92135e4093e8727 thin-provisioning-tools-0.6.2-rc6.tar.gz +8cf5808893523d1c57e14ff811192b81 thin-provisioning-tools-0.6.2-rc7.tar.gz From 635d3473dc1092b2b2dde822b18ac003a9c19105 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Mon, 11 Apr 2016 14:14:03 +0200 Subject: [PATCH 051/135] New upstream release v0.6.2-rc8. --- .gitignore | 1 + device-mapper-persistent-data.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1ae61c5..23a902b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ /thin-provisioning-tools-0.6.2-rc5.tar.gz /thin-provisioning-tools-0.6.2-rc6.tar.gz /thin-provisioning-tools-0.6.2-rc7.tar.gz +/thin-provisioning-tools-0.6.2-rc8.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 1b2d5b8..908cbd2 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,8 +2,8 @@ # Copyright (C) 2011-2016 Red Hat, Inc # -%define pre_release_upstream -rc7 -%define pre_release rc7 +%define pre_release_upstream -rc8 +%define pre_release rc8 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data @@ -85,6 +85,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Mon Apr 11 2016 Peter Rajnoha - 0.6.2-0.1.rc8 +- Fixes for thin_trim. + * Tue Mar 22 2016 Peter Rajnoha - 0.6.2-0.1.rc7 - Fixes for thin_repair. diff --git a/sources b/sources index 35295c2..517e7d6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8cf5808893523d1c57e14ff811192b81 thin-provisioning-tools-0.6.2-rc7.tar.gz +69891c5a9edf1ccfac36f97ff38f9bd6 thin-provisioning-tools-0.6.2-rc8.tar.gz From 413d274654e890531aa922e5e0f2d415439b911b Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Mon, 11 Jul 2016 11:33:15 +0200 Subject: [PATCH 052/135] New upstream release v0.6.2. --- .gitignore | 1 + device-mapper-persistent-data.spec | 12 ++++++------ sources | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 23a902b..e57cbb7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /thin-provisioning-tools-0.6.2-rc6.tar.gz /thin-provisioning-tools-0.6.2-rc7.tar.gz /thin-provisioning-tools-0.6.2-rc8.tar.gz +/thin-provisioning-tools-0.6.2.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 908cbd2..48e069a 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,17 +2,14 @@ # Copyright (C) 2011-2016 Red Hat, Inc # -%define pre_release_upstream -rc8 -%define pre_release rc8 - Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.6.2 -Release: 0.1.%{pre_release}%{?dist} +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools -Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%{version}%{pre_release_upstream}.tar.gz +Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%{version}.tar.gz # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch @@ -30,7 +27,7 @@ are included and era check, dump, restore and invalidate to manage snapshot eras %prep -%setup -q -n thin-provisioning-tools-%{version}%{pre_release_upstream} +%setup -q -n thin-provisioning-tools-%{version} %patch0 -p1 -b .clear_needs_check_flag %patch1 -p1 -b .man_pages %patch2 -p1 -b .avoid_strip @@ -85,6 +82,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Mon Jul 11 2016 Peter Rajnoha - 0.6.2-1 +- Fixes providing proper use of compiler flags. + * Mon Apr 11 2016 Peter Rajnoha - 0.6.2-0.1.rc8 - Fixes for thin_trim. diff --git a/sources b/sources index 517e7d6..682cf4e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -69891c5a9edf1ccfac36f97ff38f9bd6 thin-provisioning-tools-0.6.2-rc8.tar.gz +3727a81c49c8b41aa066b842516dea47 thin-provisioning-tools-0.6.2.tar.gz From 9e7d28d253dac7842deece5c180d4c8564a40d89 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 22 Sep 2016 14:47:56 +0200 Subject: [PATCH 053/135] New upstream release v0.6.3. --- .gitignore | 1 + device-mapper-persistent-data.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e57cbb7..ffcca85 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /thin-provisioning-tools-0.6.2-rc7.tar.gz /thin-provisioning-tools-0.6.2-rc8.tar.gz /thin-provisioning-tools-0.6.2.tar.gz +/thin-provisioning-tools-0.6.3.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 48e069a..3efee11 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.6.2 +Version: 0.6.3 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -82,6 +82,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Thu Sep 22 2016 Peter Rajnoha - 0.6.3-1 +- Preallocate output file for thin_repair and thin_restore. + * Mon Jul 11 2016 Peter Rajnoha - 0.6.2-1 - Fixes providing proper use of compiler flags. diff --git a/sources b/sources index 682cf4e..4ef56d8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3727a81c49c8b41aa066b842516dea47 thin-provisioning-tools-0.6.2.tar.gz +28b352363ea7eb6698ad2efcd7d8c2ae thin-provisioning-tools-0.6.3.tar.gz From 702f380fa371ca4679c816620d1383cad13f87b0 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 27 Jan 2017 03:19:35 +0000 Subject: [PATCH 054/135] Rebuilt for Boost 1.63 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 3efee11..0b0a9d0 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.6.3 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -82,6 +82,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Fri Jan 27 2017 Jonathan Wakely - 0.6.3-2 +- Rebuilt for Boost 1.63 + * Thu Sep 22 2016 Peter Rajnoha - 0.6.3-1 - Preallocate output file for thin_repair and thin_restore. From 0a96e398abb747cbb8862e0a4a3be42617d1d1ca Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 10 Feb 2017 08:19:52 +0000 Subject: [PATCH 055/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 0b0a9d0..701032e 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.6.3 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -82,6 +82,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_trim %changelog +* Fri Feb 10 2017 Fedora Release Engineering - 0.6.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Fri Jan 27 2017 Jonathan Wakely - 0.6.3-2 - Rebuilt for Boost 1.63 From d295f18b541c4376507eb82ff6b55d0a01a3d537 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 9 Mar 2017 11:36:39 +0100 Subject: [PATCH 056/135] New upstream release v0.7.0-rc2. --- ...persistent-data-fix-missing-includes.patch | 15 +++++++++ device-mapper-persistent-data.spec | 33 +++++++++++++------ 2 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 device-mapper-persistent-data-fix-missing-includes.patch diff --git a/device-mapper-persistent-data-fix-missing-includes.patch b/device-mapper-persistent-data-fix-missing-includes.patch new file mode 100644 index 0000000..d0b5e71 --- /dev/null +++ b/device-mapper-persistent-data-fix-missing-includes.patch @@ -0,0 +1,15 @@ + block-cache/io_engine.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/block-cache/io_engine.h b/block-cache/io_engine.h +index fd902c1..1c1a0e8 100644 +--- a/block-cache/io_engine.h ++++ b/block-cache/io_engine.h +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + #include + + //---------------------------------------------------------------- diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 701032e..b521984 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -1,19 +1,23 @@ # -# Copyright (C) 2011-2016 Red Hat, Inc +# Copyright (C) 2011-2017 Red Hat, Inc # +%define pre_release_upstream -rc2 +%define pre_release rc2 + Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.6.3 -Release: 3%{?dist} +Version: 0.7.0 +Release: 0.1.%{pre_release}%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools -Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%{version}.tar.gz +Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%{version}%{pre_release_upstream}.tar.gz # Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch Patch2: device-mapper-persistent-data-avoid-strip.patch +Patch3: device-mapper-persistent-data-fix-missing-includes.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat @@ -27,10 +31,11 @@ are included and era check, dump, restore and invalidate to manage snapshot eras %prep -%setup -q -n thin-provisioning-tools-%{version} +%setup -q -n thin-provisioning-tools-%{version}%{pre_release_upstream} %patch0 -p1 -b .clear_needs_check_flag %patch1 -p1 -b .man_pages %patch2 -p1 -b .avoid_strip +%patch3 -p1 -b .includes echo %{version}-%{release} > VERSION %build @@ -47,8 +52,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %doc COPYING README.md %{_mandir}/man8/cache_check.8.gz %{_mandir}/man8/cache_dump.8.gz -%{_mandir}/man8/cache_restore.8.gz %{_mandir}/man8/cache_repair.8.gz +%{_mandir}/man8/cache_restore.8.gz +%{_mandir}/man8/cache_writeback.8.gz %{_mandir}/man8/era_check.8.gz %{_mandir}/man8/era_dump.8.gz %{_mandir}/man8/era_invalidate.8.gz @@ -57,31 +63,38 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_mandir}/man8/thin_dump.8.gz %{_mandir}/man8/thin_ls.8.gz %{_mandir}/man8/thin_metadata_size.8.gz -%{_mandir}/man8/thin_restore.8.gz %{_mandir}/man8/thin_repair.8.gz +%{_mandir}/man8/thin_restore.8.gz %{_mandir}/man8/thin_rmap.8.gz %{_mandir}/man8/thin_trim.8.gz %{_sbindir}/pdata_tools %{_sbindir}/cache_check %{_sbindir}/cache_dump %{_sbindir}/cache_metadata_size -%{_sbindir}/cache_restore %{_sbindir}/cache_repair +%{_sbindir}/cache_restore +%{_sbindir}/cache_writeback %{_sbindir}/era_check %{_sbindir}/era_dump -%{_sbindir}/era_restore %{_sbindir}/era_invalidate +%{_sbindir}/era_restore %{_sbindir}/thin_check %{_sbindir}/thin_delta %{_sbindir}/thin_dump %{_sbindir}/thin_ls %{_sbindir}/thin_metadata_size -%{_sbindir}/thin_restore %{_sbindir}/thin_repair +%{_sbindir}/thin_restore %{_sbindir}/thin_rmap %{_sbindir}/thin_trim +%{_sbindir}/thin_show_duplicates %changelog +* Thu Mar 09 2017 Peter Rajnoha - 0.7.0-0.1-rc2 +- Update to latest upstream release including various bug fixes and new features. +- New thin_show_duplicates command. +- Add '--skip-mappings' and '--format custom' options to thin_dump. + * Fri Feb 10 2017 Fedora Release Engineering - 0.6.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From bbce189d61f5e1a164ba0cf9b8608dea3d4a3f1d Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 9 Mar 2017 11:40:12 +0100 Subject: [PATCH 057/135] New upstream release v0.7.0-rc2. --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ffcca85..7c42abc 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /thin-provisioning-tools-0.6.2-rc8.tar.gz /thin-provisioning-tools-0.6.2.tar.gz /thin-provisioning-tools-0.6.3.tar.gz +/thin-provisioning-tools-0.7.0-rc2.tar.gz diff --git a/sources b/sources index 4ef56d8..8e9d917 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -28b352363ea7eb6698ad2efcd7d8c2ae thin-provisioning-tools-0.6.3.tar.gz +SHA512 (thin-provisioning-tools-0.7.0-rc2.tar.gz) = 47631e7525bb0a36ec9fb6f4b6f6d75fffe63c42b51ae9ad6ca220e3a494ac3f1b078b5c25fe513e910185fc8fb28efe8bba0854915f477c2d83cd86fa9cc9fe From de968c0e8cf2fb7430eda35f531616df3e791a1d Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 16 Mar 2017 15:24:13 +0100 Subject: [PATCH 058/135] Fixes and cleanups. --- .gitignore | 1 + ...per-persistent-data-fix-missing-includes.patch | 15 --------------- device-mapper-persistent-data.spec | 9 +++++---- sources | 2 +- 4 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 device-mapper-persistent-data-fix-missing-includes.patch diff --git a/.gitignore b/.gitignore index 7c42abc..3f84025 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ /thin-provisioning-tools-0.6.2.tar.gz /thin-provisioning-tools-0.6.3.tar.gz /thin-provisioning-tools-0.7.0-rc2.tar.gz +/thin-provisioning-tools-0.7.0-rc3.tar.gz diff --git a/device-mapper-persistent-data-fix-missing-includes.patch b/device-mapper-persistent-data-fix-missing-includes.patch deleted file mode 100644 index d0b5e71..0000000 --- a/device-mapper-persistent-data-fix-missing-includes.patch +++ /dev/null @@ -1,15 +0,0 @@ - block-cache/io_engine.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/block-cache/io_engine.h b/block-cache/io_engine.h -index fd902c1..1c1a0e8 100644 ---- a/block-cache/io_engine.h -+++ b/block-cache/io_engine.h -@@ -7,6 +7,7 @@ - #include - #include - #include -+#include - #include - - //---------------------------------------------------------------- diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index b521984..2661357 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,8 +2,8 @@ # Copyright (C) 2011-2017 Red Hat, Inc # -%define pre_release_upstream -rc2 -%define pre_release rc2 +%define pre_release_upstream -rc3 +%define pre_release rc3 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data @@ -17,7 +17,6 @@ Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provi Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch Patch2: device-mapper-persistent-data-avoid-strip.patch -Patch3: device-mapper-persistent-data-fix-missing-includes.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat @@ -35,7 +34,6 @@ snapshot eras %patch0 -p1 -b .clear_needs_check_flag %patch1 -p1 -b .man_pages %patch2 -p1 -b .avoid_strip -%patch3 -p1 -b .includes echo %{version}-%{release} > VERSION %build @@ -90,6 +88,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_show_duplicates %changelog +* Thu Mar 16 2017 Peter Rajnoha - 0.7.0-0.1-rc3 +- Fix compilation warnings and further code cleanup. + * Thu Mar 09 2017 Peter Rajnoha - 0.7.0-0.1-rc2 - Update to latest upstream release including various bug fixes and new features. - New thin_show_duplicates command. diff --git a/sources b/sources index 8e9d917..ad6a18c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (thin-provisioning-tools-0.7.0-rc2.tar.gz) = 47631e7525bb0a36ec9fb6f4b6f6d75fffe63c42b51ae9ad6ca220e3a494ac3f1b078b5c25fe513e910185fc8fb28efe8bba0854915f477c2d83cd86fa9cc9fe +SHA512 (thin-provisioning-tools-0.7.0-rc3.tar.gz) = 2c4ba5a18f9d2577076796cd8978c62a29a071a275b2eaf37099e916ef044ded9e77439a38dc15820dee5e11d169d41903ae95f1d163f00bbdf11efcf966bb6c From f95d0a67cca65dc6f91105a7e418fff91db4449c Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Tue, 21 Mar 2017 12:49:42 +0100 Subject: [PATCH 059/135] New upstream release v0.7.0-rc4. --- .gitignore | 1 + device-mapper-persistent-data.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3f84025..e303ac2 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ /thin-provisioning-tools-0.6.3.tar.gz /thin-provisioning-tools-0.7.0-rc2.tar.gz /thin-provisioning-tools-0.7.0-rc3.tar.gz +/thin-provisioning-tools-0.7.0-rc4.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 2661357..d5eaa58 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,8 +2,8 @@ # Copyright (C) 2011-2017 Red Hat, Inc # -%define pre_release_upstream -rc3 -%define pre_release rc3 +%define pre_release_upstream -rc4 +%define pre_release rc4 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data @@ -88,6 +88,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_show_duplicates %changelog +* Tue Mar 21 2017 Peter Rajnoha - 0.7.0-0.1-rc4 +- Add support for cache metadata format version 2 in cache tools. + * Thu Mar 16 2017 Peter Rajnoha - 0.7.0-0.1-rc3 - Fix compilation warnings and further code cleanup. diff --git a/sources b/sources index ad6a18c..c6212a3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (thin-provisioning-tools-0.7.0-rc3.tar.gz) = 2c4ba5a18f9d2577076796cd8978c62a29a071a275b2eaf37099e916ef044ded9e77439a38dc15820dee5e11d169d41903ae95f1d163f00bbdf11efcf966bb6c +SHA512 (thin-provisioning-tools-0.7.0-rc4.tar.gz) = ac7bdc6c6b7e8404ef46b2417fbfad1f430b03590223a79dc82b14c45cdc9cfe0958b737e7a955d237ab56afeb4c7a35e56149bc2fafe9b6814042491f98a664 From 157df5df7d5d546833fa168a1d37c101ad6bb6f3 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 22 Mar 2017 08:44:21 +0100 Subject: [PATCH 060/135] New upstream release v0.7.0-rc5. --- .gitignore | 1 + device-mapper-persistent-data.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e303ac2..dd7eac8 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ /thin-provisioning-tools-0.7.0-rc2.tar.gz /thin-provisioning-tools-0.7.0-rc3.tar.gz /thin-provisioning-tools-0.7.0-rc4.tar.gz +/thin-provisioning-tools-0.7.0-rc5.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index d5eaa58..d319944 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,8 +2,8 @@ # Copyright (C) 2011-2017 Red Hat, Inc # -%define pre_release_upstream -rc4 -%define pre_release rc4 +%define pre_release_upstream -rc5 +%define pre_release rc5 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data @@ -88,6 +88,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_show_duplicates %changelog +* Wed Mar 22 2017 Peter Rajnoha - 0.7.0-0.1-rc5 +- Switch to a faster implementation of crc32 used for checksums. + * Tue Mar 21 2017 Peter Rajnoha - 0.7.0-0.1-rc4 - Add support for cache metadata format version 2 in cache tools. diff --git a/sources b/sources index c6212a3..4048cc8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (thin-provisioning-tools-0.7.0-rc4.tar.gz) = ac7bdc6c6b7e8404ef46b2417fbfad1f430b03590223a79dc82b14c45cdc9cfe0958b737e7a955d237ab56afeb4c7a35e56149bc2fafe9b6814042491f98a664 +SHA512 (thin-provisioning-tools-0.7.0-rc5.tar.gz) = 364a22cadbc430e0fc5352456fa68eaa1b2a375e3f145c3a04e8949f172a5ff130f421aaf93c6b9b15021f073d23a978b85c1c67c74417c38e5286f5b7cb85f6 From 4cd2a32be9c0d4702b4b20f5e63906b417d82fb1 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Mon, 27 Mar 2017 17:10:25 +0200 Subject: [PATCH 061/135] New upstream release v0.7.0-rc6. --- .gitignore | 1 + device-mapper-persistent-data.spec | 8 ++++++-- sources | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index dd7eac8..2ba1d7e 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /thin-provisioning-tools-0.7.0-rc3.tar.gz /thin-provisioning-tools-0.7.0-rc4.tar.gz /thin-provisioning-tools-0.7.0-rc5.tar.gz +/thin-provisioning-tools-0.7.0-rc6.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index d319944..4aa66f2 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,8 +2,8 @@ # Copyright (C) 2011-2017 Red Hat, Inc # -%define pre_release_upstream -rc5 -%define pre_release rc5 +%define pre_release_upstream -rc6 +%define pre_release rc6 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data @@ -88,6 +88,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_show_duplicates %changelog +* Mon Mar 27 2017 Peter Rajnoha - 0.7.0-0.1-rc6 +- Don't open devices as writeable if --clear-needs-check-flag is not set. +- Fix cache metadata format version 2 superblock packing. + * Wed Mar 22 2017 Peter Rajnoha - 0.7.0-0.1-rc5 - Switch to a faster implementation of crc32 used for checksums. diff --git a/sources b/sources index 4048cc8..f993efa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (thin-provisioning-tools-0.7.0-rc5.tar.gz) = 364a22cadbc430e0fc5352456fa68eaa1b2a375e3f145c3a04e8949f172a5ff130f421aaf93c6b9b15021f073d23a978b85c1c67c74417c38e5286f5b7cb85f6 +SHA512 (thin-provisioning-tools-0.7.0-rc6.tar.gz) = bac97828ec1951b301743149f65e146608a98919d1a3ec9b25631bdb0ea901cc81d6cfd4a9143ffb71f89fe5895eb4e9d29921c4d2730f249dbc443eb3b58a2a From db4dc6b7462ae9aa7a96b769c9b93355725ee839 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 15 May 2017 19:52:39 +0000 Subject: [PATCH 062/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 4aa66f2..d43c81a 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.0 -Release: 0.1.%{pre_release}%{?dist} +Release: 0.2.%{pre_release}%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -88,6 +88,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_show_duplicates %changelog +* Mon May 15 2017 Fedora Release Engineering - 0.7.0-0.2.rc6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild + * Mon Mar 27 2017 Peter Rajnoha - 0.7.0-0.1-rc6 - Don't open devices as writeable if --clear-needs-check-flag is not set. - Fix cache metadata format version 2 superblock packing. From 4378ae098071028542da235af1517f2a357f687b Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 23 May 2017 10:49:41 +0200 Subject: [PATCH 063/135] Rebuild to undo mass rebuild mess --- device-mapper-persistent-data.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index d43c81a..f4ad69e 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -88,6 +88,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_show_duplicates %changelog +* Tue May 23 2017 Marian Csontos - 0.7.0-0.3.rc6 +- Rebuilt for mass rebuild incorrectly tagging master to .fc26 + * Mon May 15 2017 Fedora Release Engineering - 0.7.0-0.2.rc6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild From a9f94b0fd5a4519549596ece7b90547abdca40f7 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 23 May 2017 11:10:49 +0200 Subject: [PATCH 064/135] Fix previous commit missed to increment Release --- device-mapper-persistent-data.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index f4ad69e..6402fa5 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.0 -Release: 0.2.%{pre_release}%{?dist} +Release: 0.3.%{pre_release}%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools From b557b0f64643f0f6c101937fe7ca36f76219fbb5 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 3 Jul 2017 17:54:45 +0100 Subject: [PATCH 065/135] Rebuilt for Boost 1.64 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 6402fa5..7f698b4 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.0 -Release: 0.3.%{pre_release}%{?dist} +Release: 0.4.%{pre_release}%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -88,6 +88,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_show_duplicates %changelog +* Mon Jul 03 2017 Jonathan Wakely - 0.7.0-0.4.rc6 +- Rebuilt for Boost 1.64 + * Tue May 23 2017 Marian Csontos - 0.7.0-0.3.rc6 - Rebuilt for mass rebuild incorrectly tagging master to .fc26 From a3db74c795c63c5f1871637603b15f901f84615b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 26 Jul 2017 06:07:19 +0000 Subject: [PATCH 066/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 7f698b4..5308c0d 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.0 -Release: 0.4.%{pre_release}%{?dist} +Release: 0.5.%{pre_release}%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -88,6 +88,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_show_duplicates %changelog +* Wed Jul 26 2017 Fedora Release Engineering - 0.7.0-0.5.rc6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Mon Jul 03 2017 Jonathan Wakely - 0.7.0-0.4.rc6 - Rebuilt for Boost 1.64 From 76f23150c12383dc406ca00c05dcb330b5559f0f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 2 Aug 2017 19:33:14 +0000 Subject: [PATCH 067/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 5308c0d..8b98696 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.0 -Release: 0.5.%{pre_release}%{?dist} +Release: 0.6.%{pre_release}%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -88,6 +88,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_show_duplicates %changelog +* Wed Aug 02 2017 Fedora Release Engineering - 0.7.0-0.6.rc6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Wed Jul 26 2017 Fedora Release Engineering - 0.7.0-0.5.rc6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 7d940d6bd5ef31430c6e103f8b21d1b5d651f703 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Fri, 22 Sep 2017 09:05:47 +0200 Subject: [PATCH 068/135] New upstream release v0.7.2 --- .gitignore | 1 + ...re-and-cache_metadata_size-man-pages.patch | 116 ------------------ ...e-mapper-persistent-data-avoid-strip.patch | 14 ++- ...data-document-clear-needs-check-flag.patch | 15 --- device-mapper-persistent-data.spec | 32 ++--- sources | 2 +- 6 files changed, 28 insertions(+), 152 deletions(-) delete mode 100644 device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch delete mode 100644 device-mapper-persistent-data-document-clear-needs-check-flag.patch diff --git a/.gitignore b/.gitignore index 2ba1d7e..2a5ff51 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ /thin-provisioning-tools-0.7.0-rc4.tar.gz /thin-provisioning-tools-0.7.0-rc5.tar.gz /thin-provisioning-tools-0.7.0-rc6.tar.gz +/v0.7.2.tar.gz diff --git a/device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch b/device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch deleted file mode 100644 index ac2e687..0000000 --- a/device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch +++ /dev/null @@ -1,116 +0,0 @@ ---- thin-provisioning-tools-0.4.1/man8/era_restore.8.orig 2014-10-28 14:24:43.356272471 +0100 -+++ thin-provisioning-tools-0.4.1/man8/era_restore.8 2014-10-28 14:28:56.358133852 +0100 -@@ -0,0 +1,63 @@ -+.TH ERA_RESTORE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+era_restore \- restore era metadata file to device or file -+ -+.SH SYNOPSIS -+.B era_restore -+.RB [ options ] -+.RB -i -+.I {device|file} -+.RB -o -+.I {device|file} -+ -+.SH DESCRIPTION -+.B era_restore -+restores binary era metadata created by the -+respective device-mapper target dumped into an XML formatted (see -+.BR era_dump(8) ) -+.I file -+, which optionally can be preprocessed before the restore to another -+.I device -+or -+.I file. -+If restored to a metadata -+.I device -+, the metadata can be processed by the device-mapper target. -+ -+.IP "\fB\-q, \-\-quiet\fP" -+Suppress output messages, return only exit code. -+ -+.IP "\fB\-i, \-\-input\fP \fI{device|file}\fP" -+Input file or device with metadata. -+ -+.IP "\fB\-o, \-\-output\fP \fI{device|file}\fP" -+Output file or device. -+ -+.IP "\fB\-h, \-\-help\fP" -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP" -+Output version information and exit. -+ -+.SH EXAMPLE -+Restores the XML formatted era metadata on file -+.B metadata -+to logical volume /dev/vg/metadata for further processing by the -+respective device-mapper target: -+.sp -+.B era_restore -i metadata -o /dev/vg/metadata -+ -+.SH DIAGNOSTICS -+.B era_restore -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B era_check(8) -+.B era_dump(8) -+.B era_invaidate(8) -+.B era_restore(8) -+ -+.SH AUTHOR -+Joe Thornber -+.br -+Heinz Mauelshagen ---- thin-provisioning-tools-0.4.1/man8/cache_metadata_size.8.orig 2014-10-28 14:31:49.116087709 +0100 -+++ thin-provisioning-tools-0.4.1/man8/cache_metadata_size.8 2014-10-28 14:50:29.337238755 +0100 -@@ -0,0 +1,47 @@ -+.TH CACHE_METADATA_SIZE 8 "Thin Provisioning Tools" "Red Hat, Inc." \" -*- nroff -*- -+.SH NAME -+cache_metadata_size \- cache metadata device/file size calculator. -+ -+.SH SYNOPSIS -+.B cache_metadata_size -+.RB [ options ] -+ -+.SH DESCRIPTION -+.B cache_metadata_size -+calculates the size of the cache metadata based on the block size -+of the cache device and the cache block size. -+All relates to the size of the fast device (eg, SSD), rather -+than the whole cached (i.e. origin) device. -+ -+.IP "\fB\\-\-block\-size \fP -+Block size of cache in units of sectors. -+ -+.IP "\fB\\-\-device\-size \fP -+Device size of the cache device in units of sectors. -+ -+.IP "\fB\\-\-nr\-blocks \fP -+Capacity of the cache in number of blocks. -+ -+.IP "\fB\-h, \-\-help\fP" -+Print help and exit. -+ -+.IP "\fB\-V, \-\-version\fP" -+Output version information and exit. -+ -+.SH EXAMPLES -+Calculates the cache metadata device size for block size 256 sectors.and device size of 2GiB -+.sp -+.B cache_metadata_size --block-size 256 --device-size $((2*1024*1024)) -+ -+.SH DIAGNOSTICS -+.B cache_metadata_size -+returns an exit code of 0 for success or 1 for error. -+ -+.SH SEE ALSO -+.B cache_check(8) -+.B cache_dump(8) -+.B cache_repair(8) -+.B cache_restore(8) -+ -+.SH AUTHOR -+Heinz Mauelshagen diff --git a/device-mapper-persistent-data-avoid-strip.patch b/device-mapper-persistent-data-avoid-strip.patch index 3b7379a..6b3410e 100644 --- a/device-mapper-persistent-data-avoid-strip.patch +++ b/device-mapper-persistent-data-avoid-strip.patch @@ -1,8 +1,12 @@ -diff -purN thin-provisioning-tools-0.6.0.orig/Makefile.in thin-provisioning-tools-0.6.0.new/Makefile.in ---- thin-provisioning-tools-0.6.0.orig/Makefile.in 2016-01-20 16:43:21.000000000 +0100 -+++ thin-provisioning-tools-0.6.0.new/Makefile.in 2016-01-20 17:26:11.943664295 +0100 -@@ -174,7 +174,6 @@ distclean: clean - install: bin/pdata_tools + Makefile.in | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 0aa9401..0f4f7cb 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -262,7 +262,6 @@ MANPAGES:=$(patsubst %,man8/%.8,$(TOOLS)) + install: bin/pdata_tools $(MANPAGES) $(INSTALL_DIR) $(BINDIR) $(INSTALL_PROGRAM) bin/pdata_tools $(BINDIR) - $(STRIP) $(BINDIR)/pdata_tools diff --git a/device-mapper-persistent-data-document-clear-needs-check-flag.patch b/device-mapper-persistent-data-document-clear-needs-check-flag.patch deleted file mode 100644 index 6fa4163..0000000 --- a/device-mapper-persistent-data-document-clear-needs-check-flag.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- thin-provisioning-tools-0.4.1/man8/thin_check.8.orig 2014-10-28 14:19:02.800420873 +0100 -+++ thin-provisioning-tools-0.4.1/man8/thin_check.8 2014-10-28 14:19:47.335924554 +0100 -@@ -25,6 +25,12 @@ - .IP "\fB\-V, \-\-version\fP" - Output version information and exit. - -+.IP "\fB\-\-clear\-needs\-check\-flag\fP" -+Clear the needs-check-flag in case the check of the thin pool metadata succeeded. -+If the metadata check failed, the flag is not cleared and a thin_repair run is -+needed to fix any issues. -+After thin_repair succeeded, you may run thin_check again. -+ - .IP "\fB\-\-super\-block\-only\fP" - Only check the superblock is present. - diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 8b98696..161bf44 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,21 +2,16 @@ # Copyright (C) 2011-2017 Red Hat, Inc # -%define pre_release_upstream -rc6 -%define pre_release rc6 - Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.7.0 -Release: 0.6.%{pre_release}%{?dist} +Version: 0.7.2 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools -Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%{version}%{pre_release_upstream}.tar.gz -# Source1: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz -Patch0: device-mapper-persistent-data-document-clear-needs-check-flag.patch -Patch1: device-mapper-persistent-data-add-era_restore-and-cache_metadata_size-man-pages.patch -Patch2: device-mapper-persistent-data-avoid-strip.patch +#Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-% {version}.tar.gz +Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz +Patch0: device-mapper-persistent-data-avoid-strip.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel Requires: expat @@ -30,10 +25,8 @@ are included and era check, dump, restore and invalidate to manage snapshot eras %prep -%setup -q -n thin-provisioning-tools-%{version}%{pre_release_upstream} -%patch0 -p1 -b .clear_needs_check_flag -%patch1 -p1 -b .man_pages -%patch2 -p1 -b .avoid_strip +%setup -q -n thin-provisioning-tools-%{version} +%patch0 -p1 -b .avoid_strip echo %{version}-%{release} > VERSION %build @@ -50,12 +43,14 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %doc COPYING README.md %{_mandir}/man8/cache_check.8.gz %{_mandir}/man8/cache_dump.8.gz +%{_mandir}/man8/cache_metadata_size.8.gz %{_mandir}/man8/cache_repair.8.gz %{_mandir}/man8/cache_restore.8.gz %{_mandir}/man8/cache_writeback.8.gz %{_mandir}/man8/era_check.8.gz %{_mandir}/man8/era_dump.8.gz %{_mandir}/man8/era_invalidate.8.gz +%{_mandir}/man8/era_restore.8.gz %{_mandir}/man8/thin_check.8.gz %{_mandir}/man8/thin_delta.8.gz %{_mandir}/man8/thin_dump.8.gz @@ -85,9 +80,16 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_restore %{_sbindir}/thin_rmap %{_sbindir}/thin_trim -%{_sbindir}/thin_show_duplicates +#% {_sbindir}/thin_show_duplicates %changelog +* Fri Sep 22 2017 Marian Csontos - 0.7.2-1 +- Update to latest upstream release including various bug fixes and new features. +- Fix segfault when dump tools are given a tiny metadata file. +- Fix -V exiting with 1. +- Fix thin_check when running on XML dump instead of binary data. +- Speed up free block searching. + * Wed Aug 02 2017 Fedora Release Engineering - 0.7.0-0.6.rc6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild diff --git a/sources b/sources index f993efa..a51eaac 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (thin-provisioning-tools-0.7.0-rc6.tar.gz) = bac97828ec1951b301743149f65e146608a98919d1a3ec9b25631bdb0ea901cc81d6cfd4a9143ffb71f89fe5895eb4e9d29921c4d2730f249dbc443eb3b58a2a +SHA512 (v0.7.2.tar.gz) = 563363842ab0b92f563ac7fcaedb18b8fca70b0894ff30d55cc40487d53b035c32d3ef711adb7102ef1a55b26a75510239da2542b791d850a5cbccf1ddf1acdd From 5d5ebcb4253602f6292ac8ca7f222aa02e61fc2b Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Fri, 6 Oct 2017 16:40:45 +0200 Subject: [PATCH 069/135] New upstream release v0.7.3 --- .gitignore | 1 + device-mapper-persistent-data.spec | 7 ++++++- sources | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2a5ff51..5395f66 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ /thin-provisioning-tools-0.7.0-rc5.tar.gz /thin-provisioning-tools-0.7.0-rc6.tar.gz /v0.7.2.tar.gz +/v0.7.3.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 161bf44..f5b3d35 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.7.2 +Version: 0.7.3 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -83,6 +83,11 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Fri Oct 06 2017 Marian Csontos - 0.7.3-1 +- Update to latest bugfix and documentation update release. +- *_restore tools wipe superblock as a last resort. +- Add thin_check --override-mapping-root. + * Fri Sep 22 2017 Marian Csontos - 0.7.2-1 - Update to latest upstream release including various bug fixes and new features. - Fix segfault when dump tools are given a tiny metadata file. diff --git a/sources b/sources index a51eaac..ae57c22 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.7.2.tar.gz) = 563363842ab0b92f563ac7fcaedb18b8fca70b0894ff30d55cc40487d53b035c32d3ef711adb7102ef1a55b26a75510239da2542b791d850a5cbccf1ddf1acdd +SHA512 (v0.7.3.tar.gz) = 492d02d1a06a9a2554a99f24c05e5d0d9234900669099b27eac9af459ab312fa53acce58a44c41133e060302013cd05b8c83c5e4e8d3727b1a1389c9d8f85574 From 651216ed6a564f6b2003856067596c397338f8ab Mon Sep 17 00:00:00 2001 From: Bruno Goncalves Date: Thu, 19 Oct 2017 10:48:24 +0200 Subject: [PATCH 070/135] Add CI tests using the standard test interface --- tests/functions_test/Makefile | 76 + tests/functions_test/PURPOSE | 30 + tests/functions_test/dmpd_functions.py | 1234 +++++++++ tests/functions_test/dmpd_library.py | 2368 +++++++++++++++++ tests/functions_test/runtest.sh | 18 + tests/tests.yml | 26 + tests/tools_not_linked_usr/Makefile | 75 + tests/tools_not_linked_usr/PURPOSE | 13 + tests/tools_not_linked_usr/runtest.sh | 18 + .../tools_not_linked_usr.py | 93 + 10 files changed, 3951 insertions(+) create mode 100644 tests/functions_test/Makefile create mode 100644 tests/functions_test/PURPOSE create mode 100755 tests/functions_test/dmpd_functions.py create mode 100755 tests/functions_test/dmpd_library.py create mode 100755 tests/functions_test/runtest.sh create mode 100644 tests/tests.yml create mode 100644 tests/tools_not_linked_usr/Makefile create mode 100644 tests/tools_not_linked_usr/PURPOSE create mode 100755 tests/tools_not_linked_usr/runtest.sh create mode 100755 tests/tools_not_linked_usr/tools_not_linked_usr.py diff --git a/tests/functions_test/Makefile b/tests/functions_test/Makefile new file mode 100644 index 0000000..85cc8dd --- /dev/null +++ b/tests/functions_test/Makefile @@ -0,0 +1,76 @@ +# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Author: Jakub Krysl + +# The toplevel namespace within which the test lives. +TOPLEVEL_NAMESPACE=kernel + +# The name of the package under test: +PACKAGE_NAME=storage + +# The path of the test below the package: +RELATIVE_PATH=lvm/device-mapper-persistent-data/thin + +# Version of the Test. Used with make tag. +export TESTVERSION=1.0 + +# The combined namespace of the test. +export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) + + +# A phony target is one that is not really the name of a file. +# It is just a name for some commands to be executed when you +# make an explicit request. There are two reasons to use a +# phony target: to avoid a conflict with a file of the same +# name, and to improve performance. +.PHONY: all install download clean + +# executables to be built should be added here, they will be generated on the system under test. +BUILT_FILES= + +# data files, .c files, scripts anything needed to either compile the test and/or run it. +FILES=$(METADATA) runtest.sh PURPOSE + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ *.rpm $(BUILT_FILES) + +# You may need to add other targets e.g. to build executables from source code +# Add them here: + + +# Include Common Makefile +include /usr/share/rhts/lib/rhts-make.include + +# Generate the testinfo.desc here: +$(METADATA): Makefile + @touch $(METADATA) +# Change to the test owner's name + @echo "Owner: Jakub Krysl " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "License: GPL" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: Testing thin tools provided by device-mapper-persistent-data">> $(METADATA) + @echo "TestTime: 1h" >> $(METADATA) + @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA) + @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA) + @echo "RhtsRequires: kernel-kernel-storage-misc-env_setup" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/functions_test/PURPOSE b/tests/functions_test/PURPOSE new file mode 100644 index 0000000..1465ab6 --- /dev/null +++ b/tests/functions_test/PURPOSE @@ -0,0 +1,30 @@ +#=========================================================================== +# +# PURPOSE file for: +# /kernel/storage/lvm/device-mapper-persistent-data/thin +# +# Description: +# Testing thin tools provided by device-mapper-persistent-data +# +# Bugs related: +# +# +# Author(s): +# Jakub Krysl +# +# +#=========================================================================== +# Note: +# As with some of Storage tests, at the end of the test it will check +# for errors on the logs. +# This check if implemented on /kernel/storage/include/python_modules +# LogChecker.py module +# +# To avoid Storage tests reporting error that were caused before the test +# started to run is recommended to run /kernel/storage/misc/log_checker +# just before running this test +#=========================================================================== +# This task takes optional parameters: +# +#=========================================================================== +# EndFile diff --git a/tests/functions_test/dmpd_functions.py b/tests/functions_test/dmpd_functions.py new file mode 100755 index 0000000..a908bcf --- /dev/null +++ b/tests/functions_test/dmpd_functions.py @@ -0,0 +1,1234 @@ +#!/usr/bin/python + +# Copyright (c) 2017 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; If not, see http://www.gnu.org/licenses/. +# +# Author: Jakub Krysl + +import sys, os +sys.path.append(os.path.abspath("dmpd_library.py")) + +from dmpd_library import * + +def thin_init(args): + # Create thin pool with LVs + print("INFO: Initializing test case") + errors = [] + + atomic_run("Creating loopdev", + name=args["loop1"], + size=args["loop1_size"], + command=loopdev.create_loopdev, + errors=errors) + + atomic_run("Creating VG", + vg_name=args["group"], + pv_name="/dev/" + args["loop1"], + command=lvm.vg_create, + errors=errors) + + atomic_run("Creating thin pool", + vg_name=args["group"], + lv_name=args["pool"], + options=["-T", "-L 500"], + command=lvm.lv_create, + errors=errors) + + # create few LVs to increase transaction ID and be able to do thin_delta + for i in range(args["number of vols"]): + atomic_run("Creating thin LV No. %s" % i, + vg_name=args["group"] + "/" + args["pool"], + lv_name=args["vol"] + str(i), + options=["-T", "-V 100"], + command=lvm.lv_create, + errors=errors) + + atomic_run("Creating filesystem on LV No. %s" % i, + vg_name=args["group"], + lv_name=args["vol"] + str(i), + command=create_filesystem, + errors=errors) + + atomic_run("Deactivating thin LV No. %s" % i, + lv_name=args["vol"] + str(i), + vg_name=args["group"], + command=lvm.lv_deactivate, + errors=errors) + + atomic_run("Creating metadata snapshot", + lv_name=args["pool"], + vg_name=args["group"], + command=metadata_snapshot, + errors=errors) + + atomic_run("Deactivating pool", + lv_name=args["pool"], + vg_name=args["group"], + command=lvm.lv_deactivate, + errors=errors) + + atomic_run("Creating swap LV", + vg_name=args["group"], + lv_name=args["swap"], + options=["-L 100"], + command=lvm.lv_create, + errors=errors) + + atomic_run("Deactivating swap", + lv_name=args["swap"], + vg_name=args["group"], + command=lvm.lv_deactivate, + errors=errors) + + atomic_run("Swapping metadata", + vg_name=args["group"], + lv_name=args["swap"], + options=["-y", "--thinpool " + args["group"] + "/" + args["pool"], + "--poolmetadata "], + command=lvm.lv_convert, + errors=errors) + + atomic_run("Activating swap", + lv_name=args["swap"], + vg_name=args["group"], + command=lvm.lv_activate, + errors=errors) + + if len(errors) == 0: + TC.tpass("Initialization passed") + else: + TC.tfail("Initialization failed with following errors: \n\t'" + + "\n\t ".join([str(i) for i in errors])) + return 1 + return 0 + + +def thin_clean(args): + print("INFO: Cleaning up") + errors = [] + + # restoring metadata device in case it is corrupted + atomic_run("Repairing metadata device", + source_file="/tmp/metadata", + target_vg=args["group"], + target_lv=args["swap"], + quiet=True, + command=dmpd.thin_restore, + errors=errors) + + # thinpool got activated after checking its metadata to get bad checksum + atomic_run("Deactivating pool", + lv_name=args["pool"], + vg_name=args["group"], + command=lvm.lv_deactivate, + errors=errors) + + atomic_run("Deactivating swap", + lv_name=args["swap"], + vg_name=args["group"], + command=lvm.lv_deactivate, + errors=errors) + + atomic_run("Swapping back metadata", + vg_name=args["group"], + lv_name=args["swap"], + options=["-y", "--thinpool " + args["group"] + "/" + args["pool"], + "--poolmetadata "], + command=lvm.lv_convert, + errors=errors) + + atomic_run("Removing swap", + lv_name=args["swap"], + vg_name=args["group"], + command=lvm.lv_remove, + errors=errors) + + atomic_run("Removing thinpool", + lv_name=args["pool"], + vg_name=args["group"], + command=lvm.lv_remove, + errors=errors) + + atomic_run("Removing VG", + vg_name=args["group"], + force=True, + command=lvm.vg_remove, + errors=errors) + + atomic_run("Deleting loopdev", + name=args["loop1"], + command=loopdev.delete_loopdev, + errors=errors) + + atomic_run("Deleting metadata file", + cmd="rm -f /tmp/metadata", + command=run, + errors=errors) + + atomic_run("Deleting repair metadata file", + cmd="rm -f /tmp/metadata_repair", + command=run, + errors=errors) + + atomic_run("Deleting snapshot metadata file", + cmd="rm -f /tmp/metadata_snap", + command=run, + errors=errors) + + if len(errors) == 0: + TC.tpass("Cleanup passed") + else: + TC.tfail("Cleanup failed with following errors: \n\t'" + + "\n\t ".join([str(i) for i in errors])) + print(errors) + return 1 + return 0 + +def thin_test(args): + print("\n#######################################\n") + print ( + "INFO: Testing thin tools runtime provided by device_mapper_persistent_data") + + errors = [] + + atomic_run("Checking metadata", + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.thin_check, + errors=errors) + + atomic_run("Checking metadata with few paramethers", + source_vg=args["group"], + source_lv=args["swap"], + super_block_only=True, + skip_mappings=True, + ignore_non_fatal_errors=True, + command=dmpd.thin_check, + errors=errors) + + atomic_run("Listing information about thin LVs", + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.thin_ls, + errors=errors) + + atomic_run("Listing information about thin LVs without headers", + source_vg=args["group"], + source_lv=args["swap"], + no_headers=True, + command=dmpd.thin_ls, + errors=errors) + + # Not yet in Fedora 26, shoud be in F27 + #atomic_run("Dumping metadata to standard output without mappings", + # formatting="human_readable", + # source_vg=args["group"], + # source_lv=args["swap"], + # skip_mappings=True, + # command=dmpd.thin_dump, + # errors=errors) + + atomic_run("Dumping metadata to standard output", + formatting="human_readable", + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.thin_dump, + errors=errors) + + atomic_run("Dumping metadata to standard output from snapshot", + formatting="human_readable", + source_vg=args["group"], + source_lv=args["swap"], + snapshot=True, + command=dmpd.thin_dump, + errors=errors) + + # Not yet in Fedora 26, shoud be in F27 + #atomic_run("Dumping metadata with dev-id", + # formatting="human_readable", + # source_vg=args["group"], + # source_lv=args["swap"], + # dev_id=args["number of vols"] - 1, + # command=dmpd.thin_dump, + # errors=errors) + + atomic_run("Calculating metadata size for pool of 64k blocks and 100M size", + cmd="thin_metadata_size -b64k -s100m -m1 -um", + command=run, + errors=errors) + + atomic_run("Calculating metadata size for pool of 64k blocks and 100M size", + cmd="thin_metadata_size -b64k -s100m -m1 -um -n", + command=run, + errors=errors) + + atomic_run("Calculating metadata size for pool of 64k blocks and 100M size", + cmd="thin_metadata_size -b64k -s100m -m1 -um -nlong", + command=run, + errors=errors) + + atomic_run("Calculating metadata size for pool of 64k blocks and 100M size", + cmd="thin_metadata_size -b64k -s100m -m1 -um -nshort", + command=run, + errors=errors) + + atomic_run("Outputting reverse map of metadata device", + source_vg=args["group"], + source_lv=args["swap"], + region="0..-1", + command=dmpd.thin_rmap, + errors=errors) + + # this fails now and it should not + # atomic_run("Discarding free space of pool", + # target_vg=args["group"], + # target_lv=args["swap"], + # command=dmpd.thin_trim, + # errors=errors) + + atomic_run("Dumping metadata to file", + formatting="xml", + source_vg=args["group"], + source_lv=args["swap"], + repair=True, + output="/tmp/metadata", + command=dmpd.thin_dump, + errors=errors) + + atomic_run("Dumping metadata to file from snapshot", + formatting="xml", + source_vg=args["group"], + source_lv=args["swap"], + snapshot=True, + output="/tmp/metadata_snap", + command=dmpd.thin_dump, + errors=errors) + + atomic_run("Getting differences between thin LVs", + source_vg=args["group"], + source_lv=args["swap"], + thin1=1, + thin2=args["number of vols"] - 1, + snapshot=True, + command=dmpd.thin_delta, + errors=errors) + + atomic_run("Getting differences between thin LVs with --verbose", + source_vg=args["group"], + source_lv=args["swap"], + thin1=1, + thin2=args["number of vols"] - 1, + verbosity=True, + snapshot=True, + command=dmpd.thin_delta, + errors=errors) + + atomic_run("Getting differences between the same LV", + source_vg=args["group"], + source_lv=args["swap"], + thin1=1, + thin2=1, + snapshot=True, + command=dmpd.thin_delta, + errors=errors) + + atomic_run("Getting differences between the same LV with --verbose", + source_vg=args["group"], + source_lv=args["swap"], + thin1=1, + thin2=1, + verbosity=True, + snapshot=True, + command=dmpd.thin_delta, + errors=errors) + + atomic_run("Listing metadata output from snapshot", + source_vg=args["group"], + source_lv=args["swap"], + snapshot=True, + command=dmpd.thin_ls, + errors=errors) + + # Need to run everything on snapshot before this as thin_restore removes the metadata snapshot + # This should work but is not working due to a bug + #atomic_run("Restoring metadata", + # source_file="/tmp/metadata_snap", + # target_vg=args["group"], + # target_lv=args["swap"], + # command=dmpd.thin_restore, + # errors=errors) + + atomic_run("Restoring metadata", + source_file="/tmp/metadata", + target_vg=args["group"], + target_lv=args["swap"], + command=dmpd.thin_restore, + errors=errors) + + # Repairing from non-binary file leads to segmentation fault + #atomic_run("Repairing metadata from file", + # source_file="/tmp/metadata", + # target_vg=args["group"], + # target_lv=args["swap"], + # command=dmpd.thin_repair, + # errors=errors) + + atomic_run("Repairing metadata to file", + target_file="/tmp/metadata_repair", + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.thin_repair, + errors=errors) + + atomic_run("Repairing metadata from file", + source_file="/tmp/metadata_repair", + target_vg=args["group"], + target_lv=args["swap"], + command=dmpd.thin_repair, + errors=errors) + + atomic_run("Checking metadata", + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.thin_check, + errors=errors) + + print("\n#######################################\n") + + if len(errors) == 0: + TC.tpass("Testing thin tools of device_mapper_persistent_data passed") + else: + TC.tfail("Testing thin tools of device_mapper_persistent_data failed with following errors: \n\t'" + + "\n\t ".join([str(i) for i in errors])) + return 1 + return 0 + + +def thin_errors_test(args): + print("\n#######################################\n") + print ( + "INFO: Testing thin tools errors provided by device_mapper_persistent_data") + + errors = [] + + # "thin_show_duplicates" does not work yet + functions = ["thin_check", "thin_delta", "thin_dump", "thin_ls", "thin_metadata_size", "thin_repair", + "thin_restore", "thin_rmap", "thin_trim"] + + # Sanity to check for missing input + for func in functions: + atomic_run("Validating missing input", + False, + cmd=func, + command=run, + errors=errors) + + # Sanity to check with wrong input + for func in functions: + atomic_run("Validating wrong input", + False, + cmd=func + " wrong", + command=run, + errors=errors) + + # Sanity to check with wrong option + for func in functions: + atomic_run("Validating wrong option", + False, + cmd=func + " -wrong", + command=run, + errors=errors) + + # Sanity to check present functions with -h + for func in functions: + atomic_run("Checking help of command", + cmd=func, + command=dmpd.get_help, + errors=errors) + + # Sanity to check present functions with -V + for func in functions: + # thin_metadata_size has wrong return value + if func == "thin_metadata_size": + continue + atomic_run("Checking version of command", + cmd=func, + command=dmpd.get_version, + errors=errors) + + atomic_run("Checking original pool metadata, should fail", + False, + source_vg=args["group"], + source_lv=args["pool"], + command=dmpd.thin_check, + errors=errors) + + atomic_run("Listing information about thin LVs", + False, + cmd="thin_ls /dev/mapper/%s-%s --format \"WRONG\"" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Checking thin_metadata_size inputs", + False, + cmd="thin_metadata_size -b 64", + command=run, + errors=errors) + + atomic_run("Checking thin_metadata_size inputs", + False, + cmd="thin_metadata_size -b 64 -s 128", + command=run, + errors=errors) + + atomic_run("Checking thin_metadata_size inputs", + False, + cmd="thin_metadata_size -b 25 -s 128 -m 10", + command=run, + errors=errors) + + atomic_run("Checking thin_metadata_size inputs", + False, + cmd="thin_metadata_size -b 128 -s 64 -m 10", + command=run, + errors=errors) + + atomic_run("Checking thin_metadata_size inputs", + False, + cmd="thin_metadata_size -u h", + command=run, + errors=errors) + + atomic_run("Checking thin_metadata_size inputs", + False, + cmd="thin_metadata_size -n -n", + command=run, + errors=errors) + + atomic_run("Checking thin_metadata_size inputs", + False, + cmd="thin_metadata_size -nlongshort", + command=run, + errors=errors) + + atomic_run("Checking thin_metadata_size inputs", + False, + cmd="thin_metadata_size -b 128 -b 64", + command=run, + errors=errors) + + atomic_run("Repairing metadata without output", + False, + cmd="thin_repair -i /tmp/metadata_repair", + command=run, + errors=errors) + + atomic_run("Dumping metadata with wrong custom format", + False, + cmd="thin_dump /dev/mapper/%s-%s --format custom=wrong" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Dumping metadata with unknown format", + False, + cmd="thin_dump /dev/mapper/%s-%s --format wrong" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Dumping metadata with wrong dev-id", + False, + cmd="thin_dump /dev/mapper/%s-%s --dev-id wrong" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Repairing metadata to produce 'output file does not exist' error", + False, + cmd="thin_repair -i /dev/mapper/%s-%s -o /tmp/wrong.wrong" % + (args['group'], args['swap']), + command=run, + errors=errors) + + atomic_run("Repairing metadata to produce 'output file too small' error", + False, + cmd="thin_repair -i /tmp/metadata -o /tmp/metadata", + command=run, + errors=errors) + + # This does not fail now due to a bug + #atomic_run("Outputting reverse map of metadata device, should fail without region", + # cmd="thin_rmap /dev/mapper/%s-%s" % (args["group"], args["swap"]), + # command=run, + # errors=errors) + + atomic_run("Outputting reverse map of metadata device with wrong region", + False, + cmd="thin_rmap /dev/mapper/%s-%s --region 0..0" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Outputting reverse map of metadata device with wrong region", + False, + cmd="thin_rmap /dev/mapper/%s-%s --region 0...1" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Outputting reverse map of metadata device with wrong region", + False, + cmd="thin_rmap /dev/mapper/%s-%s --region 00" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Outputting reverse map of metadata device with wrong device", + False, + cmd="thin_rmap --region 0..-1 /tmp/wrong.wrong", + command=run, + errors=errors) + + # Reverse mapping from bad file leads to segmentation fault + #atomic_run("Outputting reverse map of metadata device with wrong device", + # False, + # cmd="thin_rmap --region 0..-1 /tmp/metadata", + # command=run, + # errors=errors) + + atomic_run("Getting differences with thin1 ID out of range", + False, + source_vg=args["group"], + source_lv=args["swap"], + thin1=-1, + thin2=args["number of vols"] - 1, + command=dmpd.thin_delta, + errors=errors) + + atomic_run("Getting differences with thin2 ID out of range", + False, + source_vg=args["group"], + source_lv=args["swap"], + thin1=1, + thin2=args["number of vols"] + 1, + command=dmpd.thin_delta, + errors=errors) + + atomic_run("Restoring metadata without output", + False, + cmd="thin_restore -i /tmp/metadata", + command=run, + errors=errors) + + atomic_run("Restoring metadata with wrong options", + False, + cmd="thin_restore -i /tmp/metadata -o /dev/mapper/%s-%s --wrong test" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Restoring metadata with wrong source", + False, + cmd="thin_restore -i /tmp/wrong.wrong -o /dev/mapper/%s-%s" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Getting differences without thin2", + False, + cmd="thin_delta --thin1 1 /dev/mapper/%s-%s" % + (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Corrupting metadata on device", + cmd="echo 'nothing' >> /dev/mapper/%s-%s" % + (args['group'], args['swap']), + command=run, + errors=errors) + + atomic_run("Trying to fail while repairing metadata", + False, + source_vg=args['group'], + source_lv=args['swap'], + target_file="/tmp/metadata_repair", + command=dmpd.thin_repair, + errors=errors) + + atomic_run("Trying to fail listing volumes", + False, + source_vg=args['group'], + source_lv=args['swap'], + command=dmpd.thin_ls, + errors=errors) + + atomic_run("Trying to fail while checking metadata", + False, + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.thin_check, + errors=errors) + + atomic_run("Trying to fail while dumping metadata from snapshot", + False, + formatting="human_readable", + source_vg=args["group"], + source_lv=args["swap"], + snapshot=True, + command=dmpd.thin_dump, + errors=errors) + + # restoring metadata device after corrupting it + atomic_run("Repairing metadata device", + source_file="/tmp/metadata", + target_vg=args["group"], + target_lv=args["swap"], + quiet=True, + command=dmpd.thin_restore, + errors=errors) + + print("\n#######################################\n") + + if len(errors) == 0: + TC.tpass("Testing thin tools errors of device_mapper_persistent_data passed") + else: + TC.tfail("Testing thin tools errors of device_mapper_persistent_data failed with following errors: \n\t'" + + "\n\t ".join([str(i) for i in errors])) + return 1 + return 0 + + +def cache_init(args): + print("INFO: Initializing test case") + errors = [] + + atomic_run("Creating loopdev 1 - 'fast' device", + name=args["loop1"], + size=args["loop1_size"], + command=loopdev.create_loopdev, + errors=errors) + + atomic_run("Creating loopdev 2 - 'slow' device", + name=args["loop2"], + size=args["loop2_size"], + command=loopdev.create_loopdev, + errors=errors) + + atomic_run("Creating VG", + vg_name=args["group"], + pv_name="/dev/" + args["loop1"] + + " /dev/" + args["loop2"], + command=lvm.vg_create, + errors=errors) + + atomic_run("Creating cache metadata volume", + vg_name=args["group"] + " /dev/" + args["loop1"], + lv_name=args["meta"], + options=["-L 12"], + command=lvm.lv_create, + errors=errors) + + atomic_run("Creating origin volume", + vg_name=args["group"] + " /dev/" + args["loop2"], + lv_name=args["origin"], + options=["-L 2G"], + command=lvm.lv_create, + errors=errors) + + atomic_run("Creating cache data volume", + vg_name=args["group"] + " /dev/" + args["loop1"], + lv_name=args["data"], + options=["-L 1G"], + command=lvm.lv_create, + errors=errors) + + atomic_run("Creating cache pool", + vg_name=args["group"], + lv_name=args["data"], + options=["-y --type cache-pool", "--cachemode writeback", "--poolmetadata %s/%s" % + (args["group"], args["meta"])], + command=lvm.lv_convert, + errors=errors) + + atomic_run("Creating cache logical volume", + vg_name=args["group"], + lv_name=args["origin"], + options=["-y", "--type cache", "--cachepool %s/%s" % + (args["group"], args["data"])], + command=lvm.lv_convert, + errors=errors) + + atomic_run("Creating filesystem on cache logical volume", + vg_name=args["group"], + lv_name=args["origin"], + command=create_filesystem, + errors=errors) + + atomic_run("Splitting cache logical volume", + vg_name=args["group"], + lv_name=args["origin"], + options=["-y", "--splitcache"], + command=lvm.lv_convert, + errors=errors) + + atomic_run("Creating swap LV", + vg_name=args["group"], + lv_name=args["swap"], + options=["-L 100"], + command=lvm.lv_create, + errors=errors) + + atomic_run("Swapping metadata", + vg_name=args["group"], + lv_name=args["swap"], + options=["-y", "--cachepool " + args["group"] + "/" + args["data"], + "--poolmetadata "], + command=lvm.lv_convert, + errors=errors) + + atomic_run("Activating swap", + lv_name=args["swap"], + vg_name=args["group"], + command=lvm.lv_activate, + errors=errors) + + if len(errors) == 0: + TC.tpass("Initialization passed") + else: + TC.tfail("Initialization failed with following errors: \n\t'" + + "\n\t ".join([str(i) for i in errors])) + return 1 + return 0 + + +def cache_clean(args): + print("INFO: Cleaning up") + errors = [] + + atomic_run("Removing VG", + vg_name=args["group"], + force=True, + command=lvm.vg_remove, + errors=errors) + + atomic_run("Deleting loopdev loop1", + name=args["loop1"], + command=loopdev.delete_loopdev, + errors=errors) + + atomic_run("Deleting loopdev loop2", + name=args["loop2"], + command=loopdev.delete_loopdev, + errors=errors) + + atomic_run("Deleting metadata file", + cmd="rm -f /tmp/metadata", + command=run, + errors=errors) + + atomic_run("Deleting repair metadata file", + cmd="rm -f /tmp/metadata_repair", + command=run, + errors=errors) + + if len(errors) == 0: + TC.tpass("Cleanup passed") + else: + TC.tfail("Cleanup failed with following errors: \n\t'" + + "\n\t ".join([str(i) for i in errors])) + print(errors) + return 1 + return 0 + + +def cache_test(args): + print("\n#######################################\n") + print ("INFO: Testing cache tools runtime provided by device_mapper_persistent_data") + + errors = [] + + atomic_run("Checking metadata", + source_lv=args["swap"], + source_vg=args["group"], + command=dmpd.cache_check, + errors=errors) + + atomic_run("Checking metadata with clear-need-check-flag", + source_lv=args["swap"], + source_vg=args["group"], + clear_needs_check_flag=True, + command=dmpd.cache_check, + errors=errors) + + atomic_run("Checking metadata with super-block-only", + source_lv=args["swap"], + source_vg=args["group"], + super_block_only=True, + command=dmpd.cache_check, + errors=errors) + + atomic_run("Checking metadata with few paramethers", + source_vg=args["group"], + source_lv=args["swap"], + skip_discards=True, + skip_mappings=True, + skip_hints=True, + command=dmpd.cache_check, + errors=errors) + + atomic_run("Dumping metadata to standard output", + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.cache_dump, + errors=errors) + + atomic_run("Calculating metadata size for cache of 64 blocks and 128 size", + cmd="cache_metadata_size --block-size 64 --device-size 128", + command=run, + errors=errors) + + atomic_run("Calculating metadata size for cache of 128 nr blocks", + cmd="cache_metadata_size --nr-blocks 128 --max-hint-width 4", + command=run, + errors=errors) + + atomic_run("Dumping metadata to file", + source_vg=args["group"], + source_lv=args["swap"], + repair=True, + output="/tmp/metadata", + command=dmpd.cache_dump, + errors=errors) + + # Not yet in Fedora 26, shoud be in F27 + #atomic_run("Checking metadata file", + # source_file="/tmp/metadata", + # command=dmpd.cache_check, + # errors=errors) + # + #atomic_run("Restoring metadata with options", + # source_file="/tmp/metadata", + # target_vg=args["group"], + # target_lv=args["swap"], + # quiet=True, + # override_metadata_version=1, + # metadata_version=1, + # command=dmpd.cache_restore, + # errors=errors) + + atomic_run("Restoring metadata from file", + source_file="/tmp/metadata", + target_vg=args["group"], + target_lv=args["swap"], + command=dmpd.cache_restore, + errors=errors) + + atomic_run("Repairing metadata to file", + target_file="/tmp/metadata_repair", + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.cache_repair, + errors=errors) + + atomic_run("Repairing metadata from file", + source_file="/tmp/metadata_repair", + target_vg=args["group"], + target_lv=args["swap"], + command=dmpd.cache_repair, + errors=errors) + + atomic_run("Simulating TTY for cache_restore", + cmd="script --return -c 'cache_restore -i /tmp/metadata -o /dev/mapper/%s-%s' /dev/null" % + (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Checking metadata", + source_vg=args["group"], + source_lv=args["swap"], + quiet=True, + command=dmpd.cache_check, + errors=errors) + + print("\n#######################################\n") + + if len(errors) == 0: + TC.tpass("Testing cache tools of device_mapper_persistent_data passed") + else: + TC.tfail("Testing cache tools of device_mapper_persistent_data failed with following errors: \n\t'" + + "\n\t ".join([str(i) for i in errors])) + return 1 + return 0 + + +def cache_errors_test(args): + print("\n#######################################\n") + print ("INFO: Testing cache tools errors provided by device_mapper_persistent_data") + + errors = [] + + functions = ["cache_check", "cache_dump", "cache_metadata_size", "cache_repair", "cache_restore"] + + # Sanity to check for missing input + for func in functions: + atomic_run("Validating missing input", + False, + cmd=func, + command=run, + errors=errors) + + # Sanity to check with wrong input + for func in functions: + atomic_run("Validating wrong input", + False, + cmd=func + " wrong", + command=run, + errors=errors) + + # Sanity to check with wrong option + for func in functions: + atomic_run("Validating wrong option", + False, + cmd=func + " -wrong", + command=run, + errors=errors) + + # Sanity to check with wrong -- option + for func in functions: + atomic_run("Validating wrong -- option", + False, + cmd=func + " --wrong", + command=run, + errors=errors) + + # Sanity to check present functions with -h + for func in functions: + atomic_run("Checking help of command", + cmd="%s" % func, + command=dmpd.get_help, + errors=errors) + + # Sanity to check present functions with -V + for func in functions: + atomic_run("Checking version of command", + cmd="%s" % func, + command=dmpd.get_version, + errors=errors) + + atomic_run("Checking metadata of non-metadata file", + False, + cmd="cache_check README", + command=run, + errors=errors) + + atomic_run("Checking metadata of non-existent file", + False, + cmd="cache_check WRONG", + command=run, + errors=errors) + + atomic_run("Checking metadata of non-regular file", + False, + cmd="cache_check /dev/mapper/control", + command=run, + errors=errors) + + atomic_run("Calculating metadata size for cache of 64 blocks", + False, + cmd="cache_metadata_size --block-size 64", + command=run, + errors=errors) + + atomic_run("Calculating metadata size for cache of 128 size", + False, + cmd="cache_metadata_size --device-size 128", + command=run, + errors=errors) + + atomic_run("Calculating metadata size for cache of 64 blocks and 128 size and 128 nr blocks", + False, + cmd="cache_metadata_size --block-size 64 --device-size 128 --nr-blocks 128", + command=run, + errors=errors) + + atomic_run("Repairing metadata without output", + False, + cmd="cache_repair -i /tmp/metadata_repair", + command=run, + errors=errors) + + atomic_run("Restoring metadata with wrong options", + False, + cmd="cache_restore -i /tmp/metadata -o /dev/mapper/%s-%s --wrong test" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Restoring metadata with wrong metadata version", + False, + source_file="/tmp/metadata", + target_vg=args["group"], + target_lv=args["swap"], + metadata_version=12445, + command=dmpd.cache_restore, + errors=errors) + + atomic_run("Restoring metadata with wrong source", + False, + cmd="cache_restore -i /tmp/wrong.wrong -o /dev/mapper/%s-%s" % (args["group"], args["swap"]), + command=run, + errors=errors) + + atomic_run("Restoring metadata with bit source", + False, + source_file="/tmp/metadata_repair", + target_vg=args["group"], + target_lv=args["swap"], + command=dmpd.cache_restore, + errors=errors) + + atomic_run("Restoring metadata without output", + False, + cmd="cache_restore -i /tmp/metadata", + command=run, + errors=errors) + + # I am not able to run cache_restore with --omit-clean-shutdown successfully + #atomic_run("Restoring metadata with options", + # source_file="/tmp/metadata", + # target_vg=args["group"], + # target_lv=args["swap"], + # omit_clean_shutdown=True, + # command=dmpd.cache_restore, + # errors=errors) + + # This fails in Fedora 26, should work in F27 + #atomic_run("Checking metadata", + # source_vg=args["group"], + # source_lv=args["swap"], + # command=dmpd.cache_check, + # errors=errors) + + #FIXME: Find other way to corrupt metadata, this exploits a bug + atomic_run("Corrupting mappings on metadata device", + False, + source_file="Makefile", + target_vg=args["group"], + target_lv=args["swap"], + command=dmpd.cache_restore, + errors=errors) + + atomic_run("Checking corrupted mappings", + False, + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.cache_check, + errors=errors) + + atomic_run("Trying to fail while dumping metadata", + False, + source_vg=args['group'], + source_lv=args['swap'], + output="/tmp/metadata", + command=dmpd.cache_dump, + errors=errors) + + atomic_run("Repairing metadata", + source_vg=args['group'], + source_lv=args['swap'], + target_file="/tmp/metadata_repair", + command=dmpd.cache_repair, + errors=errors) + + atomic_run("Corrupting metadata on device", + cmd="echo 'nothing' >> /dev/mapper/%s-%s" % (args['group'], args['swap']), + command=run, + errors=errors) + + atomic_run("Trying to fail while repairing metadata", + False, + source_vg=args['group'], + source_lv=args['swap'], + target_file="/tmp/metadata_repair", + command=dmpd.cache_repair, + errors=errors) + + atomic_run("Trying to fail while dumping metadata", + False, + source_vg=args['group'], + source_lv=args['swap'], + output="/tmp/metadata", + command=dmpd.cache_dump, + errors=errors) + + atomic_run("Checking corrupted metadata", + False, + source_vg=args["group"], + source_lv=args["swap"], + command=dmpd.cache_check, + errors=errors) + + + print("\n#######################################\n") + + if len(errors) == 0: + TC.tpass("Testing cache tools errors of device_mapper_persistent_data passed") + else: + TC.tfail("Testing cache tools errors of device_mapper_persistent_data failed with following errors: \n\t'" + + "\n\t ".join([str(i) for i in errors])) + return 1 + return 0 + + +def main(): + # Initialize Test Case + global TC + TC = TestClass() + + # Initialize library classes + global loopdev + global lvm + global dmpd + loopdev = LoopDev() + lvm = LVM() + dmpd = DMPD() + + args = {"loop1": "loop1", + "loop1_size": 2048, + "loop2": "loop2", + "loop2_size": 4128, + "group": "vgtest", + "origin": "origin", + "data": "cache_data", + "meta": "cache_meta", + "pool": "pool", + "vol": "thinvol", + "number of vols": 10, + "swap": "swapvol"} + + # Initialization + install_package("device-mapper-persistent-data") + + # Tests for thin tools provided by device-mapper-persistent-data + thin_init(args) + thin_test(args) + thin_errors_test(args) + thin_clean(args) + + # Tests for cache tools provided by device-mapper-persistent-data + cache_init(args) + cache_test(args) + cache_errors_test(args) + cache_clean(args) + + if not TC.tend(): + print "FAIL: test failed" + sys.exit(1) + + print "PASS: Test pass" + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git a/tests/functions_test/dmpd_library.py b/tests/functions_test/dmpd_library.py new file mode 100755 index 0000000..e8f1ed9 --- /dev/null +++ b/tests/functions_test/dmpd_library.py @@ -0,0 +1,2368 @@ +#!/usr/bin/python + +# Copyright (c) 2017 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; If not, see http://www.gnu.org/licenses/. +# +# Author: Jakub Krysl + +"""dmpd_library.py: Complete library providing functionality for device-mapper-persistent-data upstream test.""" + +import platform +from os.path import expanduser +import re #regex +import sys, os +import subprocess +import time +import fileinput + + +def _print(string): + module_name = __name__ + string = re.sub("DEBUG:", "DEBUG:("+ module_name + ") ", string) + string = re.sub("FAIL:", "FAIL:("+ module_name + ") ", string) + string = re.sub("FATAL:", "FATAL:("+ module_name + ") ", string) + string = re.sub("WARN:", "WARN:("+ module_name + ") ", string) + print(string) + return + + +def run(cmd, return_output=False, verbose=True, force_flush=False): + """Run a command line specified as cmd. + The arguments are: + \tcmd (str): Command to be executed + \tverbose: if we should show command output or not + \tforce_flush: if we want to show command output while command is being executed. eg. hba_test run + \treturn_output (Boolean): Set to True if want output result to be returned as tuple. Default is False + Returns: + \tint: Return code of the command executed + \tstr: As tuple of return code if return_output is set to True + """ + #by default print command output + if (verbose == True): + #Append time information to command + date = "date \"+%Y-%m-%d %H:%M:%S\"" + p = subprocess.Popen(date, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + stdout, stderr = p.communicate() + stdout = stdout.rstrip("\n") + _print("INFO: [%s] Running: '%s'..." % (stdout, cmd)) + + #enabling shell=True, because was the only way I found to run command with '|' + if not force_flush: + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + stdout, stderr = p.communicate() + sys.stdout.flush() + sys.stderr.flush() + else: + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) + stdout = "" + stderr = "" + while p.poll() is None: + new_data = p.stdout.readline() + stdout += new_data + if verbose: + sys.stdout.write(new_data) + sys.stdout.flush() + + retcode = p.returncode + + output = stdout + stderr + + #remove new line from last line + output = output.rstrip() + + #by default print command output + #if force_flush we already printed it + if verbose == True and not force_flush: + print(output) + + if return_output == False: + return retcode + else: + return retcode, output + + +def atomic_run(message, success=True, return_output=False, **kwargs): + errors = kwargs.pop("errors") + command = kwargs.pop("command") + params = [] + for a in kwargs: + params.append(str(a) + " = " + str(kwargs[a])) + params = ", ".join([str(i) for i in params]) + _print("\nINFO: " + message + " with params %s" % params) + if return_output: + kwargs["return_output"] = True + ret, output = command(**kwargs) + else: + ret = command(**kwargs) + expected_break = {True: False, False: True} + print("(Returned, Expected)") + if command == run: + expected_break = {True: 1, False: 0} + if ret in expected_break: + print(not expected_break[ret], success) + else: + print(ret, success) + else: + print(ret, success) + if ret == expected_break[success]: + error = "FAIL: " + message + " with params %s failed" % params + _print(error) + errors.append(error) + sleep(0.2) + if return_output: + return output + else: + return ret + + +def sleep(duration): + """ + It basically call sys.sleep, but as stdout and stderr can be buffered + We flush them before sleep + """ + sys.stdout.flush() + sys.stderr.flush() + time.sleep(duration) + return + + +def mkdir(new_dir): + if os.path.isdir(new_dir): + _print("INFO: %s already exist" % new_dir) + return True + cmd = "mkdir -p %s" % new_dir + retcode, output = run(cmd, return_output=True, verbose=False) + if retcode != 0: + _print("WARN: could create directory %s" % new_dir) + print(output) + return False + return True + + +def dist_release(): + """ + Find out the release number of Linux distribution. + """ + dist = platform.linux_distribution() + if not dist or dist[1] == "": + _print("WARN: dist_release() - Could not determine dist release") + return None + return dist[1] + + +def dist_ver(): + """ + Check the Linux distribution version. + """ + release = dist_release() + if not release: + return None + m = re.match("(\d+).\d+", release) + if m: + return int(m.group(1)) + + # See if it is only digits, in that case return it + m = re.match("(\d+)", release) + if m: + return int(m.group(1)) + + _print("WARN: dist_ver() - Invalid release output %s" % release) + return None + + +def show_sys_info(): + print("### Kernel Info: ###") + ret, kernel = run ("uname -a", return_output=True, verbose=False) + ret, taint_val = run("cat /proc/sys/kernel/tainted", return_output=True, verbose=False) + print("Kernel version: %s" % kernel) + print("Kernel tainted: %s" % taint_val) + print("### IP settings: ###") + run("ip a") + + if run("rpm -q device-mapper-multipath") == 0: + #Abort test execution if multipath is not working well + if run("multipath -l 2>/dev/null") != 0: + sys.exit(1) + #Flush all unused multipath devices before starting the test + run("multipath -F") + run("multipath -r") + + +def get_free_space(path): + """ + Get free space of a path. + Path could be: + \t/dev/sda + \t/root + \t./ + """ + if not path: + return None + + cmd = "df -B 1 %s" % (path) + retcode, output = run(cmd, return_output=True, verbose=False) + if retcode != 0: + _print("WARN: get_free_space() - could not run %s" % (cmd)) + print(output) + return None + fs_list = output.split("\n") + # delete the header info + del fs_list[0] + + if len(fs_list) > 1: + #Could be the information was too long and splited in lines + tmp_info = "".join(fs_list) + fs_list[0] = tmp_info + + #expected order + #Filesystem 1B-blocks Used Available Use% Mounted on + free_space_regex = re.compile("\S+\s+\d+\s+\d+\s+(\d+)") + m = free_space_regex.search(fs_list[0]) + if m: + return int(m.group(1)) + return None + + +def size_human_2_size_bytes(size_human): + """ + Usage + size_human_2_size_bytes(size_human) + Purpose + Convert human readable stander size to B + Parameter + size_human # like '1KiB' + Returns + size_bytes # like 1024 + """ + if not size_human: + return None + + # make sure size_human is a string, could be only numbers, for example + size_human = str(size_human) + if not re.search("\d", size_human): + # Need at least 1 digit + return None + + size_human_regex = re.compile("([\-0-9\.]+)(Ki|Mi|Gi|Ti|Ei|Zi){0,1}B$") + m = size_human_regex.match(size_human) + if not m: + if re.match("^\d+$", size_human): + # Assume size is already in bytes + return size_human + _print("WARN: '%s' is an invalid human size format" % size_human) + return None + + number = None + fraction = 0 + # check if number is fractional + f = re.match("(\d+)\.(\d+)", m.group(1)) + if f: + number = int(f.group(1)) + fraction = int(f.group(2)) + else: + number = int(m.group(1)) + + unit = m.group(2) + if not unit: + unit = 'B' + + for valid_unit in ['B', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']: + if unit == valid_unit: + if unit == 'B': + # cut any fraction if was given, as it is not valid + return str(number) + return int(number + fraction) + number *= 1024 + fraction *= 1024 + fraction /= 10 + return int(number + fraction) + + +def size_bytes_2_size_human(num): + if not num: + return None + + #Even if we receive string we convert so we can process it + num = int(num) + for unit in ['B','KiB','MiB','GiB','TiB','PiB','EiB','ZiB']: + if abs(num) < 1024.0: + size_human = "%3.1f%s" % (num, unit) + #round it down removing decimal numbers + size_human = re.sub("\.\d+", "", size_human) + return size_human + num /= 1024.0 + #Very big number!! + size_human = "%.1f%s" % (num, 'Yi') + #round it down removing decimal numbers + size_human = re.sub("\.\d+", "", size_human) + return size_human + + +def install_package(pack): + """ + Install a package "pack" via `yum install -y ` + """ + #Check if package is already installed + ret, ver = run("rpm -q %s" % pack, verbose=False, return_output=True) + if ret == 0: + _print("INFO: %s is already installed (%s)" % (pack, ver)) + return True + + if run("yum install -y %s" % pack) != 0: + msg = "FAIL: Could not install %s" % pack + _print(msg) + return False + + _print("INFO: %s was successfully installed" % pack) + return True + + +def create_filesystem(vg_name, lv_name, filesystem="xfs"): + if filesystem not in ["xfs", "ext4", "btrfs"]: + _print("WARN: Unknown filesystem.") + return False + if run("mkfs.%s /dev/%s/%s" % (filesystem, vg_name, lv_name), verbose=True) != 0: + _print("WARN: Could not create filesystem %s on %s/%s" % (filesystem, vg_name, lv_name)) + return False + return True + + +def metadata_snapshot(vg_name, lv_name): + if run("dmsetup suspend /dev/mapper/%s-%s-tpool" % (vg_name, lv_name), verbose=True) != 0: + _print("WARN: Device mapper could not suspend /dev/mapper/%s-%s-tpool" % (vg_name, lv_name)) + return False + if run("dmsetup message /dev/mapper/%s-%s-tpool 0 reserve_metadata_snap" % (vg_name, lv_name), verbose=True) != 0: + _print("WARN: Device mapper could not create metadata snaphot on /dev/mapper/%s-%s-tpool" % (vg_name, lv_name)) + return False + if run("dmsetup resume /dev/mapper/%s-%s-tpool" % (vg_name, lv_name), verbose=True) != 0: + _print("WARN: Device mapper could not resume /dev/mapper/%s-%s-tpool" % (vg_name, lv_name)) + return False + return True + + +class LogChecker: + def __init__(self): + segfault_msg = " segfault " + calltrace_msg = "Call Trace:" + self.error_mgs = [segfault_msg, calltrace_msg] + + def check_all(self): + """Check for error on the system + Returns: + \tBoolean: + \t\tTrue is no error was found + \t\tFalse if some error was found + """ + _print("INFO: Checking for error on the system") + error = 0 + + if not self.kernel_check(): + error += 1 + if not self.abrt_check(): + error += 1 + if not self.messages_dump_check(): + error += 1 + if not self.dmesg_check(): + error += 1 + if not self.console_log_check(): + error += 1 + if not self.kdump_check(): + error += 1 + + if error: + log_messages = "/var/log/messages" + if os.path.isfile(log_messages): + print("submit %s, named messages.log" % log_messages) + run("cp %s messages.log" % log_messages) + run("rhts-submit-log -l messages.log") + + _print("INFO: Umounting NFS to avoid sosreport being hang there") + run("umount /var/crash") + + + + ret_code = run("which sosreport", verbose=False) + if ret_code != 0: + _print("WARN: sosreport is not installed") + _print("INFO: Mounting NFS again") + run("mount /var/crash") + return False + + print("Generating sosreport log") + disable_plugin = "" + if run("sosreport --list-plugins | grep emc") == 0: + disable_plugin = "-n emc" + ret_code, sosreport_log = run("sosreport --batch %s" % disable_plugin, return_output=True) + if ret_code != 0: + _print("WARN: sosreport command failed") + _print("INFO: Mounting NFS again") + run("mount /var/crash") + return False + + sos_lines = sosreport_log.split("\n") + sos_file = None + for line in sos_lines: + #In RHEL7 sosreport is saving under /var/tmp while RHEL6 uses /tmp... + m = re.match(r"\s+((\/var)?\/tmp\/sosreport\S+)", line) + if m: + sos_file = m.group(1) + if not sos_file: + _print("WARN: could not save sosreport log") + _print("INFO: Mounting NFS again") + run("mount /var/crash") + return False + + run("rhts-submit-log -l %s" % sos_file) + _print("INFO: Mounting NFS again") + run("mount /var/crash") + + return False + return True + + @staticmethod + def abrt_check(): + """Check if abrtd found any issue + Returns: + \tBoolean: + \t\tTrue no error was found + \t\tFalse some error was found + """ + _print("INFO: Checking abrt for error") + + if run("rpm -q abrt", verbose=False) != 0: + _print("WARN: abrt tool does not seem to be installed") + _print("WARN: skipping abrt check") + return True + + if run("pidof abrtd", verbose=False) != 0: + _print("WARN: abrtd is not running") + return False + + ret, log = run("abrt-cli list", return_output=True) + if ret != 0: + _print("WARN: abrt-cli command failed") + return False + + # We try to match for "Directory" to check if + # abrt-cli list is actually listing any issue + error = False + if log: + lines = log.split("\n") + for line in lines: + m = re.match(r"Directory:\s+(\S+)", line) + if m: + directory = m.group(1) + filename = directory + filename = filename.replace(":", "-") + filename += ".tar.gz" + run("tar cfzP %s %s" % (filename, directory)) + run("rhts-submit-log -l %s" % filename) + # if log is saved on beaker, it can be deleted from server + # it avoids next test from detecting this failure + run("abrt-cli rm %s" % directory) + error = True + + if error: + _print("WARN: Found abrt error") + return False + + _print("PASS: no Abrt entry has been found.") + return True + + @staticmethod + def kernel_check(): + """ + Check if kernel got tainted. + It checks /proc/sys/kernel/tainted which returns a bitmask. + The values are defined in the kernel source file include/linux/kernel.h, + and explained in kernel/panic.c + cd /usr/src/kernels/`uname -r`/ + Sources are provided by kernel-devel + Returns: + \tBoolean: + \t\tTrue if did not find any issue + \t\tFalse if found some issue + """ + _print("INFO: Checking for tainted kernel") + + previous_tainted_file = "/tmp/previous-tainted" + + ret, tainted = run("cat /proc/sys/kernel/tainted", return_output=True) + + tainted_val = int(tainted) + if tainted_val == 0: + run("echo %d > %s" % (tainted_val, previous_tainted_file), verbose=False) + _print("PASS: Kernel is not tainted.") + return True + + _print("WARN: Kernel is tainted!") + + if not os.path.isfile(previous_tainted_file): + run("echo 0 > %s" % previous_tainted_file, verbose=False) + ret, prev_taint = run("cat %s" % previous_tainted_file, return_output=True) + prev_taint_val = int(prev_taint) + if prev_taint_val == tainted_val: + _print("INFO: Kernel tainted has already been handled") + return True + + run("echo %d > %s" % (tainted_val, previous_tainted_file), verbose=False) + + # check all bits that are set + bit = 0 + while tainted_val != 0: + if tainted_val & 1: + _print("\tTAINT bit %d is set\n" % bit) + bit += 1 + # shift tainted value + tainted_val /= 2 + # List all tainted bits that are defined + print("List bit definition for tainted kernel") + run("cat /usr/src/kernels/`uname -r`/include/linux/kernel.h | grep TAINT_") + + found_issue = False + # try to find the module which tainted the kernel, tainted module have a mark between '('')' + ret, output = run("cat /proc/modules | grep -e '(.*)' | cut -d' ' -f1", return_output=True) + tainted_mods = output.split("\n") + # For example during iscsi async_events scst tool loads an unsigned module + # just ignores it, so we will ignore this tainted if there is no tainted + # modules loaded + if not tainted_mods: + _print("INFO: ignoring tainted as the module is not loaded anymore") + else: + ignore_modules = ["ocrdma", "nvme_fc", "nvmet_fc"] + for tainted_mod in tainted_mods: + if tainted_mod: + _print("INFO: The following module got tainted: %s" % tainted_mod) + run("modinfo %s" % tainted_mod) + # we are ignoring ocrdma module + if tainted_mod in ignore_modules: + _print("INFO: ignoring tainted on %s" % tainted_mod) + run("echo %d > %s" % (tainted_val, previous_tainted_file), verbose=False) + continue + found_issue = True + + run("echo %s > %s" % (tainted, previous_tainted_file), verbose=False) + if found_issue: + return False + + return True + + @staticmethod + def _date2num(date): + date_map = {"Jan": "1", + "Feb": "2", + "Mar": "3", + "Apr": "4", + "May": "5", + "Jun": "6", + "Jul": "7", + "Aug": "8", + "Sep": "9", + "Oct": "10", + "Nov": "11", + "Dec": "12"} + + date_regex = r"(\S\S\S)\s(\d+)\s(\d\d:\d\d:\d\d)" + m = re.match(date_regex, date) + month = date_map[m.group(1)] + day = str(m.group(2)) + # if day is a single digit, add '0' to begin + if len(day) == 1: + day = "0" + day + + hour = m.group(3) + hour = hour.replace(":", "") + + value = month + day + hour + + return value + + @staticmethod + def clear_dmesg(): + cmd = "dmesg --clear" + if dist_ver() < 7: + cmd = "dmesg -c" + run(cmd, verbose=False) + return True + + def messages_dump_check(self): + previous_time_file = "/tmp/previous-dump-check" + + log_msg_file = "/var/log/messages" + if not os.path.isfile(log_msg_file): + _print("WARN: Could not open %s" % log_msg_file) + return True + + log_file = open(log_msg_file) + log = log_file.read() + + begin_tag = "\\[ cut here \\]" + end_tag = "\\[ end trace " + + if not os.path.isfile(previous_time_file): + first_time = "Jan 01 00:00:00" + time = self._date2num(first_time) + run("echo %s > %s" % (time, previous_time_file)) + + # Read the last time test ran + ret, last_run = run("cat %s" % previous_time_file, return_output=True) + _print("INFO: Checking for stack dump messages after: %s" % last_run) + + # Going to search the file for text that matches begin_tag until end_tag + dump_regex = begin_tag + "(.*?)" + end_tag + m = re.findall(dump_regex, log, re.MULTILINE) + if m: + _print("INFO: Checking if it is newer than: %s" % last_run) + print(m.group(1)) + # TODO + + _print("PASS: No recent dump messages has been found.") + return True + + def dmesg_check(self): + """ + Check for error messages on dmesg ("Call Trace and segfault") + """ + _print("INFO: Checking for errors on dmesg.") + error = 0 + for msg in self.error_mgs: + ret, output = run("dmesg | grep -i '%s'" % msg, return_output=True) + if output: + _print("WARN: found %s on dmesg" % msg) + run("echo '\nINFO found %s Saving it\n'>> dmesg.log" % msg) + run("dmesg >> dmesg.log") + run("rhts-submit-log -l dmesg.log") + error = + 1 + self.clear_dmesg() + if error: + return False + + _print("PASS: No errors on dmesg have been found.") + return True + + def console_log_check(self): + """ + Checks for error messages on console log ("Call Trace and segfault") + """ + error = 0 + console_log_file = "/root/console.log" + prev_console_log_file = "/root/console.log.prev" + new_console_log_file = "/root/console.log.new" + + if not os.environ.get('LAB_CONTROLLER'): + _print("WARN: Could not find lab controller") + return True + + if not os.environ.get('RECIPEID'): + _print("WARN: Could not find recipe ID") + return True + + lab_controller = os.environ['LAB_CONTROLLER'] + recipe_id = os.environ['RECIPEID'] + + # get current console log + url = "http://%s:8000/recipes/%s/logs/console.log" % (lab_controller, recipe_id) + + if (run("wget -q %s -O %s" % (url, new_console_log_file)) != 0): + _print("INFO: Could not get console log") + # return sucess if could not get console.log + return True + + # if there was previous console log, we just check the new part + run("diff -N -n --unidirectional-new-file %s %s > %s" % ( + prev_console_log_file, new_console_log_file, console_log_file)) + + # backup the current full console.log + # next time we run the test we will compare just + # what has been appended to console.log + run("mv -f %s %s" % (new_console_log_file, prev_console_log_file)) + + _print("INFO: Checking for errors on %s" % console_log_file) + for msg in self.error_mgs: + ret, output = run("cat %s | grep -i '%s'" % (console_log_file, msg), return_output=True) + if output: + _print("INFO found %s on %s" % (msg, console_log_file)) + run("rhts-submit-log -l %s" % console_log_file) + error = + 1 + + if error: + return False + + _print("PASS: No errors on %s have been found." % console_log_file) + return True + + @staticmethod + def kdump_check(): + """ + Check for kdump error messages. + It assumes kdump is configured on /var/crash + """ + error = 0 + + previous_kdump_check_file = "/tmp/previous-kdump-check" + kdump_dir = "/var/crash" + ret, hostname = run("hostname", verbose=False, return_output=True) + + if not os.path.exists("%s/%s" % (kdump_dir, hostname)): + _print("INFO: No kdump log found for this server") + return True + + ret, output = run("ls -l %s/%s | awk '{print$9}'" % (kdump_dir, hostname), return_output=True) + kdumps = output.split("\n") + kdump_dates = [] + for kdump in kdumps: + if kdump == "": + continue + # parse on the date, remove the ip of the uploader + m = re.match(".*?-(.*)", kdump) + if not m: + _print("WARN: unexpected format for kdump (%s)" % kdump) + continue + date = m.group(1) + # Old dump were using "." + date = date.replace(r"\.", "-") + # replace last "-" with space to format date properly + index = date.rfind("-") + date = date[:index] + " " + date[index + 1:] + _print("INFO: Found kdump from %s" % date) + kdump_dates.append(date) + + # checks if a file to store last run exists, if not create it + if not os.path.isfile("%s" % previous_kdump_check_file): + # time in seconds + ret, time = run(r"date +\"\%s\"", verbose=False, return_output=True) + run("echo -n %s > %s" % (time, previous_kdump_check_file), verbose=False) + _print("INFO: kdump check is executing for the first time.") + _print("INFO: doesn't know from which date should check files.") + _print("PASS: Returning success.") + return True + + # Read the last time test ran + ret, previous_check_time = run("cat %s" % previous_kdump_check_file, return_output=True) + # just add new line to terminal because the file should not have already new line character + print("") + + for date in kdump_dates: + # Note %% is escape form to use % in a string + ret, kdump_time = run("date --date=\"%s\" +%%s" % date, return_output=True) + if ret != 0: + _print("WARN: Could not convert date %s" % date) + continue + + if not kdump_time: + continue + if (int(kdump_time) > int(previous_check_time)): + _print("WARN: Found a kdump log from %s (more recent than %s)" % (date, previous_check_time)) + _print("WARN: Check %s/%s" % (kdump_dir, hostname)) + error += 1 + + ret, time = run(r"date +\"\%s\"", verbose=False, return_output=True) + run("echo -n %s > %s" % (time, previous_kdump_check_file), verbose=False) + + if error: + return False + + _print("PASS: No errors on kdump have been found.") + return True + + +class TestClass: + #we currently support these exit code for a test case + tc_sup_status = {"pass" : "PASS: ", + "fail" : "ERROR: ", + "skip" : "SKIP: "} + tc_pass = [] + tc_fail = [] + tc_skip = [] #For some reason it did not execute + tc_results = [] #Test results stored in a list + + test_dir = "%s/.stqe-test" % expanduser("~") + test_log = "%s/test.log" % test_dir + + def __init__(self): + print("################################## Test Init ###################################") + self.log_checker = LogChecker() + if not os.path.isdir(self.test_dir): + mkdir(self.test_dir) + # read entries on test.log, there will be entries if tend was not called + # before starting a TC class again, usually if the test case reboots the server + if not os.path.isfile(self.test_log): + #running the test for the first time + show_sys_info() + #Track memory usage during test + run("free -b > init_mem.txt", verbose=False) + run("top -b -n 1 > init_top.txt", verbose=False) + else: + try: + f = open(self.test_log) + file_data = f.read() + f.close() + except: + _print("WARN: TestClass() could not read %s" % self.test_log) + return + finally: + f.close() + log_entries = file_data.split("\n") + #remove the file, once tlog is ran it will add the entries again... + run("rm -f %s" % (self.test_log), verbose=False) + if log_entries: + _print("INFO: Loading test result from previous test run...") + for entry in log_entries: + self.tlog(entry) + print("################################################################################") + return + + def tlog(self, string): + """print message, if message begins with supported message status + the test message will be added to specific test result array + """ + print(string) + if re.match(self.tc_sup_status["pass"], string): + self.tc_pass.append(string) + self.tc_results.append(string) + run("echo '%s' >> %s" % (string, self.test_log), verbose=False) + if re.match(self.tc_sup_status["fail"], string): + self.tc_fail.append(string) + self.tc_results.append(string) + run("echo '%s' >> %s" % (string, self.test_log), verbose=False) + if re.match(self.tc_sup_status["skip"], string): + self.tc_skip.append(string) + self.tc_results.append(string) + run("echo '%s' >> %s" % (string, self.test_log), verbose=False) + return None + + @staticmethod + def trun(cmd, return_output=False): + """Run the cmd and format the log. return the exitint status of cmd + The arguments are: + \tCommand to run + \treturn_output: if should return command output as well (Boolean) + Returns: + \tint: Command exit code + \tstr: command output (optional) + """ + return run(cmd, return_output) + + def tok(self, cmd, return_output=False): + """Run the cmd and expect it to pass. + The arguments are: + \tCommand to run + \treturn_output: if should return command output as well (Boolean) + Returns: + \tBoolean: return_code + \t\tTrue: If command excuted successfully + \t\tFalse: Something went wrong + \tstr: command output (optional) + """ + cmd_code = None + ouput = None + ret_code = None + if not return_output: + cmd_code = run(cmd) + else: + cmd_code, output = run(cmd, return_output) + + if cmd_code == 0: + self.tpass(cmd) + ret_code = True + else: + self.tfail(cmd) + ret_code = False + + if return_output: + return ret_code, output + else: + return ret_code + + def tnok(self, cmd, return_output=False): + """Run the cmd and expect it to fail. + The arguments are: + \tCommand to run + \treturn_output: if should return command output as well (Boolean) + Returns: + \tBoolean: return_code + \t\tFalse: If command excuted successfully + \t\tTrue: Something went wrong + \tstr: command output (optional) + """ + cmd_code = None + ouput = None + ret_code = None + if not return_output: + cmd_code = run(cmd) + else: + cmd_code, output = run(cmd, return_output) + + if cmd_code != 0: + self.tpass(cmd + " [exited with error, as expected]") + ret_code = True + else: + self.tfail(cmd + " [expected to fail, but it did not]") + ret_code = False + + if return_output: + return ret_code, output + else: + return ret_code + + def tpass(self, string): + """Will add PASS + string to test log summary + """ + self.tlog(self.tc_sup_status["pass"] + string) + return None + + def tfail(self, string): + """Will add ERROR + string to test log summary + """ + self.tlog(self.tc_sup_status["fail"] + string) + return None + + def tskip(self, string): + """Will add SKIP + string to test log summary + """ + self.tlog(self.tc_sup_status["skip"] + string) + return None + + def tend(self): + """It checks for error in the system and print test summary + Returns: + \tBoolean + \t\tTrue if all test passed and no error was found on server + \t\tFalse if some test failed or found error on server + """ + if self.log_checker.check_all(): + self.tpass("Search for error on the server") + else: + self.tfail("Search for error on the server") + + print("################################ Test Summary ##################################") + #Will print test results in order and not by test result order + for tc in self.tc_results: + print(tc) + + n_tc_pass = len(self.tc_pass) + n_tc_fail = len(self.tc_fail) + n_tc_skip = len(self.tc_skip) + print("#############################") + print("Total tests that passed: " + str(n_tc_pass)) + print("Total tests that failed: " + str(n_tc_fail)) + print("Total tests that skipped: " + str(n_tc_skip)) + print("################################################################################") + sys.stdout.flush() + #Added this sleep otherwise some of the prints were not being shown.... + sleep(1) + run("rm -f %s" % (self.test_log), verbose=False) + run("rmdir %s" % (self.test_dir), verbose=False) + + #If at least one test failed, return error + if n_tc_fail > 0: + return False + + return True + + +class LoopDev: + def __init__(self): + self.image_path = "/tmp" + + @staticmethod + def _get_loop_path(name): + loop_path = name + if "/dev/" not in name: + loop_path = "/dev/" + name + + return loop_path + + @staticmethod + def _get_image_file(name, image_path): + image_file = "%s/%s.img" % (image_path, name) + return image_file + + @staticmethod + def _standardize_name(name): + """ + Make sure use same standard for name, for example remove /dev/ from it if exists + """ + if not name: + _print("WARN: _standardize_name() - requires name as parameter") + return None + return name.replace("/dev/", "") + + def create_loopdev(self, name=None, size=1024): + """ + Create a loop device + Parameters: + \tname: eg. loop0 (optional) + \tsize: Size in MB (default: 1024MB) + """ + + ret_fail = False + if not name: + cmd = "losetup -f" + retcode, output = run(cmd, return_output=True, verbose=False) + if retcode != 0: + _print("WARN: Could not find free loop device") + print(output) + return None + name = output + ret_fail = None + name = self._standardize_name(name) + + fname = self._get_image_file(name, self.image_path) + _print("INFO: Creating loop device %s with size %d" % (fname, size)) + + _print("INFO: Checking if %s exists" % fname) + if not os.path.isfile(fname): + # make sure we have enough space to create the file + free_space_bytes = get_free_space(self.image_path) + # Convert the size given in megabytes to bytes + size_bytes = int(size_human_2_size_bytes("%sMiB" % size)) + if free_space_bytes <= size_bytes: + _print("WARN: Not enough space to create loop device with size %s" + % size_bytes_2_size_human(size_bytes)) + _print("available space: %s" % size_bytes_2_size_human(free_space_bytes)) + return ret_fail + _print("INFO: Creating file %s" % fname) + # cmd = "dd if=/dev/zero of=%s seek=%d bs=1M count=0" % (fname, size) + cmd = "fallocate -l %sM %s" % (size, fname) + try: + # We are just creating the file, not writting zeros to it + retcode = run(cmd) + if retcode != 0: + _print("command failed with code %s" % retcode) + _print("WARN: Could not create loop device image file") + return ret_fail + except OSError as e: + print >> sys.err, "command failed: ", e + return ret_fail + + loop_path = self._get_loop_path(name) + # detach loop device if it exists + self.detach_loopdev(loop_path) + + # Going to associate the file to the loopdevice + cmd = "losetup %s %s" % (loop_path, fname) + retcode = run(cmd) + if retcode != 0: + _print("WARN: Could not create loop device") + return ret_fail + + if ret_fail is None: + return loop_path + return True + + def delete_loopdev(self, name): + """ + Delete a loop device + Parameters: + \tname: eg. loop0 or /dev/loop0 + """ + if not name: + _print("WARN: delete_loopdev() - requires name parameter") + return False + + _print("INFO: Deleting loop device %s" % name) + name = self._standardize_name(name) + + loop_path = self._get_loop_path(name) + + # detach loop device if it exists + if not self.detach_loopdev(name): + _print("WARN: could not detach %s" % loop_path) + return False + + fname = self._get_image_file(name, self.image_path) + if os.path.isfile(fname): + cmd = "rm -f %s" % fname + retcode = run(cmd) + if retcode != 0: + _print("WARN: Could not delete loop device %s" % name) + return False + + # check if loopdev file is deleted as it sometimes remains + if os.path.isfile(fname): + _print("WARN: Deleted loop device file %s but it is still there" % fname) + return False + + return True + + @staticmethod + def get_loopdev(): + # example of output on rhel-6.7 + # /dev/loop0: [fd00]:396428 (/tmp/loop0.img) + retcode, output = run("losetup -a | awk '{print$1}'", return_output=True, verbose=False) + # retcode, output = run("losetup -l | tail -n +2", return_output=True, verbose=False) + if (retcode != 0): + _print("WARN: get_loopdev failed to execute") + print(output) + return None + + devs = None + if output: + devs = output.split("\n") + # remove the ":" character from all devices + devs = [d.replace(':', "") for d in devs] + + return devs + + def detach_loopdev(self, name=None): + cmd = "losetup -D" + if name: + devs = self.get_loopdev() + if not devs: + # No device was found + return False + + name = self._standardize_name(name) + + # Just try to detach if device is connected, otherwise ignore + # print "INFO: Checking if ", loop_path, " exists, to be detached" + dev_path = self._get_loop_path(name) + if dev_path in devs: + cmd = "losetup -d %s" % dev_path + else: + # if loop device does not exist just ignore it + return True + + # run losetup -D or -d + retcode = run(cmd) + if retcode != 0: + _print("WARN: Could not detach loop device") + return False + + return True + + +class LVM: + ########################################### + # VG section + ########################################### + @staticmethod + def vg_query(verbose=False): + """Query Volume Groups and return a dictonary with VG information for each VG. + The arguments are: + \tNone + Returns: + \tdict: Return a dictionary with VG info for each VG + """ + cmd = "vgs --noheadings --separator \",\"" + retcode, output = run(cmd, return_output=True, verbose=verbose) + if (retcode != 0): + _print("INFO: there is no VGs") + return None + vgs = output.split("\n") + + # format of VG info: name #PV #LV #SN Attr VSize VFree + vg_info_regex = "\s+(\S+),(\S+),(\S+),(.*),(.*),(.*),(.*)$" + + vg_dict = {} + for vg in vgs: + m = re.match(vg_info_regex, vg) + if not m: + continue + vg_info_dict = {"num_pvs": m.group(2), + "num_lvs": m.group(3), + "num_sn": m.group(4), # not sure what it is + "attr": m.group(5), + "vsize": m.group(6), + "vfree": m.group(7)} + vg_dict[m.group(1)] = vg_info_dict + + return vg_dict + + @staticmethod + def vg_create(vg_name, pv_name, force=False, verbose=True): + """Create a Volume Group. + The arguments are: + \tPV name + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + if not vg_name or not pv_name: + _print("WARN: vg_create requires vg_name and pv_name") + return False + + options = "" + if force: + options += "--force" + cmd = "vgcreate %s %s %s" % (options, vg_name, pv_name) + retcode = run(cmd, verbose=verbose) + if (retcode != 0): + # _print ("WARN: Could not create %s" % vg_name) + return False + return True + + def vg_remove(self, vg_name, force=False, verbose=True): + """Delete a Volume Group. + The arguments are: + \tVG name + \tforce (boolean) + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + if not vg_name: + _print("WARN: vg_remove requires vg_name") + return False + + vg_dict = self.vg_query() + if vg_name not in vg_dict.keys(): + _print("INFO: vg_remove - %s does not exist. Skipping..." % vg_name) + return True + + options = "" + if force: + options += "--force" + cmd = "vgremove %s %s" % (options, vg_name) + retcode = run(cmd, verbose=verbose) + if (retcode != 0): + return False + return True + + ########################################### + # LV section + ########################################### + @staticmethod + def lv_query(options=None, verbose=False): + """Query Logical Volumes and return a dictonary with LV information for each LV. + The arguments are: + \toptions: If not want to use default lvs output. Use -o for no default fields + Returns: + \tdict: Return a list with LV info for each LV + """ + # Use \",\" as separator, as some output might contain ',' + # For example, lvs -o modules on thin device returns "thin,thin-pool" + cmd = "lvs -a --noheadings --separator \\\",\\\"" + + # format of LV info: Name VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert + lv_info_regex = "\s+(\S+)\",\"(\S+)\",\"(\S+)\",\"(\S+)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)$" + + # default parameters returned by lvs -a + param_names = ["name", "vg_name", "attr", "size", "pool", "origin", "data_per", "meta_per", "move", "log", + "copy_per", "convert"] + + if options: + param_names = ["name", "vg_name"] + # need to change default regex + lv_info_regex = "\s+(\S+)\",\"(\S+)" + parameters = options.split(",") + for param in parameters: + lv_info_regex += "\",\"(.*)" + param_names.append(param) + lv_info_regex += "$" + cmd += " -o lv_name,vg_name,%s" % options + + retcode, output = run(cmd, return_output=True, verbose=verbose) + if (retcode != 0): + _print("INFO: there is no LVs") + return None + lvs = output.split("\n") + + lv_list = [] + for lv in lvs: + m = re.match(lv_info_regex, lv) + if not m: + _print("WARN: (%s) does not match lvs output format" % lv) + continue + lv_info_dict = {} + for index in xrange(len(param_names)): + lv_info_dict[param_names[index]] = m.group(index + 1) + lv_list.append(lv_info_dict) + + return lv_list + + def lv_info(self, lv_name, vg_name, options=None, verbose=False): + """ + Show information of specific LV + """ + if not lv_name or not vg_name: + _print("WARN: lv_info() - requires lv_name and vg_name as parameters") + return None + + lvs = self.lv_query(options=options, verbose=verbose) + + if not lvs: + return None + + for lv in lvs: + if (lv["name"] == lv_name and + lv["vg_name"] == vg_name): + return lv + return None + + @staticmethod + def lv_create(vg_name, lv_name, options=(""), verbose=True): + """Create a Logical Volume. + The arguments are: + \tVG name + \tLV name + \toptions + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + if not vg_name or not lv_name: + _print("WARN: lv_create requires vg_name and lv_name") + return False + + cmd = "lvcreate %s %s -n %s" % (" ".join(str(i) for i in options), vg_name, lv_name) + retcode = run(cmd, verbose=verbose) + if (retcode != 0): + # _print ("WARN: Could not create %s" % lv_name) + return False + return True + + @staticmethod + def lv_activate(lv_name, vg_name, verbose=True): + """Activate a Logical Volume + The arguments are: + \tLV name + \tVG name + Returns: + \tBoolean: + \t\tTrue in case of success + \t\tFalse if something went wrong + """ + if not lv_name or not vg_name: + _print("WARN: lv_activate requires lv_name and vg_name") + return False + + cmd = "lvchange -ay %s/%s" % (vg_name, lv_name) + retcode = run(cmd, verbose=verbose) + if (retcode != 0): + _print("WARN: Could not activate LV %s" % lv_name) + return False + + # Maybe we should query the LVs and make sure it is really activated + return True + + @staticmethod + def lv_deactivate(lv_name, vg_name, verbose=True): + """Deactivate a Logical Volume + The arguments are: + \tLV name + \tVG name + Returns: + \tBoolean: + \t\tTrue in case of success + \t\tFalse if something went wrong + """ + if not lv_name or not vg_name: + _print("WARN: lv_deactivate requires lv_name and vg_name") + return False + + cmd = "lvchange -an %s/%s" % (vg_name, lv_name) + retcode = run(cmd, verbose=verbose) + if (retcode != 0): + _print("WARN: Could not deactivate LV %s" % lv_name) + return False + + # Maybe we should query the LVs and make sure it is really deactivated + return True + + def lv_remove(self, lv_name, vg_name, verbose=True): + """Remove an LV from a VG + The arguments are: + \tLV name + \tVG name + Returns: + \tBoolean: + \t\tTrue in case of success + \t\tFalse if something went wrong + """ + if not lv_name or not vg_name: + _print("WARN: lv_remove requires lv_name and vg_name") + return False + + lvs = self.lv_query() + + lv_names = lv_name.split() + + for lv_name in lv_names: + if not self.lv_info(lv_name, vg_name): + _print("INFO: lv_remove - LV %s does not exist. Skipping" % lv_name) + continue + + cmd = "lvremove --force %s/%s" % (vg_name, lv_name) + retcode = run(cmd, verbose=verbose) + if (retcode != 0): + _print("WARN: Could not remove LV %s" % lv_name) + return False + + if self.lv_info(lv_name, vg_name): + _print("INFO: lv_remove - LV %s still exists." % lv_name) + return False + + return True + + @staticmethod + def lv_convert(vg_name, lv_name, options, verbose=True): + """Change Logical Volume layout. + The arguments are: + \tVG name + \tLV name + \toptions + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + if not options: + _print("WARN: lv_convert requires at least some options specified.") + return False + + if not lv_name or not vg_name: + _print("WARN: lv_convert requires vg_name and lv_name") + return False + + cmd = "lvconvert %s %s/%s" % (" ".join(options), vg_name, lv_name) + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not convert %s" % lv_name) + return False + + return True + + ########################################### + # Config file + ########################################### + @staticmethod + def get_config_file_path(): + return "/etc/lvm/lvm.conf" + + def update_config(self, key, value): + config_file = self.get_config_file_path() + search_regex = re.compile("(\s*)%s(\s*)=(\s*)\S*" % key) + for line in fileinput.input(config_file, inplace=1): + m = search_regex.match(line) + if m: + line = "%s%s = %s" % (m.group(1), key, value) + # print saves the line to the file + # need to remove new line character as print will add it + line = line.rstrip('\n') + print(line) + + +class DMPD: + def __init__(self): + self.lvm = LVM() + + def _get_devices(self): + lv_list = self.lvm.lv_query() + return lv_list + + @staticmethod + def _get_active_devices(): + cmd = "ls /dev/mapper/" + retcode, output = run(cmd, return_output=True, verbose=False) + if retcode != 0: + _print("WARN: Could not find active dm devices") + return False + devices = output.split() + return devices + + @staticmethod + def _get_device_path(vg_name, lv_name): + device_path = vg_name + "-" + lv_name + if "/dev/mapper/" not in device_path: + device_path = "/dev/mapper/" + device_path + return device_path + + def _check_device(self, vg_name, lv_name): + devices = self._get_devices() + device_list = [x["name"] for x in devices] + if lv_name not in device_list: + _print("WARN: %s is not a device" % lv_name) + return False + for x in devices: + if x["name"] == lv_name and x["vg_name"] == vg_name: + _print("INFO: Found device %s in group %s" % (lv_name, vg_name)) + return True + return False + + def _activate_device(self, vg_name, lv_name): + devices_active = self._get_active_devices() + if vg_name + "-" + lv_name not in devices_active: + ret = self.lvm.lv_activate(lv_name, vg_name) + if not ret: + _print("WARN: Could not activate device %s" % lv_name) + return False + _print("INFO: device %s was activated" % lv_name) + _print("INFO: device %s is active" % lv_name) + return True + + @staticmethod + def _fallocate(_file, size, command_message): + cmd = "fallocate -l %sM %s" % (size, _file) + try: + retcode = run(cmd) + if retcode != 0: + _print("WARN: Command failed with code %s." % retcode) + _print("WARN: Could not create file to %s metadata to." % command_message) + return False + except OSError as e: + print >> sys.err, "command failed: ", e + return False + return True + + @staticmethod + def get_help(cmd): + commands = ["cache_check", "cache_dump", "cache_metadata_size", "cache_repair", "cache_restore", "era_check", + "era_dump", "era_invalidate", "era_restore", "thin_check", "thin_delta", "thin_dump", "thin_ls", + "thin_metadata_size", "thin_repair", "thin_restore", "thin_rmap", "thin_show_duplicates", + "thin_trim"] + if cmd not in commands: + _print("WARN: Unknown command %s" % cmd) + return False + + command = "%s -h" % cmd + retcode = run(command, verbose=True) + if retcode != 0: + _print("WARN: Could not get help for %s." % cmd) + return False + + return True + + @staticmethod + def get_version(cmd): + commands = ["cache_check", "cache_dump", "cache_metadata_size", "cache_repair", "cache_restore", "era_check", + "era_dump", "era_invalidate", "era_restore", "thin_check", "thin_delta", "thin_dump", "thin_ls", + "thin_metadata_size", "thin_repair", "thin_restore", "thin_rmap", "thin_show_duplicates", + "thin_trim"] + if cmd not in commands: + _print("WARN: Unknown command %s" % cmd) + return False + + command = "%s -V" % cmd + retcode = run(command, verbose=True) + if retcode != 0: + _print("WARN: Could not get version of %s." % cmd) + return False + + return True + + def _get_dev_id(self, dev_id, path=None, lv_name=None, vg_name=None): + dev_ids = [] + + if path is None: + retcode, data = self.thin_dump(source_vg=vg_name, source_lv=lv_name, formatting="xml", return_output=True) + if not retcode: + _print("WARN: Could not dump metadata from %s/%s" % (vg_name, lv_name)) + return False + data_lines = data.splitlines() + for line in data_lines: + blocks = line.split() + for block in blocks: + if not block.startswith("dev_"): + continue + else: + dev_ids.append(int(block[8:-1])) + + else: + with open(path, "r") as meta: + for line in meta: + blocks = line.split() + for block in blocks: + if not block.startswith("dev_"): + continue + else: + dev_ids.append(int(block[8:-1])) + + if dev_id in dev_ids: + return True + + return False + + @staticmethod + def _metadata_size(source=None, lv_name=None, vg_name=None): + if source is None: + cmd = "lvs -a --units m" + ret, data = run(cmd, return_output=True) + if ret != 0: + _print("WARN: Could not list LVs") + data_line = data.splitlines() + for line in data_line: + cut = line.split() + if not cut or lv_name != cut[0] and vg_name != cut[1]: + continue + cut = cut[3] + cut = cut.split("m") + size = float(cut[0]) + cmd = "rm -f /tmp/meta_size" + run(cmd) + return int(size) + _print("WARN: Could not find %s %s in lvs, setting size to 100m" % (lv_name, vg_name)) + return 100 + else: + return int(os.stat(source).st_size) / 1000000 + + ########################################### + # cache section + ########################################### + + def cache_check(self, source_file=None, source_vg=None, source_lv=None, quiet=False, super_block_only=False, + clear_needs_check_flag=False, skip_mappings=False, skip_hints=False, skip_discards=False, + verbose=True): + """Check cache pool metadata from either file or device. + The arguments are: + \tsource_file + \tsource_vg VG name + \tsource_lv LV name + \tquiet Mute STDOUT + \tsuper_block_only + \tclear_needs_check_flag + \tskip_mappings + \tskip_hints + \tskip_discards + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + + options = "" + + if not source_file and (not source_vg or not source_lv): + _print("WARN: cache_check requires either source_file OR source_vg and source_lv.") + return False + + if not source_file: + ret = self._check_device(source_vg, source_lv) + if not ret: + return False + ret = self._activate_device(source_vg, source_lv) + if not ret: + return False + device = self._get_device_path(source_vg, source_lv) + else: + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return False + device = source_file + + if quiet: + options += "--quiet " + + if super_block_only: + options += "--super-block-only " + + if clear_needs_check_flag: + options += "--clear-needs-check-flag " + + if skip_mappings: + options += "--skip-mappings " + + if skip_hints: + options += "--skip-hints " + + if skip_discards: + options += "--skip-discards " + + cmd = "cache_check %s %s" % (device, options) + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not check %s metadata" % device) + return False + + return True + + def cache_dump(self, source_file=None, source_vg=None, source_lv=None, output=None, repair=False, verbose=True, + return_output=False): + """Dumps cache metadata from device of source file to standard output or file. + The arguments are: + \tsource_file + \tsource_vg VG name + \tsource_lv LV name + \toutput specify output xml file + \treturn_output see 'Returns', not usable with output=True + \trepair Repair the metadata while dumping it + Returns: + \tOnly Boolean if return_output False: + \t\tTrue if success + \t'tFalse in case of failure + \tBoolean and data if return_output True + """ + options = "" + + if return_output and output: + _print("INFO: Cannot return to both STDOUT and file, returning only to file.") + return_output = False + + if return_output: + ret_fail = (False, None) + else: + ret_fail = False + + if not source_file and (not source_vg or not source_lv): + _print("WARN: cache_dump requires either source_file OR source_vg and source_lv.") + return ret_fail + + if not source_file: + ret = self._check_device(source_vg, source_lv) + if not ret: + return ret_fail + ret = self._activate_device(source_vg, source_lv) + if not ret: + return ret_fail + device = self._get_device_path(source_vg, source_lv) + else: + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return ret_fail + device = source_file + + if output: + if not os.path.isfile(output): + size = self._metadata_size(source_file, source_lv, source_vg) + ret = self._fallocate(output, size + 1, "dump") + if not ret: + return ret_fail + options += "-o %s " % output + + if repair: + options += "--repair" + + cmd = "cache_dump %s %s" % (device, options) + if return_output: + retcode, data = run(cmd, return_output=True, verbose=verbose) + else: + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not dump %s metadata." % device) + return ret_fail + + if return_output: + return True, data + return True + + def cache_repair(self, source_file=None, source_vg=None, source_lv=None, target_file=None, target_vg=None, + target_lv=None, verbose=True): + """Repairs cache metadata from source file/device to target file/device + The arguments are: + \tsource as either source_file OR source_vg and source_lv + \ttarget as either target_file OR target_vg and target_lv + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + + if not source_file and (not source_vg or not source_lv): + _print("WARN: cache_repair requires either source_file OR source_vg and source_lv as source.") + return False + + if not target_file and (not target_vg or not target_lv): + _print("WARN: cache_repair requires either target_file OR target_vg and target_lv as target.") + return False + + if not source_file: + ret = self._check_device(source_vg, source_lv) + if not ret: + return False + ret = self._activate_device(source_vg, source_lv) + if not ret: + return False + source = self._get_device_path(source_vg, source_lv) + else: + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return False + source = source_file + + if not target_file: + ret = self._check_device(target_vg, target_lv) + if not ret: + return False + ret = self._activate_device(target_vg, target_lv) + if not ret: + return False + target = self._get_device_path(target_vg, target_lv) + else: + if not os.path.isfile(target_file): + size = self._metadata_size(source_file, source_lv, source_vg) + ret = self._fallocate(target_file, size + 1, "repair") + if not ret: + return False + target = target_file + + cmd = "cache_repair -i %s -o %s" % (source, target) + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not repair metadata from %s to %s" % (source, target)) + return False + + return True + + def cache_restore(self, source_file, target_vg=None, target_lv=None, target_file=None, quiet=False, + metadata_version=None, omit_clean_shutdown=False, override_metadata_version=None, verbose=True): + """Restores cache metadata from source xml file to target device/file + The arguments are: + \tsource_file Source xml file + \ttarget as either target_file OR target_vg and target_lv + \tquiet Mute STDOUT + \tmetadata_version Specify metadata version to restore + \tomit_clean_shutdown Disable clean shutdown + \toverride_metadata_version DEBUG option to override metadata version without checking + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + + options = "" + + if source_file is None: + _print("WARN: cache_restore requires source file.") + return False + + if not target_file and (not target_vg or not target_lv): + _print("WARN: cache_restore requires either target_file OR target_vg and target_lv as target.") + return False + + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return False + + if not target_file: + ret = self._check_device(target_vg, target_lv) + if not ret: + return False + ret = self._activate_device(target_vg, target_lv) + if not ret: + return False + target = self._get_device_path(target_vg, target_lv) + else: + if not os.path.isfile(target_file): + size = self._metadata_size(source_file) + ret = self._fallocate(target_file, size + 1, "restore") + if not ret: + return False + target = target_file + + if quiet: + options += "--quiet " + + if metadata_version: + options += "--metadata-version %s " % metadata_version + + if omit_clean_shutdown: + options += "--omit-clean-shutdown " + + if override_metadata_version: + options += "--debug-override-metadata-version %s" % override_metadata_version + + cmd = "cache_restore -i %s -o %s %s" % (source_file, target, options) + + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not restore metadata from %s to %s" % (source_file, target)) + return False + + return True + + ########################################### + # thinp section + ########################################### + + def thin_check(self, source_file=None, source_vg=None, source_lv=None, quiet=False, super_block_only=False, + clear_needs_check_flag=False, skip_mappings=False, ignore_non_fatal_errors=False, verbose=True): + """Check thin pool metadata from either file or device. + The arguments are: + \tsource_file + \tsource_vg VG name + \tsource_lv LV name + \tquiet Mute STDOUT + \tsuper_block_only + \tclear_needs_check_flag + \tskip_mappings + \tignore_non_fatal_errors + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + + options = "" + + if not source_file and (not source_vg or not source_lv): + _print("WARN: thin_check requires either source_file OR source_vg and source_lv.") + return False + + if not source_file: + ret = self._check_device(source_vg, source_lv) + if not ret: + return False + ret = self._activate_device(source_vg, source_lv) + if not ret: + return False + device = self._get_device_path(source_vg, source_lv) + else: + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return False + device = source_file + + if quiet: + options += "--quiet " + + if super_block_only: + options += "--super-block-only " + + if clear_needs_check_flag: + options += "--clear-needs-check-flag " + + if skip_mappings: + options += "--skip-mappings " + + if ignore_non_fatal_errors: + options += "--ignore-non-fatal-errors " + + cmd = "thin_check %s %s" % (device, options) + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not check %s metadata" % device) + return False + + return True + + def thin_ls(self, source_vg, source_lv, no_headers=False, fields=None, snapshot=False, verbose=True): + """List information about thin LVs on thin pool. + The arguments are: + \tsource_vg VG name + \tsource_lv LV name + \tfields list of fields to output, default is all + \tsnapshot If use metadata snapshot, able to run on live snapshotted pool + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + + options = "" + + if not source_vg or not source_lv: + _print("WARN: thin_ls requires source_vg and source_lv.") + return False + + ret = self._check_device(source_vg, source_lv) + if not ret: + return False + ret = self._activate_device(source_vg, source_lv) + if not ret: + return False + device = self._get_device_path(source_vg, source_lv) + + if no_headers: + options += "--no-headers " + + fields_possible = ["DEV", "MAPPED_BLOCKS", "EXCLUSIVE_BLOCKS", "SHARED_BLOCKS", "MAPPED_SECTORS", + "EXCLUSIVE_SECTORS", "SHARED_SECTORS", "MAPPED_BYTES", "EXCLUSIVE_BYTES", "SHARED_BYTES", + "MAPPED", "EXCLUSIVE", "TRANSACTION", "CREATE_TIME", "SHARED", "SNAP_TIME"] + if fields is None: + options += " --format \"%s\" " % ",".join([str(i) for i in fields_possible]) + else: + for field in fields: + if field not in fields_possible: + _print("WARN: Unknown field %s specified." % field) + _print("INFO: Possible fields are: %s" % ", ".join([str(i) for i in fields_possible])) + return False + options += " --format \"%s\" " % ",".join([str(i) for i in fields]) + + if snapshot: + options += "--metadata-snap" + + cmd = "thin_ls %s %s" % (device, options) + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not list %s metadata" % device) + return False + + return True + + def thin_dump(self, source_file=None, source_vg=None, source_lv=None, output=None, repair=False, formatting=None, + snapshot=None, dev_id=None, skip_mappings=False, verbose=True, return_output=False): + """Dumps thin metadata from device of source file to standard output or file. + The arguments are: + \tsource_file + \tsource_vg VG name + \tsource_lv LV name + \toutput specify output xml file + \treturn_output see 'Returns', not usable with output=True + \trepair Repair the metadata while dumping it + \tformatting Specify output format [xml, human_readable, custom='file'] + \tsnapshot (Boolean/Int) Use metadata snapshot. If Int provided, specifies block number + \tdev_id ID of the device + Returns: + \tOnly Boolean if return_output False: + \t\tTrue if success + \t'tFalse in case of failure + \tBoolean and data if return_output True + """ + options = "" + + if return_output and output: + _print("INFO: Cannot return to both STDOUT and file, returning only to file.") + return_output = False + + if return_output: + ret_fail = (False, None) + else: + ret_fail = False + + if not source_file and (not source_vg or not source_lv): + _print("WARN: thin_dump requires either source_file OR source_vg and source_lv.") + return ret_fail + + if not source_file: + ret = self._check_device(source_vg, source_lv) + if not ret: + return ret_fail + ret = self._activate_device(source_vg, source_lv) + if not ret: + return ret_fail + device = self._get_device_path(source_vg, source_lv) + else: + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return ret_fail + device = source_file + + if output: + if not os.path.isfile(output): + size = self._metadata_size(source_file, source_lv, source_vg) + ret = self._fallocate(output, size + 1, "dump") + if not ret: + return ret_fail + options += "-o %s " % output + + if repair: + options += "--repair " + + if snapshot: + if isinstance(snapshot, bool): + options += "--metadata-snap " + elif isinstance(snapshot, int): + options += "--metadata-snap %s " % snapshot + else: + _print("WARN: Unknown snapshot value, use either Boolean or Int.") + return ret_fail + + if formatting: + if formatting in ["xml", "human_readable"]: + options += "--format %s " % formatting + elif formatting.startswith("custom="): + if not os.path.isfile(formatting[8:-1]): + _print("WARN: Specified custom formatting file is not a file.") + return ret_fail + options += "--format %s " % formatting + else: + _print("WARN: Unknown formatting specified, please use one of [xml, human_readable, custom='file'].") + return ret_fail + + if dev_id: + if isinstance(dev_id, int): + if self._get_dev_id(dev_id, source_file, source_lv, source_vg): + options += "--dev-id %s " % dev_id + else: + _print("WARN: Unknown dev_id value, device with ID %s does not exist." % dev_id) + return ret_fail + else: + _print("WARN: Unknown dev_id value, must be Int.") + return ret_fail + + if skip_mappings: + options += "--skip-mappings " + + cmd = "thin_dump %s %s" % (device, options) + if return_output: + retcode, data = run(cmd, return_output=True, verbose=verbose) + else: + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not dump %s metadata." % device) + return ret_fail + + if return_output: + return True, data + return True + + def thin_restore(self, source_file, target_vg=None, target_lv=None, target_file=None, quiet=False, verbose=True): + """Restores thin metadata from source xml file to target device/file + The arguments are: + \tsource_file Source xml file + \ttarget as either target_file OR target_vg and target_lv + \tquiet Mute STDOUT + \tmetadata_version Specify metadata version to restore + \tomit_clean_shutdown Disable clean shutdown + \toverride_metadata_version DEBUG option to override metadata version without checking + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + + options = "" + + if source_file is None: + _print("WARN: thin_restore requires source file.") + return False + + if not target_file and (not target_vg or not target_lv): + _print("WARN: thin_restore requires either target_file OR target_vg and target_lv as target.") + return False + + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return False + + if not target_file: + ret = self._check_device(target_vg, target_lv) + if not ret: + return False + ret = self._activate_device(target_vg, target_lv) + if not ret: + return False + target = self._get_device_path(target_vg, target_lv) + else: + if not os.path.isfile(target_file): + size = self._metadata_size(source_file) + ret = self._fallocate(target_file, size + 1, "restore") + if not ret: + return False + target = target_file + + if quiet: + options += "--quiet" + + cmd = "thin_restore -i %s -o %s %s" % (source_file, target, options) + + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not restore metadata from %s to %s" % (source_file, target)) + return False + + return True + + def thin_repair(self, source_file=None, source_vg=None, source_lv=None, target_file=None, target_vg=None, + target_lv=None, verbose=True): + """Repairs thin metadata from source file/device to target file/device + The arguments are: + \tsource as either source_file OR source_vg and source_lv + \ttarget as either target_file OR target_vg and target_lv + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + + if not source_file and (not source_vg or not source_lv): + _print("WARN: thin_repair requires either source_file OR source_vg and source_lv as source.") + return False + + if not target_file and (not target_vg or not target_lv): + _print("WARN: thin_repair requires either target_file OR target_vg and target_lv as target.") + return False + + if not source_file: + ret = self._check_device(source_vg, source_lv) + if not ret: + return False + ret = self._activate_device(source_vg, source_lv) + if not ret: + return False + source = self._get_device_path(source_vg, source_lv) + else: + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return False + source = source_file + + if not target_file: + ret = self._check_device(target_vg, target_lv) + if not ret: + return False + ret = self._activate_device(target_vg, target_lv) + if not ret: + return False + target = self._get_device_path(target_vg, target_lv) + else: + if not os.path.isfile(target_file): + size = self._metadata_size(source_file, source_lv, source_vg) + ret = self._fallocate(target_file, size + 1, "repair") + if not ret: + return False + target = target_file + + cmd = "thin_repair -i %s -o %s" % (source, target) + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not repair metadata from %s to %s" % (source, target)) + return False + + return True + + def thin_rmap(self, region, source_file=None, source_vg=None, source_lv=None, verbose=True): + """Output reverse map of a thin provisioned region of blocks from metadata device. + The arguments are: + \tsource_vg VG name + \tsource_lv LV name + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + + if not source_file and (not source_vg or not source_lv): + _print("WARN: thin_rmap requires either source_file OR source_vg and source_lv as source.") + return False + + if not source_file: + ret = self._check_device(source_vg, source_lv) + if not ret: + return False + ret = self._activate_device(source_vg, source_lv) + if not ret: + return False + device = self._get_device_path(source_vg, source_lv) + else: + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return False + device = source_file + + regions = region.split(".") + try: + int(regions[0]) + if regions[1] != '': + raise ValueError + int(regions[2]) + if regions[3] is not None: + raise ValueError + except ValueError: + _print("WARN: Region must be in format 'INT..INT'") + return False + except IndexError: + pass + # region 1..-1 must be valid, using usigned 32bit ints + if int(regions[0]) & 0xffffffff >= int(regions[2]) & 0xffffffff: + _print("WARN: Beginning of the region must be before its end.") + return False + options = "--region %s" % region + + cmd = "thin_rmap %s %s" % (device, options) + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not output reverse map from %s metadata device" % device) + return False + + return True + + def thin_trim(self, target_vg, target_lv, force=True, verbose=True): + """Issue discard requests for free pool space. + The arguments are: + \ttarget_vg VG name + \ttarget_lv LV name + \tforce suppress warning message and disable prompt, default True + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + options = "" + + if force: + options += " --pool-inactive" + + if not target_vg or not target_lv: + _print("WARN: thin_trim requires target_vg and target_lv.") + return False + + ret = self._check_device(target_vg, target_lv) + if not ret: + return False + + ret = self._activate_device(target_vg, target_lv) + if not ret: + return False + + device = self._get_device_path(target_vg, target_lv) + cmd = "thin_trim %s %s" % (device, options) + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not discard free pool space on device %s." % device) + return False + + return True + + def thin_delta(self, thin1, thin2, source_file=None, source_vg=None, source_lv=None, snapshot=False, + verbosity=False, verbose=True): + """Print the differences in the mappings between two thin devices.. + The arguments are: + \tsource_vg VG name + \tsource_lv LV name + \tthin1 numeric identificator of first thin volume + \tthin2 numeric identificator of second thin volume + \tsnapshot (Boolean/Int) Use metadata snapshot. If Int provided, specifies block number + \tverbosity Provide extra information on the mappings + Returns: + \tBoolean: + \t\tTrue if success + \t'tFalse in case of failure + """ + + options = "" + + if not source_file and (not source_vg or not source_lv): + _print("WARN: thin_delta requires either source_file OR source_vg and source_lv.") + return False + + if not source_file: + ret = self._check_device(source_vg, source_lv) + if not ret: + return False + ret = self._activate_device(source_vg, source_lv) + if not ret: + return False + device = self._get_device_path(source_vg, source_lv) + else: + if not os.path.isfile(source_file): + _print("WARN: Source file is not a file.") + return False + device = source_file + + if snapshot: + if isinstance(snapshot, bool): + options += "--metadata-snap " + elif isinstance(snapshot, int): + options += "--metadata-snap %s " % snapshot + else: + _print("WARN: Unknown snapshot value, use either Boolean or Int.") + return False + + if verbosity: + options += "--verbose" + + if self._get_dev_id(thin1, source_file, source_lv, source_vg) and \ + self._get_dev_id(thin2, source_file, source_lv, source_vg): + cmd = "thin_delta %s --thin1 %s --thin2 %s %s" % (options, thin1, thin2, device) + retcode = run(cmd, verbose=verbose) + if retcode != 0: + _print("WARN: Could not get differences in mappings between two thin LVs.") + return False + else: + _print("WARN: Specified ID does not exist.") + return False + return True diff --git a/tests/functions_test/runtest.sh b/tests/functions_test/runtest.sh new file mode 100755 index 0000000..6387254 --- /dev/null +++ b/tests/functions_test/runtest.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Copyright (c) 2017 Red Hat, Inc. All rights reserved. This copyrighted +# material is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. +# +# Author: Jakub Krysl +rhts-run-simple-test functions_test ./dmpd_functions.py diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..67072a2 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,26 @@ +--- +# Tests suitable to run in classic environment +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - tools_not_linked_usr + - functions_test + required_packages: + - findutils # beakerlib needs find command + - which # tools_not_linked_usr needs which command + +# Tests suitable to run in container and atomic environments +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - container + - atomic + tests: + - tools_not_linked_usr + required_packages: + - findutils # beakerlib needs find command + - which # tools_not_linked_usr needs which command diff --git a/tests/tools_not_linked_usr/Makefile b/tests/tools_not_linked_usr/Makefile new file mode 100644 index 0000000..892073f --- /dev/null +++ b/tests/tools_not_linked_usr/Makefile @@ -0,0 +1,75 @@ +# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; If not, see http://www.gnu.org/licenses/. +# +# Author: Bruno Goncalves + +# The toplevel namespace within which the test lives. +TOPLEVEL_NAMESPACE=kernel + +# The name of the package under test: +PACKAGE_NAME=storage + +# The path of the test below the package: +RELATIVE_PATH=lvm/device-mapper-persistent-data/tools_not_linked_usr + +# Version of the Test. Used with make tag. +export TESTVERSION=1.0 + +# The combined namespace of the test. +export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) + + +# A phony target is one that is not really the name of a file. +# It is just a name for some commands to be executed when you +# make an explicit request. There are two reasons to use a +# phony target: to avoid a conflict with a file of the same +# name, and to improve performance. +.PHONY: all install download clean + +# executables to be built should be added here, they will be generated on the system under test. +BUILT_FILES= + +# data files, .c files, scripts anything needed to either compile the test and/or run it. +FILES=$(METADATA) runtest.sh PURPOSE tools_not_linked_usr.py + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + chmod a+x ./tools_not_linked_usr.py + +clean: + rm -f *~ *.rpm $(BUILT_FILES) + +# You may need to add other targets e.g. to build executables from source code +# Add them here: + + +# Include Common Makefile +include /usr/share/rhts/lib/rhts-make.include + +# Generate the testinfo.desc here: +$(METADATA): Makefile + @touch $(METADATA) +# Change to the test owner's name + @echo "Owner: Bruno Goncalves " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "License: GPL" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: Make sure tools are not linked to lib under /usr.">> $(METADATA) + @echo "TestTime: 1h" >> $(METADATA) + @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA) + @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/tools_not_linked_usr/PURPOSE b/tests/tools_not_linked_usr/PURPOSE new file mode 100644 index 0000000..3408f47 --- /dev/null +++ b/tests/tools_not_linked_usr/PURPOSE @@ -0,0 +1,13 @@ +#=========================================================================== +# +# Description: +# Make sure tools are not using any library that is linked to /usr +# +# Bugs related: +# +# Author(s): +# Bruno Goncalves +# +# +#=========================================================================== +# EndFile diff --git a/tests/tools_not_linked_usr/runtest.sh b/tests/tools_not_linked_usr/runtest.sh new file mode 100755 index 0000000..06c675c --- /dev/null +++ b/tests/tools_not_linked_usr/runtest.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted +# material is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. +# +# Author: Bruno Goncalves +rhts-run-simple-test tools_not_linked_usr ./tools_not_linked_usr.py diff --git a/tests/tools_not_linked_usr/tools_not_linked_usr.py b/tests/tools_not_linked_usr/tools_not_linked_usr.py new file mode 100755 index 0000000..7acb804 --- /dev/null +++ b/tests/tools_not_linked_usr/tools_not_linked_usr.py @@ -0,0 +1,93 @@ +#!/usr/bin/python + +# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; If not, see http://www.gnu.org/licenses/. +# +# Author: Bruno Goncalves + +from os import walk +import subprocess +import sys +import re + +def run(cmd): + print "INFO: Running '%s'..." % cmd + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + stdout, stderr = p.communicate() + + retcode = p.returncode + output = stdout + stderr + print output + return retcode, output + +def start_test(): + + #if uses any library linked to /usr this my affect the tools during boot + print ("INFO: Making sure tools provided by device-mapper-persistent-data " + "are not linked to /usr") + + #Paths where we should have no libraries linked from + lib_paths = ["/usr/"] + + package = "device-mapper-persistent-data" + run("yum install -y %s" % package) + #Get all tools that we need to check + ret, output = run("rpm -ql %s | grep \"sbin/\"" % package) + if ret != 0: + print("FAIL: Could not get the tools shipped from %s" % package) + return False + tools = output.split("\n") + + error = False + for tool in tools: + if not tool: + #skip any blank line + continue + tool_error = 0 + for lib_path in lib_paths: + print "INFO: Checking if %s is not linked to libraries at %s" % (tool, lib_path) + ret, linked_lib = run("ldd %s" % tool) + if ret != 0: + print("FAIL: Could not list dynamically libraries for %s" % (tool)) + tool_error += 1 + else: + #The command executed sucessfuly + #check if any library linked is from lib_path + links = linked_lib.split("\n") + for link in links: + if re.match(".*%s.*" % lib_path, link): + print("FAIL: %s is linked to %s" % (tool, link)) + tool_error += 1 + + if tool_error == 0: + print("%s is not linked to %s" % (tool, lib_path)) + else: + #found some error in at least 1 tool + error = True + + if error: + return False + + return True + + +def main(): + + if not start_test(): + print "FAIL: test failed" + sys.exit(1) + + print "PASS: Test pass" + sys.exit(0) + +main() + From e2f2093885b53a0ca7eb5773e302af10a9db34aa Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 14 Nov 2017 11:49:05 +0100 Subject: [PATCH 071/135] New upstream release v0.7.5 This fixes an mportant bug in cache_restore. The rest is mostly changing tests. --- .gitignore | 1 + device-mapper-persistent-data.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5395f66..500f829 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ /thin-provisioning-tools-0.7.0-rc6.tar.gz /v0.7.2.tar.gz /v0.7.3.tar.gz +/v0.7.5.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index f5b3d35..1d13bcb 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.7.3 +Version: 0.7.5 Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base @@ -83,6 +83,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Tue Nov 14 2017 Marian Csontos - 0.7.5-1 +- Fix version 2 metadata corruption in cache_restore. + * Fri Oct 06 2017 Marian Csontos - 0.7.3-1 - Update to latest bugfix and documentation update release. - *_restore tools wipe superblock as a last resort. diff --git a/sources b/sources index ae57c22..ee8eecc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.7.3.tar.gz) = 492d02d1a06a9a2554a99f24c05e5d0d9234900669099b27eac9af459ab312fa53acce58a44c41133e060302013cd05b8c83c5e4e8d3727b1a1389c9d8f85574 +SHA512 (v0.7.5.tar.gz) = 65268cc0c68428fa89f039c097794f574ef79b1862de3208715b9180ba73b197f37d879b386b110c52d9f2d3e80fb069a8d48ee2939aa1fd2b88f2513babc763 From 40e854a10a5c08ba04ec44be690a5828bd0d467b Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 23 Jan 2018 22:31:29 +0000 Subject: [PATCH 072/135] Rebuilt for Boost 1.66 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 1d13bcb..d7bdb95 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.5 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -83,6 +83,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Tue Jan 23 2018 Jonathan Wakely - 0.7.5-2 +- Rebuilt for Boost 1.66 + * Tue Nov 14 2017 Marian Csontos - 0.7.5-1 - Fix version 2 metadata corruption in cache_restore. From c327b607fe60f40476150f887a61e9ce1016de57 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 7 Feb 2018 06:43:05 +0000 Subject: [PATCH 073/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index d7bdb95..93bf77d 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.5 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -83,6 +83,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Wed Feb 07 2018 Fedora Release Engineering - 0.7.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Tue Jan 23 2018 Jonathan Wakely - 0.7.5-2 - Rebuilt for Boost 1.66 From a19342ade30c3268d3e81a0d8358f9f26ed315bd Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 20 Feb 2018 15:39:57 +0100 Subject: [PATCH 074/135] Add gcc-c++ to BuildRequires --- device-mapper-persistent-data.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 93bf77d..c36dd73 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -13,7 +13,7 @@ URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz Patch0: device-mapper-persistent-data-avoid-strip.patch -BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel +BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++ Requires: expat %description From 88778300c58bc4c39913a342359fe957eac48c38 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 24 Apr 2018 19:11:56 +0200 Subject: [PATCH 075/135] New upstream release v0.7.6 --- .gitignore | 1 + device-mapper-persistent-data.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 500f829..de521d7 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ /v0.7.2.tar.gz /v0.7.3.tar.gz /v0.7.5.tar.gz +/v0.7.6.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index c36dd73..40198e8 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,8 +4,8 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.7.5 -Release: 3%{?dist} +Version: 0.7.6 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -83,6 +83,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Tue Apr 24 2018 Marian Csontos - 0.7.6-1 +- Update to latest upstream version + * Wed Feb 07 2018 Fedora Release Engineering - 0.7.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources index ee8eecc..1e14c45 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.7.5.tar.gz) = 65268cc0c68428fa89f039c097794f574ef79b1862de3208715b9180ba73b197f37d879b386b110c52d9f2d3e80fb069a8d48ee2939aa1fd2b88f2513babc763 +SHA512 (v0.7.6.tar.gz) = 395035b6f59fafb1c0f3e68750611e04f10223bc8d57b257e25c28c928647d1d2c6e94014b64ed90eeae1151fc7e5d23cf1aa428716e343338cb3c8fe55ed704 From c01e369f7ee43c0d4db06da497a33366e2669aa7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 12 Jul 2018 22:48:28 +0000 Subject: [PATCH 076/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 40198e8..de096c0 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.6 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -83,6 +83,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Thu Jul 12 2018 Fedora Release Engineering - 0.7.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Tue Apr 24 2018 Marian Csontos - 0.7.6-1 - Update to latest upstream version From 790a1dc62488faf5bb79a261ea928cc61d1d8ee0 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 25 Jan 2019 14:54:45 +0000 Subject: [PATCH 077/135] Rebuilt for Boost 1.69 --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index de096c0..db6881f 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.6 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools @@ -83,6 +83,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Fri Jan 25 2019 Jonathan Wakely - 0.7.6-3 +- Rebuilt for Boost 1.69 + * Thu Jul 12 2018 Fedora Release Engineering - 0.7.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 731228e5f9c2b2df5588a59ac18c385f75a16ae0 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:17:42 +0100 Subject: [PATCH 078/135] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- device-mapper-persistent-data.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index db6881f..2325ca3 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -7,7 +7,6 @@ Name: device-mapper-persistent-data Version: 0.7.6 Release: 3%{?dist} License: GPLv3+ -Group: System Environment/Base URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-% {version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz From b31f85ac2694b992a1cec6c8d70552c3ef227ba9 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 29 Jan 2019 05:45:40 +0100 Subject: [PATCH 079/135] Remove unneeded %clean section It is the behavior since EPEL5. Signed-off-by: Igor Gnatenko --- device-mapper-persistent-data.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 2325ca3..b65f281 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -36,8 +36,6 @@ make %{?_smp_mflags} V= %install make DESTDIR=%{buildroot} MANDIR=%{_mandir} install -%clean - %files %doc COPYING README.md %{_mandir}/man8/cache_check.8.gz From 63039122ddf628332f6b6b9ab2d16c04f7eb3bef Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 31 Jan 2019 17:07:35 +0000 Subject: [PATCH 080/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index b65f281..6448264 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.7.6 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-% {version}.tar.gz @@ -80,6 +80,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Thu Jan 31 2019 Fedora Release Engineering - 0.7.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Fri Jan 25 2019 Jonathan Wakely - 0.7.6-3 - Rebuilt for Boost 1.69 From 95fb81b4128615cadf2fa9e942b2e0cc705a5c7c Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Mon, 29 Apr 2019 14:41:22 +0200 Subject: [PATCH 081/135] New upstream release v0.8.0 --- .gitignore | 1 + device-mapper-persistent-data.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index de521d7..65ea2ed 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ /v0.7.3.tar.gz /v0.7.5.tar.gz /v0.7.6.tar.gz +/v0.8.0.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 6448264..54bf1f2 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,8 +4,8 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.7.6 -Release: 4%{?dist} +Version: 0.8.0 +Release: 1%{?dist} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-% {version}.tar.gz @@ -80,6 +80,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Mon Apr 29 2019 Marian Csontos - 0.8.0-1 +- Update to latest upstream version + * Thu Jan 31 2019 Fedora Release Engineering - 0.7.6-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index 1e14c45..be2908d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.7.6.tar.gz) = 395035b6f59fafb1c0f3e68750611e04f10223bc8d57b257e25c28c928647d1d2c6e94014b64ed90eeae1151fc7e5d23cf1aa428716e343338cb3c8fe55ed704 +SHA512 (v0.8.0.tar.gz) = b95f320f8da94b52327d7afece98020de65c7a3eccf9e6d8e8f89600b9f984e3d4ae928b52c04dd973d0d87885354567f6d392e9551e0e7394158406bae79891 From b2f4dd907cc454b117f0dcab1d33b537fe4caec2 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Sat, 4 May 2019 21:37:19 +0200 Subject: [PATCH 082/135] New upstream release v0.8.1 --- .gitignore | 1 + device-mapper-persistent-data.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 65ea2ed..1f2c5d2 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ /v0.7.5.tar.gz /v0.7.6.tar.gz /v0.8.0.tar.gz +/v0.8.1.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 54bf1f2..14faf82 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.8.0 +Version: 0.8.1 Release: 1%{?dist} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools @@ -80,6 +80,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Sat May 04 2019 Marian Csontos - 0.8.1-1 +- Fix thin_repair should not require --repair option. + * Mon Apr 29 2019 Marian Csontos - 0.8.0-1 - Update to latest upstream version diff --git a/sources b/sources index be2908d..d3f3cb5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.8.0.tar.gz) = b95f320f8da94b52327d7afece98020de65c7a3eccf9e6d8e8f89600b9f984e3d4ae928b52c04dd973d0d87885354567f6d392e9551e0e7394158406bae79891 +SHA512 (v0.8.1.tar.gz) = 8f1edb7e50b897a070c6c04ea9c43725db3d725d6afcb5349bdedba59fce29faa680cd79bb47f255700054ee89e80f7063cde4c8abaa172e560f22459e004ce6 From fbb64262ce8ea9bdede47e9a04b31ecf1194dcb4 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 4 Jun 2019 14:49:44 +0200 Subject: [PATCH 083/135] New upstream release v0.8.5 --- .gitignore | 1 + device-mapper-persistent-data.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1f2c5d2..18aaa44 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ /v0.7.6.tar.gz /v0.8.0.tar.gz /v0.8.1.tar.gz +/v0.8.5.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 14faf82..d915daa 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -4,7 +4,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.8.1 +Version: 0.8.5 Release: 1%{?dist} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools @@ -80,6 +80,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Tue Jun 04 2019 Marian Csontos - 0.8.5-1 +- Update to latest upstream version + * Sat May 04 2019 Marian Csontos - 0.8.1-1 - Fix thin_repair should not require --repair option. diff --git a/sources b/sources index d3f3cb5..db03cfa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.8.1.tar.gz) = 8f1edb7e50b897a070c6c04ea9c43725db3d725d6afcb5349bdedba59fce29faa680cd79bb47f255700054ee89e80f7063cde4c8abaa172e560f22459e004ce6 +SHA512 (v0.8.5.tar.gz) = 11e8f6bccaa1d5ccc622a356995f60afa45bba5f4dd80e2fbd7e980963d856a15a32d7b3305e445291936d5207af72fac85d9956680ed7c651383cc57a945451 From 421e6526f6960818107130319ab5555f2aa1a813 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 24 Jul 2019 21:53:02 +0000 Subject: [PATCH 084/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index d915daa..c3e8cc8 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.8.5 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-% {version}.tar.gz @@ -80,6 +80,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Wed Jul 24 2019 Fedora Release Engineering - 0.8.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Tue Jun 04 2019 Marian Csontos - 0.8.5-1 - Update to latest upstream version From 8049d4672f1d820c6753dfc938830acbbfd70780 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jan 2020 15:43:34 +0000 Subject: [PATCH 085/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index c3e8cc8..b30c346 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.8.5 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-% {version}.tar.gz @@ -80,6 +80,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Tue Jan 28 2020 Fedora Release Engineering - 0.8.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Wed Jul 24 2019 Fedora Release Engineering - 0.8.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 3a6c7c6f8e6120921f303f04253ddfeb8312d460 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 27 Jul 2020 15:17:54 +0000 Subject: [PATCH 086/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index b30c346..2496c15 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -5,7 +5,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.8.5 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-% {version}.tar.gz @@ -80,6 +80,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Mon Jul 27 2020 Fedora Release Engineering - 0.8.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue Jan 28 2020 Fedora Release Engineering - 0.8.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 00ee8c1bd221db95ca1455abba90727e9d6f6445 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 1 Sep 2020 15:02:56 +0200 Subject: [PATCH 087/135] Update to upstream release 0.9.0 --- .gitignore | 3 ++ 0001-Update-dependencies.patch | 25 ++++++++++++++++ README.md | 24 ++++++++++++++++ device-mapper-persistent-data.spec | 46 ++++++++++++++++++++++++++---- sources | 2 +- 5 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 0001-Update-dependencies.patch create mode 100644 README.md diff --git a/.gitignore b/.gitignore index 18aaa44..15172ca 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ /v0.8.0.tar.gz /v0.8.1.tar.gz /v0.8.5.tar.gz +/v0.9.0-rc2.tar.gz +/device-mapper-persistent-data-0.9.0-rc2-vendor.tar.gz +/v0.9.0.tar.gz diff --git a/0001-Update-dependencies.patch b/0001-Update-dependencies.patch new file mode 100644 index 0000000..aaca7ac --- /dev/null +++ b/0001-Update-dependencies.patch @@ -0,0 +1,25 @@ +From 4a45e1d7eafb83ec9c76f0b3278f4bc7efbdde9d Mon Sep 17 00:00:00 2001 +From: Marian Csontos +Date: Tue, 1 Sep 2020 14:55:48 +0200 +Subject: [PATCH] Update dependencies + +--- + Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index 892ea4c..93fc807 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -9,7 +9,7 @@ license = "GPL3" + anyhow = "1.0" + byteorder = "1.3" + clap = "2.33" +-crc32c = "0.4" ++crc32c = "0.5" + flate2 = "1.0" + fixedbitset = "0.3" + libc = "0.2.71" +-- +1.8.3.1 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..4c77f74 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# Packaging dmpd + +This is mostly regular package except recent addition of rust to used languages. + +## rust-tools + +To build the rust-tools (`make rust-tools`) one needs: + +- rust >= 1.35 +- cargo with vendor subcommand (now upstream, included in latest Fedora and RHEL8) + +### cargo vendpr + +- run `cargo vendor` in the disrectory with sources +- run `tar czf device-mapper-persistent-data-vendor-$VERSION.tar.gz ./vendor` +- copy the file (if version changed) and run the *fedpkg new-sources* command: + - `fedpkg new-sources v$VERSION.tar.gz device-mapper-persistent-data-vendor-$VERSION.tar.gz` + +## TODO/NOTES + +Some of the dependencies may be already packaged by Fedora. Can we instruct *cargo vendor* to include only those which are not provided by Fedora? + +*%cargo_install* installs by defualt in */usr/bin* but the package expects */usr/sbin*. For now I run *make install-rust-tools*. + diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 2496c15..2878e32 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,18 +2,27 @@ # Copyright (C) 2011-2017 Red Hat, Inc # +#%%global version_suffix -rc2 +%global release_suffix .test2 + Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.8.5 -Release: 4%{?dist} +Version: 0.9.0 +Release: 0.2%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools -#Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-% {version}.tar.gz -Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz +#Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz +Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{version_suffix}.tar.gz Patch0: device-mapper-persistent-data-avoid-strip.patch +Patch1: 0001-Update-dependencies.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++ Requires: expat +%ifarch %{rust_arches} +BuildRequires: rust-packaging +BuildRequires: rust >= 1.35 +BuildRequires: cargo +%endif %description thin-provisioning-tools contains check,dump,restore,repair,rmap @@ -24,17 +33,32 @@ are included and era check, dump, restore and invalidate to manage snapshot eras %prep -%setup -q -n thin-provisioning-tools-%{version} +%setup -q -n thin-provisioning-tools-%{version}%{version_suffix} +%ifarch %{rust_arches} +%cargo_prep +%endif %patch0 -p1 -b .avoid_strip +%patch1 -p1 -b .toml_update echo %{version}-%{release} > VERSION +%generate_buildrequires +%cargo_generate_buildrequires + %build autoconf %configure --with-optimisation= make %{?_smp_mflags} V= +%ifarch %{rust_arches} +%cargo_build +%endif %install make DESTDIR=%{buildroot} MANDIR=%{_mandir} install +%ifarch %{rust_arches} +make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools +# cargo_install installs into /usr/bin +#%%cargo_install +%endif %files %doc COPYING README.md @@ -57,6 +81,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_mandir}/man8/thin_restore.8.gz %{_mandir}/man8/thin_rmap.8.gz %{_mandir}/man8/thin_trim.8.gz +%ifarch %{rust_arches} +%{_mandir}/man8/thin_metadata_pack.8.gz +%{_mandir}/man8/thin_metadata_unpack.8.gz +%endif %{_sbindir}/pdata_tools %{_sbindir}/cache_check %{_sbindir}/cache_dump @@ -77,9 +105,17 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_restore %{_sbindir}/thin_rmap %{_sbindir}/thin_trim +%ifarch %{rust_arches} +%{_sbindir}/thin_metadata_pack +%{_sbindir}/thin_metadata_unpack +%endif #% {_sbindir}/thin_show_duplicates %changelog +* Tue Sep 01 2020 Marian Csontos - 0.9.0-0.2 +- Update to latest upstream version +- New tools thin_metadata_pack and thin_metadata_unpack + * Mon Jul 27 2020 Fedora Release Engineering - 0.8.5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index db03cfa..1219fce 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.8.5.tar.gz) = 11e8f6bccaa1d5ccc622a356995f60afa45bba5f4dd80e2fbd7e980963d856a15a32d7b3305e445291936d5207af72fac85d9956680ed7c651383cc57a945451 +SHA512 (v0.9.0.tar.gz) = e1796fb3948847d72ca8247cae58017507c0a847a00201b93668eeb8fbfea4107c4c2affa5c211c149798a89b10474e83d2bd61a5545a668299be97aed591e0f From 17d784aa7f2421481f493b0dc88f4155167ad1bb Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 17 Sep 2020 17:21:56 +0200 Subject: [PATCH 088/135] Update to ustrream release 0.9.0 --- .gitignore | 1 + device-mapper-persistent-data.spec | 29 ++++++++++++++++++++--------- sources | 1 + 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 15172ca..a2c13b7 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ /v0.9.0-rc2.tar.gz /device-mapper-persistent-data-0.9.0-rc2-vendor.tar.gz /v0.9.0.tar.gz +/dmpd090-vendor.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 2878e32..4eb06e1 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -3,18 +3,19 @@ # #%%global version_suffix -rc2 -%global release_suffix .test2 +#%%global release_suffix .test3 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 0.2%{?dist}%{?release_suffix} +Release: 1%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz -Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{version_suffix}.tar.gz +Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz +Source1: dmpd090-vendor.tar.gz Patch0: device-mapper-persistent-data-avoid-strip.patch -Patch1: 0001-Update-dependencies.patch +#Patch1: 0001-Update-dependencies.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++ Requires: expat @@ -33,16 +34,26 @@ are included and era check, dump, restore and invalidate to manage snapshot eras %prep -%setup -q -n thin-provisioning-tools-%{version}%{version_suffix} +%setup -q -n thin-provisioning-tools-%{version}%{?version_suffix} %ifarch %{rust_arches} -%cargo_prep +#%%patch1 -p1 -b .toml_update +#%%cargo_prep +#%%cargo_generate_buildrequires +tar xf %{SOURCE1} +mkdir -p .cargo +cat > .cargo/config < VERSION %generate_buildrequires -%cargo_generate_buildrequires %build autoconf @@ -112,7 +123,7 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog -* Tue Sep 01 2020 Marian Csontos - 0.9.0-0.2 +* Thu Sep 17 2020 Marian Csontos - 0.9.0-1 - Update to latest upstream version - New tools thin_metadata_pack and thin_metadata_unpack diff --git a/sources b/sources index 1219fce..f0a209b 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (v0.9.0.tar.gz) = e1796fb3948847d72ca8247cae58017507c0a847a00201b93668eeb8fbfea4107c4c2affa5c211c149798a89b10474e83d2bd61a5545a668299be97aed591e0f +SHA512 (dmpd090-vendor.tar.gz) = fb455511b9a7cba22029f968e9caac14cb0c94f899fea7cb96b973f8abf9cfc26f9706f0b18e4750edda063d7014c485583f559f127f1296ecd3b0b9f5d912e3 From 9537e3e84a1eba43e35922610b1d66d5f6c8b8e3 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Mon, 21 Sep 2020 14:26:43 +0200 Subject: [PATCH 089/135] Fix build on non x86 architectures --- .gitignore | 1 + device-mapper-persistent-data.spec | 11 +++++++---- sources | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a2c13b7..6a128c2 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ /device-mapper-persistent-data-0.9.0-rc2-vendor.tar.gz /v0.9.0.tar.gz /dmpd090-vendor.tar.gz +/dmpd090-vendor2.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 4eb06e1..1fdf192 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,14 +8,14 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 1%{?dist}%{?release_suffix} +Release: 2%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd090-vendor.tar.gz +Source1: dmpd090-vendor2.tar.gz Patch0: device-mapper-persistent-data-avoid-strip.patch -#Patch1: 0001-Update-dependencies.patch +Patch1: 0001-Update-dependencies.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++ Requires: expat @@ -36,7 +36,7 @@ snapshot eras %prep %setup -q -n thin-provisioning-tools-%{version}%{?version_suffix} %ifarch %{rust_arches} -#%%patch1 -p1 -b .toml_update +%patch1 -p1 -b .toml_update #%%cargo_prep #%%cargo_generate_buildrequires tar xf %{SOURCE1} @@ -123,6 +123,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Mon Sep 21 2020 Marian Csontos - 0.9.0-2 +- Update crc32c to version 0.5 supporting non x86 architectures + * Thu Sep 17 2020 Marian Csontos - 0.9.0-1 - Update to latest upstream version - New tools thin_metadata_pack and thin_metadata_unpack diff --git a/sources b/sources index f0a209b..87073b3 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (v0.9.0.tar.gz) = e1796fb3948847d72ca8247cae58017507c0a847a00201b93668eeb8fbfea4107c4c2affa5c211c149798a89b10474e83d2bd61a5545a668299be97aed591e0f -SHA512 (dmpd090-vendor.tar.gz) = fb455511b9a7cba22029f968e9caac14cb0c94f899fea7cb96b973f8abf9cfc26f9706f0b18e4750edda063d7014c485583f559f127f1296ecd3b0b9f5d912e3 +SHA512 (dmpd090-vendor2.tar.gz) = 47e22d34e34345ae5c91e66063c2f78865b055fccd47c34a97e2bd2fed1f64fc7f13ad27071a149fefba53f5b437beeda3bacde25b690431e1ae50f77cec440c From d369cfa3c510ca9a6c3a7820225a97a6f2988610 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 19 Dec 2020 06:06:36 +0000 Subject: [PATCH 090/135] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- device-mapper-persistent-data.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 1fdf192..0eb6961 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -24,6 +24,7 @@ BuildRequires: rust-packaging BuildRequires: rust >= 1.35 BuildRequires: cargo %endif +BuildRequires: make %description thin-provisioning-tools contains check,dump,restore,repair,rmap From 04960e2a1eb6ab9f067b49dee4066ede46122305 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 03:17:52 +0000 Subject: [PATCH 091/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 0eb6961..6f3c954 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 2%{?dist}%{?release_suffix} +Release: 3%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz @@ -124,6 +124,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 0.9.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Mon Sep 21 2020 Marian Csontos - 0.9.0-2 - Update crc32c to version 0.5 supporting non x86 architectures From c8a7f0ad3ed990804927e720247db44b687d0197 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 10 Jun 2021 14:49:17 +0200 Subject: [PATCH 092/135] Fix gating tests --- tests/functions_test/dmpd_functions.py | 12 ++++++------ tests/functions_test/dmpd_library.py | 13 ++++++++----- tests/tools_not_linked_usr/tools_not_linked_usr.py | 12 ++++++------ 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/tests/functions_test/dmpd_functions.py b/tests/functions_test/dmpd_functions.py index a908bcf..bcf02d6 100755 --- a/tests/functions_test/dmpd_functions.py +++ b/tests/functions_test/dmpd_functions.py @@ -195,7 +195,7 @@ def thin_clean(args): def thin_test(args): print("\n#######################################\n") - print ( + print( "INFO: Testing thin tools runtime provided by device_mapper_persistent_data") errors = [] @@ -415,7 +415,7 @@ def thin_test(args): def thin_errors_test(args): print("\n#######################################\n") - print ( + print( "INFO: Testing thin tools errors provided by device_mapper_persistent_data") errors = [] @@ -845,7 +845,7 @@ def cache_clean(args): def cache_test(args): print("\n#######################################\n") - print ("INFO: Testing cache tools runtime provided by device_mapper_persistent_data") + print("INFO: Testing cache tools runtime provided by device_mapper_persistent_data") errors = [] @@ -965,7 +965,7 @@ def cache_test(args): def cache_errors_test(args): print("\n#######################################\n") - print ("INFO: Testing cache tools errors provided by device_mapper_persistent_data") + print("INFO: Testing cache tools errors provided by device_mapper_persistent_data") errors = [] @@ -1223,10 +1223,10 @@ def main(): cache_clean(args) if not TC.tend(): - print "FAIL: test failed" + print("FAIL: test failed") sys.exit(1) - print "PASS: Test pass" + print("PASS: Test pass") sys.exit(0) diff --git a/tests/functions_test/dmpd_library.py b/tests/functions_test/dmpd_library.py index e8f1ed9..d50d08f 100755 --- a/tests/functions_test/dmpd_library.py +++ b/tests/functions_test/dmpd_library.py @@ -23,6 +23,9 @@ import sys, os import subprocess import time import fileinput +# TODO: Is this really necessary? Unlikely we will run into python2 in rawhide +# again... +from __future__ import print_function def _print(string): @@ -1042,7 +1045,7 @@ class LoopDev: _print("WARN: Could not create loop device image file") return ret_fail except OSError as e: - print >> sys.err, "command failed: ", e + print("command failed: ", e, file=sys.err) return ret_fail loop_path = self._get_loop_path(name) @@ -1125,7 +1128,7 @@ class LoopDev: name = self._standardize_name(name) # Just try to detach if device is connected, otherwise ignore - # print "INFO: Checking if ", loop_path, " exists, to be detached" + # print("INFO: Checking if ", loop_path, " exists, to be detached") dev_path = self._get_loop_path(name) if dev_path in devs: cmd = "losetup -d %s" % dev_path @@ -1199,7 +1202,7 @@ class LVM: cmd = "vgcreate %s %s %s" % (options, vg_name, pv_name) retcode = run(cmd, verbose=verbose) if (retcode != 0): - # _print ("WARN: Could not create %s" % vg_name) + # _print("WARN: Could not create %s" % vg_name) return False return True @@ -1321,7 +1324,7 @@ class LVM: cmd = "lvcreate %s %s -n %s" % (" ".join(str(i) for i in options), vg_name, lv_name) retcode = run(cmd, verbose=verbose) if (retcode != 0): - # _print ("WARN: Could not create %s" % lv_name) + # _print("WARN: Could not create %s" % lv_name) return False return True @@ -1514,7 +1517,7 @@ class DMPD: _print("WARN: Could not create file to %s metadata to." % command_message) return False except OSError as e: - print >> sys.err, "command failed: ", e + print("command failed: ", e, file=sys.err) return False return True diff --git a/tests/tools_not_linked_usr/tools_not_linked_usr.py b/tests/tools_not_linked_usr/tools_not_linked_usr.py index 7acb804..74053cf 100755 --- a/tests/tools_not_linked_usr/tools_not_linked_usr.py +++ b/tests/tools_not_linked_usr/tools_not_linked_usr.py @@ -20,19 +20,19 @@ import sys import re def run(cmd): - print "INFO: Running '%s'..." % cmd + print("INFO: Running '%s'..." % cmd) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) stdout, stderr = p.communicate() retcode = p.returncode output = stdout + stderr - print output + print(output) return retcode, output def start_test(): #if uses any library linked to /usr this my affect the tools during boot - print ("INFO: Making sure tools provided by device-mapper-persistent-data " + print("INFO: Making sure tools provided by device-mapper-persistent-data " "are not linked to /usr") #Paths where we should have no libraries linked from @@ -54,7 +54,7 @@ def start_test(): continue tool_error = 0 for lib_path in lib_paths: - print "INFO: Checking if %s is not linked to libraries at %s" % (tool, lib_path) + print("INFO: Checking if %s is not linked to libraries at %s" % (tool, lib_path)) ret, linked_lib = run("ldd %s" % tool) if ret != 0: print("FAIL: Could not list dynamically libraries for %s" % (tool)) @@ -83,10 +83,10 @@ def start_test(): def main(): if not start_test(): - print "FAIL: test failed" + print("FAIL: test failed") sys.exit(1) - print "PASS: Test pass" + print("PASS: Test pass") sys.exit(0) main() From 266ea5b3cf8598f9c0437345020f2309c4514ea4 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 10 Jun 2021 15:05:05 +0200 Subject: [PATCH 093/135] Fix issues found by static analysis --- 0001-all-Fix-resource-leaks.patch | 42 ++++ ...ow_metadata-Fix-out-of-bounds-access.patch | 26 ++ ...build-Fix-customized-emitter-linkage.patch | 25 ++ ...dump-Fix-leaked-shared-object-handle.patch | 139 +++++++++++ ...show_duplicates-Fix-potential-errors.patch | 52 ++++ ...a_size-Fix-potential-string-overflow.patch | 33 +++ ...-all-Fix-uninitialized-class-members.patch | 83 +++++++ ...x-warnings-on-potential-NULL-pointer.patch | 88 +++++++ ...nused-sources-from-the-regular-build.patch | 52 ++++ 0010-all-Remove-unreachable-code.patch | 51 ++++ 0011-file_utils-Fix-resource-leak.patch | 24 ++ ...-thin_delta-Clean-up-duplicated-code.patch | 224 ++++++++++++++++++ device-mapper-persistent-data.spec | 30 ++- 13 files changed, 868 insertions(+), 1 deletion(-) create mode 100644 0001-all-Fix-resource-leaks.patch create mode 100644 0002-thin_show_metadata-Fix-out-of-bounds-access.patch create mode 100644 0003-build-Fix-customized-emitter-linkage.patch create mode 100644 0004-thin_dump-Fix-leaked-shared-object-handle.patch create mode 100644 0005-thin_show_duplicates-Fix-potential-errors.patch create mode 100644 0006-thin_metadata_size-Fix-potential-string-overflow.patch create mode 100644 0007-all-Fix-uninitialized-class-members.patch create mode 100644 0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch create mode 100644 0009-build-Remove-unused-sources-from-the-regular-build.patch create mode 100644 0010-all-Remove-unreachable-code.patch create mode 100644 0011-file_utils-Fix-resource-leak.patch create mode 100644 0012-thin_delta-Clean-up-duplicated-code.patch diff --git a/0001-all-Fix-resource-leaks.patch b/0001-all-Fix-resource-leaks.patch new file mode 100644 index 0000000..6519dfc --- /dev/null +++ b/0001-all-Fix-resource-leaks.patch @@ -0,0 +1,42 @@ +From 48676b9f1aac63f8a30ed8061b6e719929b82c98 Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Wed, 28 Apr 2021 10:34:16 +0800 +Subject: [PATCH 01/10] [all] Fix resource leaks + +--- + base/file_utils.cc | 4 +++- + thin-provisioning/cache_stream.cc | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/base/file_utils.cc b/base/file_utils.cc +index e4f3722..8253660 100644 +--- a/base/file_utils.cc ++++ b/base/file_utils.cc +@@ -155,8 +155,10 @@ file_utils::zero_superblock(std::string const &path) + throw runtime_error("out of memory"); + + memset(buffer, 0, SUPERBLOCK_SIZE); +- if (::write(fd.fd_, buffer, SUPERBLOCK_SIZE) != SUPERBLOCK_SIZE) ++ if (::write(fd.fd_, buffer, SUPERBLOCK_SIZE) != SUPERBLOCK_SIZE) { ++ free(buffer); + throw runtime_error("couldn't zero superblock"); ++ } + } + + //---------------------------------------------------------------- +diff --git a/thin-provisioning/cache_stream.cc b/thin-provisioning/cache_stream.cc +index 002b6ba..73b01b4 100644 +--- a/thin-provisioning/cache_stream.cc ++++ b/thin-provisioning/cache_stream.cc +@@ -62,7 +62,7 @@ chunk const & + cache_stream::get() + { + chunk_wrapper *w = new chunk_wrapper(*this); +- return w->c_; ++ return w->c_; // wrapper will get freed by the put method + } + + void +-- +1.8.3.1 + diff --git a/0002-thin_show_metadata-Fix-out-of-bounds-access.patch b/0002-thin_show_metadata-Fix-out-of-bounds-access.patch new file mode 100644 index 0000000..66a6f0d --- /dev/null +++ b/0002-thin_show_metadata-Fix-out-of-bounds-access.patch @@ -0,0 +1,26 @@ +From 691a0237809b5364117446a8a9b0cceeb0a747c1 Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Tue, 1 Jun 2021 11:24:11 +0800 +Subject: [PATCH 02/10] [thin_show_metadata] Fix out-of-bounds access + +--- + thin-provisioning/thin_show_metadata.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/thin-provisioning/thin_show_metadata.cc b/thin-provisioning/thin_show_metadata.cc +index bdbab3f..dbc7a80 100644 +--- a/thin-provisioning/thin_show_metadata.cc ++++ b/thin-provisioning/thin_show_metadata.cc +@@ -206,7 +206,8 @@ namespace { + + void run() { + auto line_length = 80; +- for (block_address b = 0; b < 2000; b++) { ++ block_address nr_blocks = std::min(2000, bm_.get_nr_blocks()); ++ for (block_address b = 0; b < nr_blocks; b++) { + block_manager::read_ref rr = bm_.read_lock(b); + + if (!(b % line_length)) { +-- +1.8.3.1 + diff --git a/0003-build-Fix-customized-emitter-linkage.patch b/0003-build-Fix-customized-emitter-linkage.patch new file mode 100644 index 0000000..05cfb56 --- /dev/null +++ b/0003-build-Fix-customized-emitter-linkage.patch @@ -0,0 +1,25 @@ +From 65369d88610069ba7bbd011b00af19523638b0fb Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Tue, 1 Jun 2021 13:32:26 +0800 +Subject: [PATCH 03/10] [build] Fix customized emitter linkage + +--- + contrib/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/contrib/Makefile.in b/contrib/Makefile.in +index 038c41c..7192258 100644 +--- a/contrib/Makefile.in ++++ b/contrib/Makefile.in +@@ -18,7 +18,7 @@ contrib/%.a: contrib/%.o + $(V)echo " [AR] $@" + $(V)$(AR) rcs $@ $^ + +-contrib/%.so: contrib/%.a ++contrib/%.so: contrib/%.o + $(V)echo " [LD] $@" + $(V)$(CC) -shared -Wl,-soname,$@ -o $@ $< + +-- +1.8.3.1 + diff --git a/0004-thin_dump-Fix-leaked-shared-object-handle.patch b/0004-thin_dump-Fix-leaked-shared-object-handle.patch new file mode 100644 index 0000000..983143a --- /dev/null +++ b/0004-thin_dump-Fix-leaked-shared-object-handle.patch @@ -0,0 +1,139 @@ +From 7fbd79cab2e548eb388bc782dd39f1cde027173b Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Tue, 1 Jun 2021 23:37:36 +0800 +Subject: [PATCH 04/10] [thin_dump] Fix leaked shared object handle + +--- + thin-provisioning/shared_library_emitter.cc | 113 ++++++++++++++++++++++++---- + 1 file changed, 100 insertions(+), 13 deletions(-) + +diff --git a/thin-provisioning/shared_library_emitter.cc b/thin-provisioning/shared_library_emitter.cc +index 58f12d2..2e845f3 100644 +--- a/thin-provisioning/shared_library_emitter.cc ++++ b/thin-provisioning/shared_library_emitter.cc +@@ -8,22 +8,109 @@ using namespace thin_provisioning; + + //---------------------------------------------------------------- + +-emitter::ptr +-thin_provisioning::create_custom_emitter(string const &shared_lib, ostream &out) +-{ +- emitter::ptr (*create_fn)(ostream &out); +- void *handle = dlopen(shared_lib.c_str(), RTLD_LAZY); +- if (!handle) +- throw runtime_error(dlerror()); ++struct shared_object { ++public: ++ shared_object(const char *shared_lib) { ++ handle_ = dlopen(shared_lib, RTLD_LAZY); ++ if (!handle_) ++ throw runtime_error(dlerror()); ++ ++ dlerror(); // Clear any existing error ++ } ++ ++ virtual ~shared_object() { ++ dlclose(handle_); ++ } ++ ++ void *get_symbol(const char *symbol) { ++ void *sym = dlsym(handle_, symbol); ++ ++ char *error = dlerror(); ++ if (error) ++ throw runtime_error(error); ++ ++ return sym; ++ } ++ ++ void *handle_; ++}; ++ ++class shared_emitter : public emitter { ++public: ++ shared_emitter(const char *shared_lib, ostream &out): sobj_(shared_lib) { ++ emitter::ptr (*create_fn)(ostream &out); ++ create_fn = reinterpret_cast( ++ sobj_.get_symbol("create_emitter")); ++ inner_ = create_fn(out); ++ } ++ ++ virtual ~shared_emitter() { ++ } ++ ++ void begin_superblock(std::string const &uuid, ++ uint64_t time, ++ uint64_t trans_id, ++ boost::optional flags, ++ boost::optional version, ++ uint32_t data_block_size, ++ uint64_t nr_data_blocks, ++ boost::optional metadata_snap) { ++ inner_->begin_superblock(uuid, ++ time, ++ trans_id, ++ flags, ++ version, ++ data_block_size, ++ nr_data_blocks, ++ metadata_snap); ++ } + +- dlerror(); // Clear any existing error +- create_fn = reinterpret_cast(dlsym(handle, "create_emitter")); ++ void end_superblock() { ++ inner_->end_superblock(); ++ } + +- char *error = dlerror(); +- if (error) +- throw runtime_error(error); ++ void begin_device(uint32_t dev_id, ++ uint64_t mapped_blocks, ++ uint64_t trans_id, ++ uint64_t creation_time, ++ uint64_t snap_time) { ++ inner_->begin_device(dev_id, mapped_blocks, trans_id, creation_time, snap_time); ++ } + +- return create_fn(out); ++ void end_device() { ++ inner_->end_device(); ++ } ++ ++ void begin_named_mapping(std::string const &name) { ++ inner_->begin_named_mapping(name); ++ } ++ ++ void end_named_mapping() { ++ inner_->end_named_mapping(); ++ } ++ ++ void identifier(std::string const &name) { ++ inner_->identifier(name); ++ } ++ ++ void range_map(uint64_t origin_begin, uint64_t data_begin, uint32_t time, uint64_t len) { ++ inner_->range_map(origin_begin, data_begin, time, len); ++ } ++ ++ void single_map(uint64_t origin_block, uint64_t data_block, uint32_t time) { ++ inner_->single_map(origin_block, data_block, time); ++ } ++ ++ shared_object sobj_; ++ emitter::ptr inner_; ++}; ++ ++//---------------------------------------------------------------- ++ ++emitter::ptr ++thin_provisioning::create_custom_emitter(string const &shared_lib, ostream &out) ++{ ++ return emitter::ptr(new shared_emitter(shared_lib.c_str(), out)); + } + + //---------------------------------------------------------------- +-- +1.8.3.1 + diff --git a/0005-thin_show_duplicates-Fix-potential-errors.patch b/0005-thin_show_duplicates-Fix-potential-errors.patch new file mode 100644 index 0000000..ee07eb3 --- /dev/null +++ b/0005-thin_show_duplicates-Fix-potential-errors.patch @@ -0,0 +1,52 @@ +From 32de33be68f3892698d492b9ab8f21f9186b3f4c Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Wed, 2 Jun 2021 01:23:13 +0800 +Subject: [PATCH 05/10] [thin_show_duplicates] Fix potential errors + +- Fix error if no --block-sector provided +- Fix errors on pools without mappings, or zero-length file +--- + thin-provisioning/thin_show_duplicates.cc | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/thin-provisioning/thin_show_duplicates.cc b/thin-provisioning/thin_show_duplicates.cc +index b1eebb7..f7354eb 100644 +--- a/thin-provisioning/thin_show_duplicates.cc ++++ b/thin-provisioning/thin_show_duplicates.cc +@@ -56,7 +56,7 @@ using namespace thin_provisioning; + + namespace { + bool factor_of(block_address f, block_address n) { +- return (n % f) == 0; ++ return f && (n % f) == 0; + } + + uint64_t parse_int(string const &str, string const &desc) { +@@ -132,11 +132,15 @@ namespace { + class duplicate_detector { + public: + void scan_with_variable_sized_chunks(chunk_stream &stream) { ++ if (!stream.size()) ++ return; + variable_chunk_stream vstream(stream, 4096); + scan(vstream); + } + + void scan_with_fixed_sized_chunks(chunk_stream &stream, block_address chunk_size) { ++ if (!stream.size()) ++ return; + fixed_chunk_stream fstream(stream, chunk_size); + scan(fstream); + } +@@ -222,7 +226,7 @@ namespace { + if (fs.content_based_chunks) + detector.scan_with_variable_sized_chunks(pstream); + else { +- if (*fs.block_size) { ++ if (!!fs.block_size) { + if (factor_of(*fs.block_size, block_size)) + block_size = *fs.block_size; + else +-- +1.8.3.1 + diff --git a/0006-thin_metadata_size-Fix-potential-string-overflow.patch b/0006-thin_metadata_size-Fix-potential-string-overflow.patch new file mode 100644 index 0000000..cd22d1c --- /dev/null +++ b/0006-thin_metadata_size-Fix-potential-string-overflow.patch @@ -0,0 +1,33 @@ +From 35e96e07c956a501cb8a12f5b873db173bb09179 Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Wed, 2 Jun 2021 11:39:01 +0800 +Subject: [PATCH 06/10] [thin_metadata_size] Fix potential string overflow + +--- + thin-provisioning/thin_metadata_size.cc | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/thin-provisioning/thin_metadata_size.cc b/thin-provisioning/thin_metadata_size.cc +index b6a5718..f14696c 100644 +--- a/thin-provisioning/thin_metadata_size.cc ++++ b/thin-provisioning/thin_metadata_size.cc +@@ -192,9 +192,13 @@ static void printf_aligned(struct global *g, char const *a, char const *b, char + { + char buf[80]; + +- strcpy(buf, b); +- if (units) +- strcat(buf, mandatory ? "{" :"["), strcat(buf, g->unit.chars), strcat(buf, mandatory ? "}" : "]"); ++ if (units) { ++ char left_bracket = mandatory ? '{' : '['; ++ char right_bracket = mandatory ? '}' : ']'; ++ snprintf(buf, 80, "%s%c%s%c", b, left_bracket, g->unit.chars, right_bracket); ++ } else { ++ snprintf(buf, 80, "%s", b); ++ } + + printf("\t%-4s%-44s%s\n", a, buf, c); + } +-- +1.8.3.1 + diff --git a/0007-all-Fix-uninitialized-class-members.patch b/0007-all-Fix-uninitialized-class-members.patch new file mode 100644 index 0000000..11971a6 --- /dev/null +++ b/0007-all-Fix-uninitialized-class-members.patch @@ -0,0 +1,83 @@ +From f1e404c33ad14f6784aa1926ae75fa49e614748e Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Wed, 2 Jun 2021 12:14:34 +0800 +Subject: [PATCH 07/10] [all] Fix uninitialized class members + +--- + era/restore_emitter.cc | 1 + + thin-provisioning/metadata_dumper.cc | 10 +++++++--- + thin-provisioning/thin_delta.cc | 4 +++- + 3 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/era/restore_emitter.cc b/era/restore_emitter.cc +index c09fa66..7fbac7d 100644 +--- a/era/restore_emitter.cc ++++ b/era/restore_emitter.cc +@@ -14,6 +14,7 @@ namespace { + : md_(md), + in_superblock_(false), + in_writeset_(false), ++ era_(0), + in_era_array_(false) { + } + +diff --git a/thin-provisioning/metadata_dumper.cc b/thin-provisioning/metadata_dumper.cc +index 4feb40f..665c762 100644 +--- a/thin-provisioning/metadata_dumper.cc ++++ b/thin-provisioning/metadata_dumper.cc +@@ -180,7 +180,7 @@ namespace { + // This is about classifying and summarising btree nodes. The use of a btree + // node may not be obvious when inspecting it in isolation. But more information + // may be gleaned by examining child and sibling nodes. +-// ++// + // So the process is: + // - scan every metadata block, summarising it's potential uses. + // - repeatedly iterate those summaries until we can glean no more useful information. +@@ -474,7 +474,7 @@ namespace { + node_info get_internal_info(block_manager::read_ref &rr) { + node_info info; + info.b = rr.get_location(); +- ++ + // values refer to blocks, so we should have infos for them. + auto n = to_node(rr); + ::uint64_t key_low = 0; +@@ -524,7 +524,7 @@ namespace { + node_info info; + info.b = rr.get_location(); + +- auto vsize = to_cpu(hdr.value_size); ++ auto vsize = to_cpu(hdr.value_size); + info.values = to_cpu(hdr.nr_entries); + + if (vsize == sizeof(device_details_traits::disk_type)) { +@@ -645,6 +645,10 @@ namespace { + public: + mapping_emit_visitor(emitter::ptr e) + : e_(e), ++ origin_start_(0), ++ dest_start_(0), ++ time_(0), ++ len_(0), + in_range_(false) { + } + +diff --git a/thin-provisioning/thin_delta.cc b/thin-provisioning/thin_delta.cc +index 5b31608..ee48dea 100644 +--- a/thin-provisioning/thin_delta.cc ++++ b/thin-provisioning/thin_delta.cc +@@ -259,7 +259,9 @@ namespace local { + class simple_emitter : public diff_emitter { + public: + simple_emitter(indented_stream &out) +- : diff_emitter(out) { ++ : diff_emitter(out), ++ vbegin_(0), ++ vend_(0) { + } + + void left_only(uint64_t vbegin, uint64_t dbegin, uint64_t len) { +-- +1.8.3.1 + diff --git a/0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch b/0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch new file mode 100644 index 0000000..6005172 --- /dev/null +++ b/0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch @@ -0,0 +1,88 @@ +From 5d79a5c944d05f71425d3156597a2a61c5f2ab9a Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Wed, 2 Jun 2021 13:08:47 +0800 +Subject: [PATCH 08/10] [thin_dump] Fix warnings on potential NULL pointer + +--- + base/application.cc | 8 +++++++- + base/application.h | 2 +- + thin-provisioning/thin_dump.cc | 16 ++-------------- + 3 files changed, 10 insertions(+), 16 deletions(-) + +diff --git a/base/application.cc b/base/application.cc +index 61338ff..dbd55a5 100644 +--- a/base/application.cc ++++ b/base/application.cc +@@ -25,8 +25,14 @@ command::die(string const &msg) + } + + ::uint64_t +-command::parse_uint64(string const &str, string const &desc) ++command::parse_uint64(char const *str, char const *desc) + { ++ if (!str) { ++ ostringstream out; ++ out << "Couldn't parse " << desc << ": NULL"; ++ die(out.str()); ++ } ++ + try { + // FIXME: check trailing garbage is handled + return lexical_cast<::uint64_t>(str); +diff --git a/base/application.h b/base/application.h +index b799eaf..f071533 100644 +--- a/base/application.h ++++ b/base/application.h +@@ -19,7 +19,7 @@ namespace base { + virtual ~command() {} + + void die(std::string const &msg); +- uint64_t parse_uint64(std::string const &str, std::string const &desc); ++ uint64_t parse_uint64(char const *str, char const *desc); + + + virtual void usage(std::ostream &out) const = 0; +diff --git a/thin-provisioning/thin_dump.cc b/thin-provisioning/thin_dump.cc +index 74cfa91..c0e73e6 100644 +--- a/thin-provisioning/thin_dump.cc ++++ b/thin-provisioning/thin_dump.cc +@@ -143,7 +143,6 @@ thin_dump_cmd::run(int argc, char **argv) + int c; + char const *output = NULL; + const char shortopts[] = "hm::o:f:rV"; +- char *end_ptr; + block_address metadata_snap = 0; + ::uint64_t dev_id; + struct flags flags; +@@ -181,13 +180,7 @@ thin_dump_cmd::run(int argc, char **argv) + flags.use_metadata_snap = true; + if (optarg) { + // FIXME: deprecate this option +- metadata_snap = strtoull(optarg, &end_ptr, 10); +- if (end_ptr == optarg) { +- cerr << "couldn't parse " << endl; +- usage(cerr); +- return 1; +- } +- ++ metadata_snap = parse_uint64(optarg, "metadata-snap"); + flags.snap_location = metadata_snap; + } + break; +@@ -197,12 +190,7 @@ thin_dump_cmd::run(int argc, char **argv) + break; + + case 1: +- dev_id = strtoull(optarg, &end_ptr, 10); +- if (end_ptr == optarg) { +- cerr << "couldn't parse \n"; +- usage(cerr); +- return 1; +- } ++ dev_id = parse_uint64(optarg, "dev-id"); + flags.opts.select_dev(dev_id); + break; + +-- +1.8.3.1 + diff --git a/0009-build-Remove-unused-sources-from-the-regular-build.patch b/0009-build-Remove-unused-sources-from-the-regular-build.patch new file mode 100644 index 0000000..7d49603 --- /dev/null +++ b/0009-build-Remove-unused-sources-from-the-regular-build.patch @@ -0,0 +1,52 @@ +From 1c50c406ddda77f4c0b20e7bf3cc985e84526f51 Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Wed, 2 Jun 2021 13:14:30 +0800 +Subject: [PATCH 09/10] [build] Remove unused sources from the regular build + +--- + Makefile.in | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index b1fd4aa..9b13001 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -96,10 +96,7 @@ SOURCE=\ + persistent-data/transaction_manager.cc \ + persistent-data/validators.cc \ + thin-provisioning/commands.cc \ +- thin-provisioning/cache_stream.cc \ +- thin-provisioning/chunk_stream.cc \ + thin-provisioning/device_tree.cc \ +- thin-provisioning/fixed_chunk_stream.cc \ + thin-provisioning/human_readable_format.cc \ + thin-provisioning/mapping_tree.cc \ + thin-provisioning/metadata.cc \ +@@ -107,7 +104,6 @@ SOURCE=\ + thin-provisioning/metadata_counter.cc \ + thin-provisioning/metadata_dumper.cc \ + thin-provisioning/override_emitter.cc \ +- thin-provisioning/pool_stream.cc \ + thin-provisioning/restore_emitter.cc \ + thin-provisioning/rmap_visitor.cc \ + thin-provisioning/superblock.cc \ +@@ -124,7 +120,11 @@ SOURCE=\ + thin-provisioning/xml_format.cc + + DEVTOOLS_SOURCE=\ ++ thin-provisioning/cache_stream.cc \ ++ thin-provisioning/chunk_stream.cc \ + thin-provisioning/damage_generator.cc \ ++ thin-provisioning/fixed_chunk_stream.cc \ ++ thin-provisioning/pool_stream.cc \ + thin-provisioning/thin_journal.cc \ + thin-provisioning/thin_journal_check.cc \ + thin-provisioning/thin_ll_dump.cc \ +@@ -374,4 +374,3 @@ test: functional-test unit-test + endif + + -include $(DEPEND_FILES) +- +-- +1.8.3.1 + diff --git a/0010-all-Remove-unreachable-code.patch b/0010-all-Remove-unreachable-code.patch new file mode 100644 index 0000000..b72ec41 --- /dev/null +++ b/0010-all-Remove-unreachable-code.patch @@ -0,0 +1,51 @@ +From 9e94a4349186f7353e0d7b536b46bfa4df2483d0 Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Wed, 2 Jun 2021 14:59:29 +0800 +Subject: [PATCH 10/10] [all] Remove unreachable code + +--- + block-cache/io_engine.cc | 3 --- + caching/hint_array.cc | 6 ------ + 2 files changed, 9 deletions(-) + +diff --git a/block-cache/io_engine.cc b/block-cache/io_engine.cc +index 2fe4082..0158723 100644 +--- a/block-cache/io_engine.cc ++++ b/block-cache/io_engine.cc +@@ -174,9 +174,6 @@ aio_engine::wait_(timespec *ts) + cbs_.free(cb); + return optional(make_pair(false, context)); + } +- +- // shouldn't get here +- return optional(make_pair(false, 0)); + } + + struct timespec +diff --git a/caching/hint_array.cc b/caching/hint_array.cc +index 6514968..e133c5c 100644 +--- a/caching/hint_array.cc ++++ b/caching/hint_array.cc +@@ -56,9 +56,6 @@ namespace { + default: + throw runtime_error("invalid hint width"); + } +- +- // never get here +- return std::shared_ptr(); + } + + //-------------------------------- +@@ -93,9 +90,6 @@ namespace { + default: + throw runtime_error("invalid hint width"); + } +- +- // never get here +- return std::shared_ptr(); + } + + //-------------------------------- +-- +1.8.3.1 + diff --git a/0011-file_utils-Fix-resource-leak.patch b/0011-file_utils-Fix-resource-leak.patch new file mode 100644 index 0000000..bef546b --- /dev/null +++ b/0011-file_utils-Fix-resource-leak.patch @@ -0,0 +1,24 @@ +From 677fa789e4136dbdd589c1e65efc7cdaad7506ac Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Fri, 4 Jun 2021 21:37:02 +0800 +Subject: [PATCH 1/2] [file_utils] Fix resource leak + +--- + base/file_utils.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/base/file_utils.cc b/base/file_utils.cc +index 8253660..e6095f7 100644 +--- a/base/file_utils.cc ++++ b/base/file_utils.cc +@@ -159,6 +159,7 @@ file_utils::zero_superblock(std::string const &path) + free(buffer); + throw runtime_error("couldn't zero superblock"); + } ++ free(buffer); + } + + //---------------------------------------------------------------- +-- +1.8.3.1 + diff --git a/0012-thin_delta-Clean-up-duplicated-code.patch b/0012-thin_delta-Clean-up-duplicated-code.patch new file mode 100644 index 0000000..b45136e --- /dev/null +++ b/0012-thin_delta-Clean-up-duplicated-code.patch @@ -0,0 +1,224 @@ +From 2e755c67064c0157e646acfa57fbcc738905f7d4 Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Tue, 20 Oct 2020 15:18:06 +0800 +Subject: [PATCH 2/2] [thin_delta] Clean up duplicated code + +--- + thin-provisioning/thin_delta.cc | 105 ++++++++++++---------------------------- + 1 file changed, 31 insertions(+), 74 deletions(-) + +diff --git a/thin-provisioning/thin_delta.cc b/thin-provisioning/thin_delta.cc +index ee48dea..2ff3e69 100644 +--- a/thin-provisioning/thin_delta.cc ++++ b/thin-provisioning/thin_delta.cc +@@ -22,47 +22,7 @@ using namespace thin_provisioning; + + //---------------------------------------------------------------- + +-namespace local { +- class application { +- public: +- application(string const &cmd) +- : cmd_(cmd) { +- } +- +- void usage(ostream &out) { +- out << "Usage: " << cmd_ << " [options] \n" +- << "Options:\n" +- << " {--thin1, --snap1}\n" +- << " {--thin2, --snap2}\n" +- << " {-m, --metadata-snap} [block#]\n" +- << " {--verbose}\n" +- << " {-h|--help}\n" +- << " {-V|--version}" << endl; +- } +- +- void die(string const &msg) { +- cerr << msg << endl; +- usage(cerr); +- exit(1); +- } +- +- uint64_t parse_int(string const &str, string const &desc) { +- try { +- return boost::lexical_cast(str); +- +- } catch (...) { +- ostringstream out; +- out << "Couldn't parse " << desc << ": '" << str << "'"; +- die(out.str()); +- } +- +- return 0; // never get here +- } +- +- private: +- string cmd_; +- }; +- ++namespace { + struct flags { + flags() + : verbose(false), +@@ -96,13 +56,6 @@ namespace local { + uint64_t vbegin_, dbegin_, len_; + }; + +- ostream &operator <<(ostream &out, mapping const &m) { +- out << "mapping[vbegin = " << m.vbegin_ +- << ", dbegin = " << m.dbegin_ +- << ", len = " << m.len_ << "]"; +- return out; +- } +- + //-------------------------------- + + template +@@ -542,7 +495,7 @@ namespace local { + out << "\n"; + } + +- void delta_(application &app, flags const &fs) { ++ void delta_(flags const &fs) { + mapping_recorder mr1; + mapping_recorder mr2; + damage_visitor damage_v; +@@ -560,7 +513,7 @@ namespace local { + if (!snap1_root) { + ostringstream out; + out << "Unable to find mapping tree for snap1 (" << *fs.snap1 << ")"; +- app.die(out.str()); ++ throw std::runtime_error(out.str()); + } + + single_mapping_tree snap1(*md->tm_, *snap1_root, +@@ -572,7 +525,7 @@ namespace local { + if (!snap2_root) { + ostringstream out; + out << "Unable to find mapping tree for snap2 (" << *fs.snap2 << ")"; +- app.die(out.str()); ++ throw std::runtime_error(out.str()); + } + + single_mapping_tree snap2(*md->tm_, *snap2_root, +@@ -609,12 +562,12 @@ namespace local { + end_superblock(is); + } + +- int delta(application &app, flags const &fs) { ++ int delta(flags const &fs) { + try { +- delta_(app, fs); ++ delta_(fs); + } catch (exception const &e) { +- app.die(e.what()); +- return 1; // never get here ++ cerr << e.what() << endl; ++ return 1; + } + + return 0; +@@ -633,27 +586,31 @@ thin_delta_cmd::thin_delta_cmd() + void + thin_delta_cmd::usage(std::ostream &out) const + { +- // FIXME: finish ++ out << "Usage: " << get_name() << " [options] \n" ++ << "Options:\n" ++ << " {--thin1, --snap1}\n" ++ << " {--thin2, --snap2}\n" ++ << " {-m, --metadata-snap} [block#]\n" ++ << " {--verbose}\n" ++ << " {-h|--help}\n" ++ << " {-V|--version}" << endl; + } + + int + thin_delta_cmd::run(int argc, char **argv) + { +- using namespace local; +- + int c; + flags fs; +- local::application app(basename(argv[0])); + + char const shortopts[] = "hVm::"; + option const longopts[] = { + { "help", no_argument, NULL, 'h' }, ++ { "metadata-snap", optional_argument, NULL, 'm' }, + { "version", no_argument, NULL, 'V' }, + { "thin1", required_argument, NULL, 1 }, + { "snap1", required_argument, NULL, 1 }, + { "thin2", required_argument, NULL, 2 }, + { "snap2", required_argument, NULL, 2 }, +- { "metadata-snap", optional_argument, NULL, 'm' }, + { "verbose", no_argument, NULL, 4 }, + { NULL, no_argument, NULL, 0 } + }; +@@ -661,25 +618,25 @@ thin_delta_cmd::run(int argc, char **argv) + while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { + switch (c) { + case 'h': +- app.usage(cout); ++ usage(cout); + return 0; + ++ case 'm': ++ fs.use_metadata_snap = true; ++ if (optarg) ++ fs.metadata_snap = parse_uint64(optarg, "metadata snapshot block"); ++ break; ++ + case 'V': + cout << THIN_PROVISIONING_TOOLS_VERSION << endl; + return 0; + + case 1: +- fs.snap1 = app.parse_int(optarg, "thin id 1"); ++ fs.snap1 = parse_uint64(optarg, "thin id 1"); + break; + + case 2: +- fs.snap2 = app.parse_int(optarg, "thin id 2"); +- break; +- +- case 'm': +- fs.use_metadata_snap = true; +- if (optarg) +- fs.metadata_snap = app.parse_int(optarg, "metadata snapshot block"); ++ fs.snap2 = parse_uint64(optarg, "thin id 2"); + break; + + case 4: +@@ -687,23 +644,23 @@ thin_delta_cmd::run(int argc, char **argv) + break; + + default: +- app.usage(cerr); ++ usage(cerr); + return 1; + } + } + + if (argc == optind) +- app.die("No input device provided."); ++ die("No input device provided."); + else + fs.dev = argv[optind]; + + if (!fs.snap1) +- app.die("--snap1 not specified."); ++ die("--snap1 not specified."); + + if (!fs.snap2) +- app.die("--snap2 not specified."); ++ die("--snap2 not specified."); + +- return delta(app, fs); ++ return delta(fs); + } + + //---------------------------------------------------------------- +-- +1.8.3.1 + diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 6f3c954..bf07122 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 3%{?dist}%{?release_suffix} +Release: 4%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz @@ -16,6 +16,18 @@ Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version Source1: dmpd090-vendor2.tar.gz Patch0: device-mapper-persistent-data-avoid-strip.patch Patch1: 0001-Update-dependencies.patch +Patch2: 0001-all-Fix-resource-leaks.patch +Patch3: 0002-thin_show_metadata-Fix-out-of-bounds-access.patch +Patch4: 0003-build-Fix-customized-emitter-linkage.patch +Patch5: 0004-thin_dump-Fix-leaked-shared-object-handle.patch +Patch6: 0005-thin_show_duplicates-Fix-potential-errors.patch +Patch7: 0006-thin_metadata_size-Fix-potential-string-overflow.patch +Patch8: 0007-all-Fix-uninitialized-class-members.patch +Patch9: 0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch +Patch10: 0009-build-Remove-unused-sources-from-the-regular-build.patch +Patch11: 0010-all-Remove-unreachable-code.patch +Patch12: 0011-file_utils-Fix-resource-leak.patch +Patch13: 0012-thin_delta-Clean-up-duplicated-code.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++ Requires: expat @@ -52,6 +64,18 @@ directory = "vendor" END %endif %patch0 -p1 -b .avoid_strip +%patch2 -p1 -b .backup2 +%patch3 -p1 -b .backup3 +%patch4 -p1 -b .backup4 +%patch5 -p1 -b .backup5 +%patch6 -p1 -b .backup6 +%patch7 -p1 -b .backup7 +%patch8 -p1 -b .backup8 +%patch9 -p1 -b .backup9 +%patch10 -p1 -b .backup10 +%patch11 -p1 -b .backup11 +%patch12 -p1 -b .backup12 +%patch13 -p1 -b .backup13 echo %{version}-%{release} > VERSION %generate_buildrequires @@ -124,6 +148,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Thu Jun 10 2021 Marian Csontos - 0.9.0-4 +- Fix gating test syntax. +- Fix important issues found by static analysis. + * Tue Jan 26 2021 Fedora Release Engineering - 0.9.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From c6ef39964e661fc9bce3986e19e95e0d4cdf720c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 20:41:22 +0000 Subject: [PATCH 094/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index bf07122..c86c7a4 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 4%{?dist}%{?release_suffix} +Release: 5%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz @@ -148,6 +148,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Wed Jul 21 2021 Fedora Release Engineering - 0.9.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Thu Jun 10 2021 Marian Csontos - 0.9.0-4 - Fix gating test syntax. - Fix important issues found by static analysis. From 60cbba5ee81000d9886322fd300fee3b718f83f2 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 22 Jul 2021 11:47:33 +0200 Subject: [PATCH 095/135] Fix build issue --- .gitignore | 1 + 0001-Update-dependencies.patch | 2 +- ...-Remove-lboost_iostreams-linker-flag.patch | 16 + 0014-cargo-update.patch | 848 ++++++++++++++++++ device-mapper-persistent-data.spec | 12 +- sources | 2 +- 6 files changed, 877 insertions(+), 4 deletions(-) create mode 100644 0013-build-Remove-lboost_iostreams-linker-flag.patch create mode 100644 0014-cargo-update.patch diff --git a/.gitignore b/.gitignore index 6a128c2..6a9d402 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ /v0.9.0.tar.gz /dmpd090-vendor.tar.gz /dmpd090-vendor2.tar.gz +/dmpd090-vendor3.tar.gz diff --git a/0001-Update-dependencies.patch b/0001-Update-dependencies.patch index aaca7ac..e900d2f 100644 --- a/0001-Update-dependencies.patch +++ b/0001-Update-dependencies.patch @@ -16,7 +16,7 @@ index 892ea4c..93fc807 100644 byteorder = "1.3" clap = "2.33" -crc32c = "0.4" -+crc32c = "0.5" ++crc32c = "0.6" flate2 = "1.0" fixedbitset = "0.3" libc = "0.2.71" diff --git a/0013-build-Remove-lboost_iostreams-linker-flag.patch b/0013-build-Remove-lboost_iostreams-linker-flag.patch new file mode 100644 index 0000000..82eba49 --- /dev/null +++ b/0013-build-Remove-lboost_iostreams-linker-flag.patch @@ -0,0 +1,16 @@ + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index b1fd4aa..77c467d 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -173,7 +173,7 @@ CXXFLAGS+=@CXXDEBUG_FLAG@ + CXXFLAGS+=@CXX_STRERROR_FLAG@ + CXXFLAGS+=@LFS_FLAGS@ + INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning +-LIBS:=-laio -lexpat -lboost_iostreams -ldl ++LIBS:=-laio -lexpat -ldl + + ifeq ("@DEVTOOLS@", "yes") + LIBS+=-lncurses diff --git a/0014-cargo-update.patch b/0014-cargo-update.patch new file mode 100644 index 0000000..84c867d --- /dev/null +++ b/0014-cargo-update.patch @@ -0,0 +1,848 @@ +From 0a061474ee8f8183bded35a7c680739c9b75ad4b Mon Sep 17 00:00:00 2001 +From: Marian Csontos +Date: Mon, 28 Jun 2021 13:14:37 +0200 +Subject: [PATCH] cargo update + +--- + Cargo.lock | 486 +++++++++++++++++++++++++++++++++---------------------------- + 1 file changed, 264 insertions(+), 222 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index d42d598..9dc0b8a 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -1,567 +1,609 @@ + # This file is automatically @generated by Cargo. + # It is not intended for manual editing. + [[package]] +-name = "adler32" +-version = "1.0.4" ++name = "adler" ++version = "1.0.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + + [[package]] + name = "aho-corasick" +-version = "0.7.10" ++version = "0.7.18" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" + dependencies = [ +- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "memchr", + ] + + [[package]] + name = "ansi_term" + version = "0.11.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" + dependencies = [ +- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi", + ] + + [[package]] + name = "anyhow" +-version = "1.0.31" ++version = "1.0.41" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61" + + [[package]] + name = "arrayvec" +-version = "0.4.12" ++version = "0.5.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +-dependencies = [ +- "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +-] ++checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + + [[package]] + name = "atty" + version = "0.2.14" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" + dependencies = [ +- "hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", +- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "hermit-abi", ++ "libc", ++ "winapi", + ] + + [[package]] + name = "autocfg" +-version = "1.0.0" ++version = "1.0.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + + [[package]] + name = "bitflags" + version = "1.2.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + + [[package]] + name = "byteorder" +-version = "1.3.4" ++version = "1.4.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + + [[package]] + name = "cc" +-version = "1.0.54" ++version = "1.0.68" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" ++ ++[[package]] ++name = "cfg-if" ++version = "0.1.10" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + + [[package]] + name = "cfg-if" +-version = "0.1.9" ++version = "1.0.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + + [[package]] + name = "clap" +-version = "2.33.1" ++version = "2.33.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" + dependencies = [ +- "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +- "vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "ansi_term", ++ "atty", ++ "bitflags", ++ "strsim", ++ "textwrap", ++ "unicode-width", ++ "vec_map", + ] + + [[package]] + name = "crc32c" +-version = "0.4.0" ++version = "0.6.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "210cdf933e6a81212bfabf90cd8762f471b5922e5f6b709547673ad8e04b9448" ++dependencies = [ ++ "rustc_version", ++] + + [[package]] + name = "crc32fast" +-version = "1.2.0" ++version = "1.2.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" + dependencies = [ +- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if 1.0.0", + ] + + [[package]] + name = "env_logger" + version = "0.7.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" + dependencies = [ +- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +- "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ++ "log", ++ "regex", + ] + + [[package]] + name = "fixedbitset" +-version = "0.3.0" ++version = "0.3.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "45e780567ed7abc415d12fd464571d265eb4a5710ddc97cdb1a31a4c35bb479d" + + [[package]] + name = "flate2" +-version = "1.0.14" ++version = "1.0.20" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" + dependencies = [ +- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", +- "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if 1.0.0", ++ "crc32fast", ++ "libc", ++ "miniz_oxide", + ] + + [[package]] + name = "getrandom" +-version = "0.1.14" ++version = "0.1.16" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" + dependencies = [ +- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if 1.0.0", ++ "libc", ++ "wasi 0.9.0+wasi-snapshot-preview1", + ] + + [[package]] +-name = "hermit-abi" +-version = "0.1.13" ++name = "getrandom" ++version = "0.2.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" + dependencies = [ +- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if 1.0.0", ++ "libc", ++ "wasi 0.10.2+wasi-snapshot-preview1", + ] + + [[package]] +-name = "lazy_static" +-version = "1.4.0" ++name = "hermit-abi" ++version = "0.1.19" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" ++dependencies = [ ++ "libc", ++] + + [[package]] + name = "lexical-core" +-version = "0.6.7" ++version = "0.7.6" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" + dependencies = [ +- "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", +- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +- "static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ++ "arrayvec", ++ "bitflags", ++ "cfg-if 1.0.0", ++ "ryu", ++ "static_assertions", + ] + + [[package]] + name = "libc" +-version = "0.2.71" ++version = "0.2.97" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" + + [[package]] + name = "log" +-version = "0.4.8" ++version = "0.4.14" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" + dependencies = [ +- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if 1.0.0", + ] + + [[package]] + name = "memchr" +-version = "2.3.3" ++version = "2.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" + + [[package]] + name = "miniz_oxide" +-version = "0.3.6" ++version = "0.4.4" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" + dependencies = [ +- "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ++ "adler", ++ "autocfg", + ] + + [[package]] + name = "nix" + version = "0.17.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" + dependencies = [ +- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)", +- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", +- "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "bitflags", ++ "cc", ++ "cfg-if 0.1.10", ++ "libc", ++ "void", + ] + + [[package]] +-name = "nodrop" +-version = "0.1.14" +-source = "registry+https://github.com/rust-lang/crates.io-index" +- +-[[package]] + name = "nom" +-version = "5.1.1" ++version = "5.1.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" + dependencies = [ +- "lexical-core 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", +- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "lexical-core", ++ "memchr", ++ "version_check", + ] + + [[package]] + name = "num-derive" +-version = "0.3.0" ++version = "0.3.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" + dependencies = [ +- "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", +- "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", ++ "quote", ++ "syn", + ] + + [[package]] + name = "num-traits" +-version = "0.2.11" ++version = "0.2.14" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" + dependencies = [ +- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "autocfg", + ] + + [[package]] + name = "num_cpus" + version = "1.13.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" + dependencies = [ +- "hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", ++ "hermit-abi", ++ "libc", + ] + + [[package]] + name = "ppv-lite86" +-version = "0.2.8" ++version = "0.2.10" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + + [[package]] + name = "proc-macro2" +-version = "1.0.18" ++version = "1.0.27" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" + dependencies = [ +- "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "unicode-xid", + ] + + [[package]] + name = "quick-xml" + version = "0.18.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3cc440ee4802a86e357165021e3e255a9143724da31db1e2ea540214c96a0f82" + dependencies = [ +- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "memchr", + ] + + [[package]] + name = "quickcheck" + version = "0.9.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a44883e74aa97ad63db83c4bf8ca490f02b2fc02f92575e720c8551e843c945f" + dependencies = [ +- "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "env_logger", ++ "log", ++ "rand 0.7.3", ++ "rand_core 0.5.1", + ] + + [[package]] + name = "quickcheck_macros" + version = "0.9.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "608c156fd8e97febc07dc9c2e2c80bf74cfc6ef26893eae3daf8bc2bc94a4b7f" + dependencies = [ +- "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", +- "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", ++ "quote", ++ "syn", + ] + + [[package]] + name = "quote" +-version = "1.0.6" ++version = "1.0.9" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" + dependencies = [ +- "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", + ] + + [[package]] + name = "rand" + version = "0.7.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" + dependencies = [ +- "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "getrandom 0.1.16", ++ "libc", ++ "rand_chacha 0.2.2", ++ "rand_core 0.5.1", ++ "rand_hc 0.2.0", ++] ++ ++[[package]] ++name = "rand" ++version = "0.8.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" ++dependencies = [ ++ "libc", ++ "rand_chacha 0.3.1", ++ "rand_core 0.6.3", ++ "rand_hc 0.3.1", + ] + + [[package]] + name = "rand_chacha" + version = "0.2.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" + dependencies = [ +- "ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "ppv-lite86", ++ "rand_core 0.5.1", ++] ++ ++[[package]] ++name = "rand_chacha" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" ++dependencies = [ ++ "ppv-lite86", ++ "rand_core 0.6.3", + ] + + [[package]] + name = "rand_core" + version = "0.5.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" + dependencies = [ +- "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "getrandom 0.1.16", ++] ++ ++[[package]] ++name = "rand_core" ++version = "0.6.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" ++dependencies = [ ++ "getrandom 0.2.3", + ] + + [[package]] + name = "rand_hc" + version = "0.2.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" ++dependencies = [ ++ "rand_core 0.5.1", ++] ++ ++[[package]] ++name = "rand_hc" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" + dependencies = [ +- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "rand_core 0.6.3", + ] + + [[package]] + name = "redox_syscall" +-version = "0.1.56" ++version = "0.2.9" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" ++dependencies = [ ++ "bitflags", ++] + + [[package]] + name = "regex" +-version = "1.3.9" ++version = "1.5.4" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" + dependencies = [ +- "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)", +- "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "aho-corasick", ++ "memchr", ++ "regex-syntax", + ] + + [[package]] + name = "regex-syntax" +-version = "0.6.18" ++version = "0.6.25" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + + [[package]] + name = "remove_dir_all" + version = "0.5.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" + dependencies = [ +- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi", + ] + + [[package]] + name = "rustc_version" + version = "0.2.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" + dependencies = [ +- "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "semver", + ] + + [[package]] + name = "ryu" + version = "1.0.5" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + + [[package]] + name = "semver" + version = "0.9.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" + dependencies = [ +- "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "semver-parser", + ] + + [[package]] + name = "semver-parser" + version = "0.7.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + + [[package]] + name = "static_assertions" +-version = "0.3.4" ++version = "1.1.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + + [[package]] + name = "strsim" + version = "0.8.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + + [[package]] + name = "syn" +-version = "1.0.30" ++version = "1.0.73" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" + dependencies = [ +- "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", +- "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +- "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", ++ "quote", ++ "unicode-xid", + ] + + [[package]] + name = "tempfile" +-version = "3.1.0" ++version = "3.2.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" + dependencies = [ +- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", +- "remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if 1.0.0", ++ "libc", ++ "rand 0.8.4", ++ "redox_syscall", ++ "remove_dir_all", ++ "winapi", + ] + + [[package]] + name = "textwrap" + version = "0.11.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" + dependencies = [ +- "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ++ "unicode-width", + ] + + [[package]] + name = "thinp" + version = "0.1.0" + dependencies = [ +- "anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", +- "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +- "clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "crc32c 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "fixedbitset 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", +- "nix 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +- "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "quick-xml 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "quickcheck 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "quickcheck_macros 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +-] +- +-[[package]] +-name = "thread_local" +-version = "1.0.1" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-dependencies = [ +- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "anyhow", ++ "byteorder", ++ "clap", ++ "crc32c", ++ "fixedbitset", ++ "flate2", ++ "libc", ++ "nix", ++ "nom", ++ "num-derive", ++ "num-traits", ++ "num_cpus", ++ "quick-xml", ++ "quickcheck", ++ "quickcheck_macros", ++ "rand 0.7.3", ++ "tempfile", + ] + + [[package]] + name = "unicode-width" +-version = "0.1.7" ++version = "0.1.8" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" + + [[package]] + name = "unicode-xid" +-version = "0.2.0" ++version = "0.2.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + + [[package]] + name = "vec_map" + version = "0.8.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + + [[package]] + name = "version_check" +-version = "0.9.2" ++version = "0.9.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" + + [[package]] + name = "void" + version = "1.0.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + + [[package]] + name = "wasi" + version = "0.9.0+wasi-snapshot-preview1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" ++ ++[[package]] ++name = "wasi" ++version = "0.10.2+wasi-snapshot-preview1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + + [[package]] + name = "winapi" +-version = "0.3.8" ++version = "0.3.9" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" + dependencies = [ +- "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", + ] + + [[package]] + name = "winapi-i686-pc-windows-gnu" + version = "0.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + + [[package]] + name = "winapi-x86_64-pc-windows-gnu" + version = "0.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +- +-[metadata] +-"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" +-"checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +-"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +-"checksum anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f" +-"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +-"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +-"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +-"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +-"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +-"checksum cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)" = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" +-"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" +-"checksum clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" +-"checksum crc32c 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77ba37ef26c12988c1cee882d522d65e1d5d2ad8c3864665b88ee92767ed84c5" +-"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +-"checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +-"checksum fixedbitset 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4fcacf5cd3681968f6524ea159383132937739c6c40dabab9e37ed515911b" +-"checksum flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" +-"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +-"checksum hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71" +-"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +-"checksum lexical-core 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f86d66d380c9c5a685aaac7a11818bdfa1f733198dfd9ec09c70b762cd12ad6f" +-"checksum libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)" = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" +-"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +-"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +-"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" +-"checksum nix 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" +-"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +-"checksum nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b471253da97532da4b61552249c521e01e736071f71c1a4f7ebbfbf0a06aad6" +-"checksum num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c8b15b261814f992e33760b1fca9fe8b693d8a65299f20c9901688636cfb746" +-"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +-"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +-"checksum ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +-"checksum proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" +-"checksum quick-xml 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3cc440ee4802a86e357165021e3e255a9143724da31db1e2ea540214c96a0f82" +-"checksum quickcheck 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a44883e74aa97ad63db83c4bf8ca490f02b2fc02f92575e720c8551e843c945f" +-"checksum quickcheck_macros 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "608c156fd8e97febc07dc9c2e2c80bf74cfc6ef26893eae3daf8bc2bc94a4b7f" +-"checksum quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" +-"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +-"checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +-"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +-"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +-"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +-"checksum regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +-"checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +-"checksum remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +-"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +-"checksum ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +-"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +-"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +-"checksum static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" +-"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +-"checksum syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)" = "93a56fabc59dce20fe48b6c832cc249c713e7ed88fa28b0ee0a3bfcaae5fe4e2" +-"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +-"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +-"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +-"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +-"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +-"checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +-"checksum version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +-"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +-"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +-"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +-"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +-"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +-- +1.8.3.1 + diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index c86c7a4..fc8f4fc 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,12 +8,12 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 5%{?dist}%{?release_suffix} +Release: 6%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd090-vendor2.tar.gz +Source1: dmpd090-vendor3.tar.gz Patch0: device-mapper-persistent-data-avoid-strip.patch Patch1: 0001-Update-dependencies.patch Patch2: 0001-all-Fix-resource-leaks.patch @@ -28,6 +28,8 @@ Patch10: 0009-build-Remove-unused-sources-from-the-regular-build.patch Patch11: 0010-all-Remove-unreachable-code.patch Patch12: 0011-file_utils-Fix-resource-leak.patch Patch13: 0012-thin_delta-Clean-up-duplicated-code.patch +Patch14: 0013-build-Remove-lboost_iostreams-linker-flag.patch +Patch15: 0014-cargo-update.patch BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++ Requires: expat @@ -50,6 +52,7 @@ snapshot eras %setup -q -n thin-provisioning-tools-%{version}%{?version_suffix} %ifarch %{rust_arches} %patch1 -p1 -b .toml_update +%patch15 -p1 -b .backup15 #%%cargo_prep #%%cargo_generate_buildrequires tar xf %{SOURCE1} @@ -76,6 +79,8 @@ END %patch11 -p1 -b .backup11 %patch12 -p1 -b .backup12 %patch13 -p1 -b .backup13 +%patch14 -p1 -b .backup14 +# NOTE: patch 15 is above at the rust setup echo %{version}-%{release} > VERSION %generate_buildrequires @@ -148,6 +153,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Thu Jul 22 2021 Marian Csontos - 0.9.0-6 +- Fix rust-1.53 compilation issues. + * Wed Jul 21 2021 Fedora Release Engineering - 0.9.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index 87073b3..8031915 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (v0.9.0.tar.gz) = e1796fb3948847d72ca8247cae58017507c0a847a00201b93668eeb8fbfea4107c4c2affa5c211c149798a89b10474e83d2bd61a5545a668299be97aed591e0f -SHA512 (dmpd090-vendor2.tar.gz) = 47e22d34e34345ae5c91e66063c2f78865b055fccd47c34a97e2bd2fed1f64fc7f13ad27071a149fefba53f5b437beeda3bacde25b690431e1ae50f77cec440c +SHA512 (dmpd090-vendor3.tar.gz) = 90891c377a27695b20ce260852260d4fe08f3db6dba99401e56f2643a7ec94115c33e9c84b54188845acfde855e682c9b91c72dec3554effeade226b1df3303e From 126554fe2a01b1927aa4123346b5241d5d80a26f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 00:33:44 +0000 Subject: [PATCH 096/135] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index fc8f4fc..2bc7ef5 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 6%{?dist}%{?release_suffix} +Release: 7%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz @@ -153,6 +153,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 0.9.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Thu Jul 22 2021 Marian Csontos - 0.9.0-6 - Fix rust-1.53 compilation issues. From 99369c4f67d2cf714971426338feba91d1087cba Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Fri, 24 Jun 2022 14:44:10 +0200 Subject: [PATCH 097/135] tests: Fix compatibility with Python3 xrange was renamed to range in Python3. --- tests/functions_test/dmpd_library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functions_test/dmpd_library.py b/tests/functions_test/dmpd_library.py index d50d08f..04286f4 100755 --- a/tests/functions_test/dmpd_library.py +++ b/tests/functions_test/dmpd_library.py @@ -1280,7 +1280,7 @@ class LVM: _print("WARN: (%s) does not match lvs output format" % lv) continue lv_info_dict = {} - for index in xrange(len(param_names)): + for index in range(len(param_names)): lv_info_dict[param_names[index]] = m.group(index + 1) lv_list.append(lv_info_dict) From 20de387ada068b1df674a69e91cc7428e5df74d6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 21 Jul 2022 00:21:07 +0000 Subject: [PATCH 098/135] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 2bc7ef5..58d2fb8 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 7%{?dist}%{?release_suffix} +Release: 8%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz @@ -153,6 +153,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Thu Jul 21 2022 Fedora Release Engineering - 0.9.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Thu Jan 20 2022 Fedora Release Engineering - 0.9.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From eb7bb8b3431e7447e5c24188e6955aad4491ac1b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 01:17:27 +0000 Subject: [PATCH 099/135] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 58d2fb8..7397373 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 8%{?dist}%{?release_suffix} +Release: 9%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz @@ -153,6 +153,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 0.9.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Thu Jul 21 2022 Fedora Release Engineering - 0.9.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 804560ae466da55da3e4449e4ee3ec261b080b17 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Sun, 5 Feb 2023 19:06:07 +0100 Subject: [PATCH 100/135] Rebuild for fixed frame pointer compiler flags in Rust RPM macros --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 7397373..f4fb197 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -8,7 +8,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 0.9.0 -Release: 9%{?dist}%{?release_suffix} +Release: 10%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz @@ -153,6 +153,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Sun Feb 05 2023 Fabio Valentini - 0.9.0-10 +- Rebuild for fixed frame pointer compiler flags in Rust RPM macros. + * Thu Jan 19 2023 Fedora Release Engineering - 0.9.0-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 8d2c47ae1c4c83a2ba826b768c61e2a5495d80d2 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Wed, 22 Feb 2023 15:49:20 +0100 Subject: [PATCH 101/135] Update to version 1.0.2 --- .gitignore | 2 + ...o.toml-to-work-with-vendor-directory.patch | 40 + 0001-Update-dependencies.patch | 25 - 0001-all-Fix-resource-leaks.patch | 42 - 0002-Fix-paths.patch | 30 + ...ow_metadata-Fix-out-of-bounds-access.patch | 26 - ...build-Fix-customized-emitter-linkage.patch | 25 - ...dump-Fix-leaked-shared-object-handle.patch | 139 --- ...show_duplicates-Fix-potential-errors.patch | 52 -- ...a_size-Fix-potential-string-overflow.patch | 33 - ...-all-Fix-uninitialized-class-members.patch | 83 -- ...x-warnings-on-potential-NULL-pointer.patch | 88 -- ...nused-sources-from-the-regular-build.patch | 52 -- 0010-all-Remove-unreachable-code.patch | 51 -- 0011-file_utils-Fix-resource-leak.patch | 24 - ...-thin_delta-Clean-up-duplicated-code.patch | 224 ----- ...-Remove-lboost_iostreams-linker-flag.patch | 16 - 0014-cargo-update.patch | 848 ------------------ device-mapper-persistent-data.spec | 62 +- sources | 4 +- 20 files changed, 93 insertions(+), 1773 deletions(-) create mode 100644 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch delete mode 100644 0001-Update-dependencies.patch delete mode 100644 0001-all-Fix-resource-leaks.patch create mode 100644 0002-Fix-paths.patch delete mode 100644 0002-thin_show_metadata-Fix-out-of-bounds-access.patch delete mode 100644 0003-build-Fix-customized-emitter-linkage.patch delete mode 100644 0004-thin_dump-Fix-leaked-shared-object-handle.patch delete mode 100644 0005-thin_show_duplicates-Fix-potential-errors.patch delete mode 100644 0006-thin_metadata_size-Fix-potential-string-overflow.patch delete mode 100644 0007-all-Fix-uninitialized-class-members.patch delete mode 100644 0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch delete mode 100644 0009-build-Remove-unused-sources-from-the-regular-build.patch delete mode 100644 0010-all-Remove-unreachable-code.patch delete mode 100644 0011-file_utils-Fix-resource-leak.patch delete mode 100644 0012-thin_delta-Clean-up-duplicated-code.patch delete mode 100644 0013-build-Remove-lboost_iostreams-linker-flag.patch delete mode 100644 0014-cargo-update.patch diff --git a/.gitignore b/.gitignore index 6a9d402..bb141e9 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ /dmpd090-vendor.tar.gz /dmpd090-vendor2.tar.gz /dmpd090-vendor3.tar.gz +/v1.0.2.tar.gz +/dmpd102-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch new file mode 100644 index 0000000..eb446ba --- /dev/null +++ b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch @@ -0,0 +1,40 @@ +From 3d67b5c78f350db25e028112105014b09c2b34b3 Mon Sep 17 00:00:00 2001 +From: Marian Csontos +Date: Wed, 22 Feb 2023 18:07:57 +0100 +Subject: [PATCH] Tweak cargo.toml to work with vendor directory + +--- + Cargo.lock | 2 +- + Cargo.toml | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index 4ff194a7..a4a56d75 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -973,7 +973,7 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + + [[package]] + name = "thinp" +-version = "0.1.0" ++version = "1.0.2" + dependencies = [ + "anyhow", + "atty", +diff --git a/Cargo.toml b/Cargo.toml +index 94c8e5b3..6f6912ec 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -29,7 +29,8 @@ quick-xml = "0.23.1" + rand = "0.8" + rangemap = "1.1" + roaring = "0.10" +-rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } ++#rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } ++rio = { version = "0.9.4", optional = true } + safemem = "0.3" + threadpool = "1.8" + thiserror = "1.0" +-- +2.39.1 + diff --git a/0001-Update-dependencies.patch b/0001-Update-dependencies.patch deleted file mode 100644 index e900d2f..0000000 --- a/0001-Update-dependencies.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 4a45e1d7eafb83ec9c76f0b3278f4bc7efbdde9d Mon Sep 17 00:00:00 2001 -From: Marian Csontos -Date: Tue, 1 Sep 2020 14:55:48 +0200 -Subject: [PATCH] Update dependencies - ---- - Cargo.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Cargo.toml b/Cargo.toml -index 892ea4c..93fc807 100644 ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -9,7 +9,7 @@ license = "GPL3" - anyhow = "1.0" - byteorder = "1.3" - clap = "2.33" --crc32c = "0.4" -+crc32c = "0.6" - flate2 = "1.0" - fixedbitset = "0.3" - libc = "0.2.71" --- -1.8.3.1 - diff --git a/0001-all-Fix-resource-leaks.patch b/0001-all-Fix-resource-leaks.patch deleted file mode 100644 index 6519dfc..0000000 --- a/0001-all-Fix-resource-leaks.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 48676b9f1aac63f8a30ed8061b6e719929b82c98 Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Wed, 28 Apr 2021 10:34:16 +0800 -Subject: [PATCH 01/10] [all] Fix resource leaks - ---- - base/file_utils.cc | 4 +++- - thin-provisioning/cache_stream.cc | 2 +- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/base/file_utils.cc b/base/file_utils.cc -index e4f3722..8253660 100644 ---- a/base/file_utils.cc -+++ b/base/file_utils.cc -@@ -155,8 +155,10 @@ file_utils::zero_superblock(std::string const &path) - throw runtime_error("out of memory"); - - memset(buffer, 0, SUPERBLOCK_SIZE); -- if (::write(fd.fd_, buffer, SUPERBLOCK_SIZE) != SUPERBLOCK_SIZE) -+ if (::write(fd.fd_, buffer, SUPERBLOCK_SIZE) != SUPERBLOCK_SIZE) { -+ free(buffer); - throw runtime_error("couldn't zero superblock"); -+ } - } - - //---------------------------------------------------------------- -diff --git a/thin-provisioning/cache_stream.cc b/thin-provisioning/cache_stream.cc -index 002b6ba..73b01b4 100644 ---- a/thin-provisioning/cache_stream.cc -+++ b/thin-provisioning/cache_stream.cc -@@ -62,7 +62,7 @@ chunk const & - cache_stream::get() - { - chunk_wrapper *w = new chunk_wrapper(*this); -- return w->c_; -+ return w->c_; // wrapper will get freed by the put method - } - - void --- -1.8.3.1 - diff --git a/0002-Fix-paths.patch b/0002-Fix-paths.patch new file mode 100644 index 0000000..75858c6 --- /dev/null +++ b/0002-Fix-paths.patch @@ -0,0 +1,30 @@ +From 26571db5911e6a85e13965d0359799537ac4ce54 Mon Sep 17 00:00:00 2001 +From: Marian Csontos +Date: Thu, 23 Feb 2023 12:11:16 +0100 +Subject: [PATCH] Fix paths + +Use PREFIX instead of DESTDIR. DESTDIR is used for things like BUILDROOT +--- + Makefile | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 0286000b..92c6d325 100644 +--- a/Makefile ++++ b/Makefile +@@ -6,9 +6,9 @@ PDATA_TOOLS=\ + $(PDATA_TOOLS): + $(V) cargo build --release + +-DESTDIR:=/usr +-BINDIR:=$(DESTDIR)/sbin +-DATADIR:=$(DESTDIR)/share ++PREFIX:=/usr ++BINDIR:=$(DESTDIR)$(PREFIX)/sbin ++DATADIR:=$(DESTDIR)$(PREFIX)/share + MANPATH:=$(DATADIR)/man + + STRIP:=strip +-- +2.39.2 + diff --git a/0002-thin_show_metadata-Fix-out-of-bounds-access.patch b/0002-thin_show_metadata-Fix-out-of-bounds-access.patch deleted file mode 100644 index 66a6f0d..0000000 --- a/0002-thin_show_metadata-Fix-out-of-bounds-access.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 691a0237809b5364117446a8a9b0cceeb0a747c1 Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Tue, 1 Jun 2021 11:24:11 +0800 -Subject: [PATCH 02/10] [thin_show_metadata] Fix out-of-bounds access - ---- - thin-provisioning/thin_show_metadata.cc | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/thin-provisioning/thin_show_metadata.cc b/thin-provisioning/thin_show_metadata.cc -index bdbab3f..dbc7a80 100644 ---- a/thin-provisioning/thin_show_metadata.cc -+++ b/thin-provisioning/thin_show_metadata.cc -@@ -206,7 +206,8 @@ namespace { - - void run() { - auto line_length = 80; -- for (block_address b = 0; b < 2000; b++) { -+ block_address nr_blocks = std::min(2000, bm_.get_nr_blocks()); -+ for (block_address b = 0; b < nr_blocks; b++) { - block_manager::read_ref rr = bm_.read_lock(b); - - if (!(b % line_length)) { --- -1.8.3.1 - diff --git a/0003-build-Fix-customized-emitter-linkage.patch b/0003-build-Fix-customized-emitter-linkage.patch deleted file mode 100644 index 05cfb56..0000000 --- a/0003-build-Fix-customized-emitter-linkage.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 65369d88610069ba7bbd011b00af19523638b0fb Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Tue, 1 Jun 2021 13:32:26 +0800 -Subject: [PATCH 03/10] [build] Fix customized emitter linkage - ---- - contrib/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/contrib/Makefile.in b/contrib/Makefile.in -index 038c41c..7192258 100644 ---- a/contrib/Makefile.in -+++ b/contrib/Makefile.in -@@ -18,7 +18,7 @@ contrib/%.a: contrib/%.o - $(V)echo " [AR] $@" - $(V)$(AR) rcs $@ $^ - --contrib/%.so: contrib/%.a -+contrib/%.so: contrib/%.o - $(V)echo " [LD] $@" - $(V)$(CC) -shared -Wl,-soname,$@ -o $@ $< - --- -1.8.3.1 - diff --git a/0004-thin_dump-Fix-leaked-shared-object-handle.patch b/0004-thin_dump-Fix-leaked-shared-object-handle.patch deleted file mode 100644 index 983143a..0000000 --- a/0004-thin_dump-Fix-leaked-shared-object-handle.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 7fbd79cab2e548eb388bc782dd39f1cde027173b Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Tue, 1 Jun 2021 23:37:36 +0800 -Subject: [PATCH 04/10] [thin_dump] Fix leaked shared object handle - ---- - thin-provisioning/shared_library_emitter.cc | 113 ++++++++++++++++++++++++---- - 1 file changed, 100 insertions(+), 13 deletions(-) - -diff --git a/thin-provisioning/shared_library_emitter.cc b/thin-provisioning/shared_library_emitter.cc -index 58f12d2..2e845f3 100644 ---- a/thin-provisioning/shared_library_emitter.cc -+++ b/thin-provisioning/shared_library_emitter.cc -@@ -8,22 +8,109 @@ using namespace thin_provisioning; - - //---------------------------------------------------------------- - --emitter::ptr --thin_provisioning::create_custom_emitter(string const &shared_lib, ostream &out) --{ -- emitter::ptr (*create_fn)(ostream &out); -- void *handle = dlopen(shared_lib.c_str(), RTLD_LAZY); -- if (!handle) -- throw runtime_error(dlerror()); -+struct shared_object { -+public: -+ shared_object(const char *shared_lib) { -+ handle_ = dlopen(shared_lib, RTLD_LAZY); -+ if (!handle_) -+ throw runtime_error(dlerror()); -+ -+ dlerror(); // Clear any existing error -+ } -+ -+ virtual ~shared_object() { -+ dlclose(handle_); -+ } -+ -+ void *get_symbol(const char *symbol) { -+ void *sym = dlsym(handle_, symbol); -+ -+ char *error = dlerror(); -+ if (error) -+ throw runtime_error(error); -+ -+ return sym; -+ } -+ -+ void *handle_; -+}; -+ -+class shared_emitter : public emitter { -+public: -+ shared_emitter(const char *shared_lib, ostream &out): sobj_(shared_lib) { -+ emitter::ptr (*create_fn)(ostream &out); -+ create_fn = reinterpret_cast( -+ sobj_.get_symbol("create_emitter")); -+ inner_ = create_fn(out); -+ } -+ -+ virtual ~shared_emitter() { -+ } -+ -+ void begin_superblock(std::string const &uuid, -+ uint64_t time, -+ uint64_t trans_id, -+ boost::optional flags, -+ boost::optional version, -+ uint32_t data_block_size, -+ uint64_t nr_data_blocks, -+ boost::optional metadata_snap) { -+ inner_->begin_superblock(uuid, -+ time, -+ trans_id, -+ flags, -+ version, -+ data_block_size, -+ nr_data_blocks, -+ metadata_snap); -+ } - -- dlerror(); // Clear any existing error -- create_fn = reinterpret_cast(dlsym(handle, "create_emitter")); -+ void end_superblock() { -+ inner_->end_superblock(); -+ } - -- char *error = dlerror(); -- if (error) -- throw runtime_error(error); -+ void begin_device(uint32_t dev_id, -+ uint64_t mapped_blocks, -+ uint64_t trans_id, -+ uint64_t creation_time, -+ uint64_t snap_time) { -+ inner_->begin_device(dev_id, mapped_blocks, trans_id, creation_time, snap_time); -+ } - -- return create_fn(out); -+ void end_device() { -+ inner_->end_device(); -+ } -+ -+ void begin_named_mapping(std::string const &name) { -+ inner_->begin_named_mapping(name); -+ } -+ -+ void end_named_mapping() { -+ inner_->end_named_mapping(); -+ } -+ -+ void identifier(std::string const &name) { -+ inner_->identifier(name); -+ } -+ -+ void range_map(uint64_t origin_begin, uint64_t data_begin, uint32_t time, uint64_t len) { -+ inner_->range_map(origin_begin, data_begin, time, len); -+ } -+ -+ void single_map(uint64_t origin_block, uint64_t data_block, uint32_t time) { -+ inner_->single_map(origin_block, data_block, time); -+ } -+ -+ shared_object sobj_; -+ emitter::ptr inner_; -+}; -+ -+//---------------------------------------------------------------- -+ -+emitter::ptr -+thin_provisioning::create_custom_emitter(string const &shared_lib, ostream &out) -+{ -+ return emitter::ptr(new shared_emitter(shared_lib.c_str(), out)); - } - - //---------------------------------------------------------------- --- -1.8.3.1 - diff --git a/0005-thin_show_duplicates-Fix-potential-errors.patch b/0005-thin_show_duplicates-Fix-potential-errors.patch deleted file mode 100644 index ee07eb3..0000000 --- a/0005-thin_show_duplicates-Fix-potential-errors.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 32de33be68f3892698d492b9ab8f21f9186b3f4c Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Wed, 2 Jun 2021 01:23:13 +0800 -Subject: [PATCH 05/10] [thin_show_duplicates] Fix potential errors - -- Fix error if no --block-sector provided -- Fix errors on pools without mappings, or zero-length file ---- - thin-provisioning/thin_show_duplicates.cc | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/thin-provisioning/thin_show_duplicates.cc b/thin-provisioning/thin_show_duplicates.cc -index b1eebb7..f7354eb 100644 ---- a/thin-provisioning/thin_show_duplicates.cc -+++ b/thin-provisioning/thin_show_duplicates.cc -@@ -56,7 +56,7 @@ using namespace thin_provisioning; - - namespace { - bool factor_of(block_address f, block_address n) { -- return (n % f) == 0; -+ return f && (n % f) == 0; - } - - uint64_t parse_int(string const &str, string const &desc) { -@@ -132,11 +132,15 @@ namespace { - class duplicate_detector { - public: - void scan_with_variable_sized_chunks(chunk_stream &stream) { -+ if (!stream.size()) -+ return; - variable_chunk_stream vstream(stream, 4096); - scan(vstream); - } - - void scan_with_fixed_sized_chunks(chunk_stream &stream, block_address chunk_size) { -+ if (!stream.size()) -+ return; - fixed_chunk_stream fstream(stream, chunk_size); - scan(fstream); - } -@@ -222,7 +226,7 @@ namespace { - if (fs.content_based_chunks) - detector.scan_with_variable_sized_chunks(pstream); - else { -- if (*fs.block_size) { -+ if (!!fs.block_size) { - if (factor_of(*fs.block_size, block_size)) - block_size = *fs.block_size; - else --- -1.8.3.1 - diff --git a/0006-thin_metadata_size-Fix-potential-string-overflow.patch b/0006-thin_metadata_size-Fix-potential-string-overflow.patch deleted file mode 100644 index cd22d1c..0000000 --- a/0006-thin_metadata_size-Fix-potential-string-overflow.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 35e96e07c956a501cb8a12f5b873db173bb09179 Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Wed, 2 Jun 2021 11:39:01 +0800 -Subject: [PATCH 06/10] [thin_metadata_size] Fix potential string overflow - ---- - thin-provisioning/thin_metadata_size.cc | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/thin-provisioning/thin_metadata_size.cc b/thin-provisioning/thin_metadata_size.cc -index b6a5718..f14696c 100644 ---- a/thin-provisioning/thin_metadata_size.cc -+++ b/thin-provisioning/thin_metadata_size.cc -@@ -192,9 +192,13 @@ static void printf_aligned(struct global *g, char const *a, char const *b, char - { - char buf[80]; - -- strcpy(buf, b); -- if (units) -- strcat(buf, mandatory ? "{" :"["), strcat(buf, g->unit.chars), strcat(buf, mandatory ? "}" : "]"); -+ if (units) { -+ char left_bracket = mandatory ? '{' : '['; -+ char right_bracket = mandatory ? '}' : ']'; -+ snprintf(buf, 80, "%s%c%s%c", b, left_bracket, g->unit.chars, right_bracket); -+ } else { -+ snprintf(buf, 80, "%s", b); -+ } - - printf("\t%-4s%-44s%s\n", a, buf, c); - } --- -1.8.3.1 - diff --git a/0007-all-Fix-uninitialized-class-members.patch b/0007-all-Fix-uninitialized-class-members.patch deleted file mode 100644 index 11971a6..0000000 --- a/0007-all-Fix-uninitialized-class-members.patch +++ /dev/null @@ -1,83 +0,0 @@ -From f1e404c33ad14f6784aa1926ae75fa49e614748e Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Wed, 2 Jun 2021 12:14:34 +0800 -Subject: [PATCH 07/10] [all] Fix uninitialized class members - ---- - era/restore_emitter.cc | 1 + - thin-provisioning/metadata_dumper.cc | 10 +++++++--- - thin-provisioning/thin_delta.cc | 4 +++- - 3 files changed, 11 insertions(+), 4 deletions(-) - -diff --git a/era/restore_emitter.cc b/era/restore_emitter.cc -index c09fa66..7fbac7d 100644 ---- a/era/restore_emitter.cc -+++ b/era/restore_emitter.cc -@@ -14,6 +14,7 @@ namespace { - : md_(md), - in_superblock_(false), - in_writeset_(false), -+ era_(0), - in_era_array_(false) { - } - -diff --git a/thin-provisioning/metadata_dumper.cc b/thin-provisioning/metadata_dumper.cc -index 4feb40f..665c762 100644 ---- a/thin-provisioning/metadata_dumper.cc -+++ b/thin-provisioning/metadata_dumper.cc -@@ -180,7 +180,7 @@ namespace { - // This is about classifying and summarising btree nodes. The use of a btree - // node may not be obvious when inspecting it in isolation. But more information - // may be gleaned by examining child and sibling nodes. --// -+// - // So the process is: - // - scan every metadata block, summarising it's potential uses. - // - repeatedly iterate those summaries until we can glean no more useful information. -@@ -474,7 +474,7 @@ namespace { - node_info get_internal_info(block_manager::read_ref &rr) { - node_info info; - info.b = rr.get_location(); -- -+ - // values refer to blocks, so we should have infos for them. - auto n = to_node(rr); - ::uint64_t key_low = 0; -@@ -524,7 +524,7 @@ namespace { - node_info info; - info.b = rr.get_location(); - -- auto vsize = to_cpu(hdr.value_size); -+ auto vsize = to_cpu(hdr.value_size); - info.values = to_cpu(hdr.nr_entries); - - if (vsize == sizeof(device_details_traits::disk_type)) { -@@ -645,6 +645,10 @@ namespace { - public: - mapping_emit_visitor(emitter::ptr e) - : e_(e), -+ origin_start_(0), -+ dest_start_(0), -+ time_(0), -+ len_(0), - in_range_(false) { - } - -diff --git a/thin-provisioning/thin_delta.cc b/thin-provisioning/thin_delta.cc -index 5b31608..ee48dea 100644 ---- a/thin-provisioning/thin_delta.cc -+++ b/thin-provisioning/thin_delta.cc -@@ -259,7 +259,9 @@ namespace local { - class simple_emitter : public diff_emitter { - public: - simple_emitter(indented_stream &out) -- : diff_emitter(out) { -+ : diff_emitter(out), -+ vbegin_(0), -+ vend_(0) { - } - - void left_only(uint64_t vbegin, uint64_t dbegin, uint64_t len) { --- -1.8.3.1 - diff --git a/0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch b/0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch deleted file mode 100644 index 6005172..0000000 --- a/0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 5d79a5c944d05f71425d3156597a2a61c5f2ab9a Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Wed, 2 Jun 2021 13:08:47 +0800 -Subject: [PATCH 08/10] [thin_dump] Fix warnings on potential NULL pointer - ---- - base/application.cc | 8 +++++++- - base/application.h | 2 +- - thin-provisioning/thin_dump.cc | 16 ++-------------- - 3 files changed, 10 insertions(+), 16 deletions(-) - -diff --git a/base/application.cc b/base/application.cc -index 61338ff..dbd55a5 100644 ---- a/base/application.cc -+++ b/base/application.cc -@@ -25,8 +25,14 @@ command::die(string const &msg) - } - - ::uint64_t --command::parse_uint64(string const &str, string const &desc) -+command::parse_uint64(char const *str, char const *desc) - { -+ if (!str) { -+ ostringstream out; -+ out << "Couldn't parse " << desc << ": NULL"; -+ die(out.str()); -+ } -+ - try { - // FIXME: check trailing garbage is handled - return lexical_cast<::uint64_t>(str); -diff --git a/base/application.h b/base/application.h -index b799eaf..f071533 100644 ---- a/base/application.h -+++ b/base/application.h -@@ -19,7 +19,7 @@ namespace base { - virtual ~command() {} - - void die(std::string const &msg); -- uint64_t parse_uint64(std::string const &str, std::string const &desc); -+ uint64_t parse_uint64(char const *str, char const *desc); - - - virtual void usage(std::ostream &out) const = 0; -diff --git a/thin-provisioning/thin_dump.cc b/thin-provisioning/thin_dump.cc -index 74cfa91..c0e73e6 100644 ---- a/thin-provisioning/thin_dump.cc -+++ b/thin-provisioning/thin_dump.cc -@@ -143,7 +143,6 @@ thin_dump_cmd::run(int argc, char **argv) - int c; - char const *output = NULL; - const char shortopts[] = "hm::o:f:rV"; -- char *end_ptr; - block_address metadata_snap = 0; - ::uint64_t dev_id; - struct flags flags; -@@ -181,13 +180,7 @@ thin_dump_cmd::run(int argc, char **argv) - flags.use_metadata_snap = true; - if (optarg) { - // FIXME: deprecate this option -- metadata_snap = strtoull(optarg, &end_ptr, 10); -- if (end_ptr == optarg) { -- cerr << "couldn't parse " << endl; -- usage(cerr); -- return 1; -- } -- -+ metadata_snap = parse_uint64(optarg, "metadata-snap"); - flags.snap_location = metadata_snap; - } - break; -@@ -197,12 +190,7 @@ thin_dump_cmd::run(int argc, char **argv) - break; - - case 1: -- dev_id = strtoull(optarg, &end_ptr, 10); -- if (end_ptr == optarg) { -- cerr << "couldn't parse \n"; -- usage(cerr); -- return 1; -- } -+ dev_id = parse_uint64(optarg, "dev-id"); - flags.opts.select_dev(dev_id); - break; - --- -1.8.3.1 - diff --git a/0009-build-Remove-unused-sources-from-the-regular-build.patch b/0009-build-Remove-unused-sources-from-the-regular-build.patch deleted file mode 100644 index 7d49603..0000000 --- a/0009-build-Remove-unused-sources-from-the-regular-build.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 1c50c406ddda77f4c0b20e7bf3cc985e84526f51 Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Wed, 2 Jun 2021 13:14:30 +0800 -Subject: [PATCH 09/10] [build] Remove unused sources from the regular build - ---- - Makefile.in | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/Makefile.in b/Makefile.in -index b1fd4aa..9b13001 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -96,10 +96,7 @@ SOURCE=\ - persistent-data/transaction_manager.cc \ - persistent-data/validators.cc \ - thin-provisioning/commands.cc \ -- thin-provisioning/cache_stream.cc \ -- thin-provisioning/chunk_stream.cc \ - thin-provisioning/device_tree.cc \ -- thin-provisioning/fixed_chunk_stream.cc \ - thin-provisioning/human_readable_format.cc \ - thin-provisioning/mapping_tree.cc \ - thin-provisioning/metadata.cc \ -@@ -107,7 +104,6 @@ SOURCE=\ - thin-provisioning/metadata_counter.cc \ - thin-provisioning/metadata_dumper.cc \ - thin-provisioning/override_emitter.cc \ -- thin-provisioning/pool_stream.cc \ - thin-provisioning/restore_emitter.cc \ - thin-provisioning/rmap_visitor.cc \ - thin-provisioning/superblock.cc \ -@@ -124,7 +120,11 @@ SOURCE=\ - thin-provisioning/xml_format.cc - - DEVTOOLS_SOURCE=\ -+ thin-provisioning/cache_stream.cc \ -+ thin-provisioning/chunk_stream.cc \ - thin-provisioning/damage_generator.cc \ -+ thin-provisioning/fixed_chunk_stream.cc \ -+ thin-provisioning/pool_stream.cc \ - thin-provisioning/thin_journal.cc \ - thin-provisioning/thin_journal_check.cc \ - thin-provisioning/thin_ll_dump.cc \ -@@ -374,4 +374,3 @@ test: functional-test unit-test - endif - - -include $(DEPEND_FILES) -- --- -1.8.3.1 - diff --git a/0010-all-Remove-unreachable-code.patch b/0010-all-Remove-unreachable-code.patch deleted file mode 100644 index b72ec41..0000000 --- a/0010-all-Remove-unreachable-code.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 9e94a4349186f7353e0d7b536b46bfa4df2483d0 Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Wed, 2 Jun 2021 14:59:29 +0800 -Subject: [PATCH 10/10] [all] Remove unreachable code - ---- - block-cache/io_engine.cc | 3 --- - caching/hint_array.cc | 6 ------ - 2 files changed, 9 deletions(-) - -diff --git a/block-cache/io_engine.cc b/block-cache/io_engine.cc -index 2fe4082..0158723 100644 ---- a/block-cache/io_engine.cc -+++ b/block-cache/io_engine.cc -@@ -174,9 +174,6 @@ aio_engine::wait_(timespec *ts) - cbs_.free(cb); - return optional(make_pair(false, context)); - } -- -- // shouldn't get here -- return optional(make_pair(false, 0)); - } - - struct timespec -diff --git a/caching/hint_array.cc b/caching/hint_array.cc -index 6514968..e133c5c 100644 ---- a/caching/hint_array.cc -+++ b/caching/hint_array.cc -@@ -56,9 +56,6 @@ namespace { - default: - throw runtime_error("invalid hint width"); - } -- -- // never get here -- return std::shared_ptr(); - } - - //-------------------------------- -@@ -93,9 +90,6 @@ namespace { - default: - throw runtime_error("invalid hint width"); - } -- -- // never get here -- return std::shared_ptr(); - } - - //-------------------------------- --- -1.8.3.1 - diff --git a/0011-file_utils-Fix-resource-leak.patch b/0011-file_utils-Fix-resource-leak.patch deleted file mode 100644 index bef546b..0000000 --- a/0011-file_utils-Fix-resource-leak.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 677fa789e4136dbdd589c1e65efc7cdaad7506ac Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Fri, 4 Jun 2021 21:37:02 +0800 -Subject: [PATCH 1/2] [file_utils] Fix resource leak - ---- - base/file_utils.cc | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/base/file_utils.cc b/base/file_utils.cc -index 8253660..e6095f7 100644 ---- a/base/file_utils.cc -+++ b/base/file_utils.cc -@@ -159,6 +159,7 @@ file_utils::zero_superblock(std::string const &path) - free(buffer); - throw runtime_error("couldn't zero superblock"); - } -+ free(buffer); - } - - //---------------------------------------------------------------- --- -1.8.3.1 - diff --git a/0012-thin_delta-Clean-up-duplicated-code.patch b/0012-thin_delta-Clean-up-duplicated-code.patch deleted file mode 100644 index b45136e..0000000 --- a/0012-thin_delta-Clean-up-duplicated-code.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 2e755c67064c0157e646acfa57fbcc738905f7d4 Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Tue, 20 Oct 2020 15:18:06 +0800 -Subject: [PATCH 2/2] [thin_delta] Clean up duplicated code - ---- - thin-provisioning/thin_delta.cc | 105 ++++++++++++---------------------------- - 1 file changed, 31 insertions(+), 74 deletions(-) - -diff --git a/thin-provisioning/thin_delta.cc b/thin-provisioning/thin_delta.cc -index ee48dea..2ff3e69 100644 ---- a/thin-provisioning/thin_delta.cc -+++ b/thin-provisioning/thin_delta.cc -@@ -22,47 +22,7 @@ using namespace thin_provisioning; - - //---------------------------------------------------------------- - --namespace local { -- class application { -- public: -- application(string const &cmd) -- : cmd_(cmd) { -- } -- -- void usage(ostream &out) { -- out << "Usage: " << cmd_ << " [options] \n" -- << "Options:\n" -- << " {--thin1, --snap1}\n" -- << " {--thin2, --snap2}\n" -- << " {-m, --metadata-snap} [block#]\n" -- << " {--verbose}\n" -- << " {-h|--help}\n" -- << " {-V|--version}" << endl; -- } -- -- void die(string const &msg) { -- cerr << msg << endl; -- usage(cerr); -- exit(1); -- } -- -- uint64_t parse_int(string const &str, string const &desc) { -- try { -- return boost::lexical_cast(str); -- -- } catch (...) { -- ostringstream out; -- out << "Couldn't parse " << desc << ": '" << str << "'"; -- die(out.str()); -- } -- -- return 0; // never get here -- } -- -- private: -- string cmd_; -- }; -- -+namespace { - struct flags { - flags() - : verbose(false), -@@ -96,13 +56,6 @@ namespace local { - uint64_t vbegin_, dbegin_, len_; - }; - -- ostream &operator <<(ostream &out, mapping const &m) { -- out << "mapping[vbegin = " << m.vbegin_ -- << ", dbegin = " << m.dbegin_ -- << ", len = " << m.len_ << "]"; -- return out; -- } -- - //-------------------------------- - - template -@@ -542,7 +495,7 @@ namespace local { - out << "\n"; - } - -- void delta_(application &app, flags const &fs) { -+ void delta_(flags const &fs) { - mapping_recorder mr1; - mapping_recorder mr2; - damage_visitor damage_v; -@@ -560,7 +513,7 @@ namespace local { - if (!snap1_root) { - ostringstream out; - out << "Unable to find mapping tree for snap1 (" << *fs.snap1 << ")"; -- app.die(out.str()); -+ throw std::runtime_error(out.str()); - } - - single_mapping_tree snap1(*md->tm_, *snap1_root, -@@ -572,7 +525,7 @@ namespace local { - if (!snap2_root) { - ostringstream out; - out << "Unable to find mapping tree for snap2 (" << *fs.snap2 << ")"; -- app.die(out.str()); -+ throw std::runtime_error(out.str()); - } - - single_mapping_tree snap2(*md->tm_, *snap2_root, -@@ -609,12 +562,12 @@ namespace local { - end_superblock(is); - } - -- int delta(application &app, flags const &fs) { -+ int delta(flags const &fs) { - try { -- delta_(app, fs); -+ delta_(fs); - } catch (exception const &e) { -- app.die(e.what()); -- return 1; // never get here -+ cerr << e.what() << endl; -+ return 1; - } - - return 0; -@@ -633,27 +586,31 @@ thin_delta_cmd::thin_delta_cmd() - void - thin_delta_cmd::usage(std::ostream &out) const - { -- // FIXME: finish -+ out << "Usage: " << get_name() << " [options] \n" -+ << "Options:\n" -+ << " {--thin1, --snap1}\n" -+ << " {--thin2, --snap2}\n" -+ << " {-m, --metadata-snap} [block#]\n" -+ << " {--verbose}\n" -+ << " {-h|--help}\n" -+ << " {-V|--version}" << endl; - } - - int - thin_delta_cmd::run(int argc, char **argv) - { -- using namespace local; -- - int c; - flags fs; -- local::application app(basename(argv[0])); - - char const shortopts[] = "hVm::"; - option const longopts[] = { - { "help", no_argument, NULL, 'h' }, -+ { "metadata-snap", optional_argument, NULL, 'm' }, - { "version", no_argument, NULL, 'V' }, - { "thin1", required_argument, NULL, 1 }, - { "snap1", required_argument, NULL, 1 }, - { "thin2", required_argument, NULL, 2 }, - { "snap2", required_argument, NULL, 2 }, -- { "metadata-snap", optional_argument, NULL, 'm' }, - { "verbose", no_argument, NULL, 4 }, - { NULL, no_argument, NULL, 0 } - }; -@@ -661,25 +618,25 @@ thin_delta_cmd::run(int argc, char **argv) - while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { - switch (c) { - case 'h': -- app.usage(cout); -+ usage(cout); - return 0; - -+ case 'm': -+ fs.use_metadata_snap = true; -+ if (optarg) -+ fs.metadata_snap = parse_uint64(optarg, "metadata snapshot block"); -+ break; -+ - case 'V': - cout << THIN_PROVISIONING_TOOLS_VERSION << endl; - return 0; - - case 1: -- fs.snap1 = app.parse_int(optarg, "thin id 1"); -+ fs.snap1 = parse_uint64(optarg, "thin id 1"); - break; - - case 2: -- fs.snap2 = app.parse_int(optarg, "thin id 2"); -- break; -- -- case 'm': -- fs.use_metadata_snap = true; -- if (optarg) -- fs.metadata_snap = app.parse_int(optarg, "metadata snapshot block"); -+ fs.snap2 = parse_uint64(optarg, "thin id 2"); - break; - - case 4: -@@ -687,23 +644,23 @@ thin_delta_cmd::run(int argc, char **argv) - break; - - default: -- app.usage(cerr); -+ usage(cerr); - return 1; - } - } - - if (argc == optind) -- app.die("No input device provided."); -+ die("No input device provided."); - else - fs.dev = argv[optind]; - - if (!fs.snap1) -- app.die("--snap1 not specified."); -+ die("--snap1 not specified."); - - if (!fs.snap2) -- app.die("--snap2 not specified."); -+ die("--snap2 not specified."); - -- return delta(app, fs); -+ return delta(fs); - } - - //---------------------------------------------------------------- --- -1.8.3.1 - diff --git a/0013-build-Remove-lboost_iostreams-linker-flag.patch b/0013-build-Remove-lboost_iostreams-linker-flag.patch deleted file mode 100644 index 82eba49..0000000 --- a/0013-build-Remove-lboost_iostreams-linker-flag.patch +++ /dev/null @@ -1,16 +0,0 @@ - Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.in b/Makefile.in -index b1fd4aa..77c467d 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -173,7 +173,7 @@ CXXFLAGS+=@CXXDEBUG_FLAG@ - CXXFLAGS+=@CXX_STRERROR_FLAG@ - CXXFLAGS+=@LFS_FLAGS@ - INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning --LIBS:=-laio -lexpat -lboost_iostreams -ldl -+LIBS:=-laio -lexpat -ldl - - ifeq ("@DEVTOOLS@", "yes") - LIBS+=-lncurses diff --git a/0014-cargo-update.patch b/0014-cargo-update.patch deleted file mode 100644 index 84c867d..0000000 --- a/0014-cargo-update.patch +++ /dev/null @@ -1,848 +0,0 @@ -From 0a061474ee8f8183bded35a7c680739c9b75ad4b Mon Sep 17 00:00:00 2001 -From: Marian Csontos -Date: Mon, 28 Jun 2021 13:14:37 +0200 -Subject: [PATCH] cargo update - ---- - Cargo.lock | 486 +++++++++++++++++++++++++++++++++---------------------------- - 1 file changed, 264 insertions(+), 222 deletions(-) - -diff --git a/Cargo.lock b/Cargo.lock -index d42d598..9dc0b8a 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -1,567 +1,609 @@ - # This file is automatically @generated by Cargo. - # It is not intended for manual editing. - [[package]] --name = "adler32" --version = "1.0.4" -+name = "adler" -+version = "1.0.2" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - - [[package]] - name = "aho-corasick" --version = "0.7.10" -+version = "0.7.18" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" - dependencies = [ -- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -+ "memchr", - ] - - [[package]] - name = "ansi_term" - version = "0.11.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" - dependencies = [ -- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -+ "winapi", - ] - - [[package]] - name = "anyhow" --version = "1.0.31" -+version = "1.0.41" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61" - - [[package]] - name = "arrayvec" --version = "0.4.12" -+version = "0.5.2" - source = "registry+https://github.com/rust-lang/crates.io-index" --dependencies = [ -- "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", --] -+checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - - [[package]] - name = "atty" - version = "0.2.14" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" - dependencies = [ -- "hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", -- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", -- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -+ "hermit-abi", -+ "libc", -+ "winapi", - ] - - [[package]] - name = "autocfg" --version = "1.0.0" -+version = "1.0.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - - [[package]] - name = "bitflags" - version = "1.2.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - - [[package]] - name = "byteorder" --version = "1.3.4" -+version = "1.4.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - - [[package]] - name = "cc" --version = "1.0.54" -+version = "1.0.68" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" -+ -+[[package]] -+name = "cfg-if" -+version = "0.1.10" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - - [[package]] - name = "cfg-if" --version = "0.1.9" -+version = "1.0.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - - [[package]] - name = "clap" --version = "2.33.1" -+version = "2.33.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" - dependencies = [ -- "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", -- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -- "vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", -+ "ansi_term", -+ "atty", -+ "bitflags", -+ "strsim", -+ "textwrap", -+ "unicode-width", -+ "vec_map", - ] - - [[package]] - name = "crc32c" --version = "0.4.0" -+version = "0.6.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "210cdf933e6a81212bfabf90cd8762f471b5922e5f6b709547673ad8e04b9448" -+dependencies = [ -+ "rustc_version", -+] - - [[package]] - name = "crc32fast" --version = "1.2.0" -+version = "1.2.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" - dependencies = [ -- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", -+ "cfg-if 1.0.0", - ] - - [[package]] - name = "env_logger" - version = "0.7.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" - dependencies = [ -- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -- "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -+ "log", -+ "regex", - ] - - [[package]] - name = "fixedbitset" --version = "0.3.0" -+version = "0.3.2" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "45e780567ed7abc415d12fd464571d265eb4a5710ddc97cdb1a31a4c35bb479d" - - [[package]] - name = "flate2" --version = "1.0.14" -+version = "1.0.20" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" - dependencies = [ -- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", -- "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", -- "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -+ "cfg-if 1.0.0", -+ "crc32fast", -+ "libc", -+ "miniz_oxide", - ] - - [[package]] - name = "getrandom" --version = "0.1.14" -+version = "0.1.16" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" - dependencies = [ -- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", -- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", -- "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", -+ "cfg-if 1.0.0", -+ "libc", -+ "wasi 0.9.0+wasi-snapshot-preview1", - ] - - [[package]] --name = "hermit-abi" --version = "0.1.13" -+name = "getrandom" -+version = "0.2.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" - dependencies = [ -- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", -+ "cfg-if 1.0.0", -+ "libc", -+ "wasi 0.10.2+wasi-snapshot-preview1", - ] - - [[package]] --name = "lazy_static" --version = "1.4.0" -+name = "hermit-abi" -+version = "0.1.19" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -+dependencies = [ -+ "libc", -+] - - [[package]] - name = "lexical-core" --version = "0.6.7" -+version = "0.7.6" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" - dependencies = [ -- "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", -- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", -- "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -- "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", -- "static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -+ "arrayvec", -+ "bitflags", -+ "cfg-if 1.0.0", -+ "ryu", -+ "static_assertions", - ] - - [[package]] - name = "libc" --version = "0.2.71" -+version = "0.2.97" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" - - [[package]] - name = "log" --version = "0.4.8" -+version = "0.4.14" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" - dependencies = [ -- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", -+ "cfg-if 1.0.0", - ] - - [[package]] - name = "memchr" --version = "2.3.3" -+version = "2.4.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" - - [[package]] - name = "miniz_oxide" --version = "0.3.6" -+version = "0.4.4" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" - dependencies = [ -- "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -+ "adler", -+ "autocfg", - ] - - [[package]] - name = "nix" - version = "0.17.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" - dependencies = [ -- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)", -- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", -- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", -- "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -+ "bitflags", -+ "cc", -+ "cfg-if 0.1.10", -+ "libc", -+ "void", - ] - - [[package]] --name = "nodrop" --version = "0.1.14" --source = "registry+https://github.com/rust-lang/crates.io-index" -- --[[package]] - name = "nom" --version = "5.1.1" -+version = "5.1.2" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" - dependencies = [ -- "lexical-core 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", -- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -- "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", -+ "lexical-core", -+ "memchr", -+ "version_check", - ] - - [[package]] - name = "num-derive" --version = "0.3.0" -+version = "0.3.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" - dependencies = [ -- "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", -- "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", -- "syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)", -+ "proc-macro2", -+ "quote", -+ "syn", - ] - - [[package]] - name = "num-traits" --version = "0.2.11" -+version = "0.2.14" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" - dependencies = [ -- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "autocfg", - ] - - [[package]] - name = "num_cpus" - version = "1.13.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" - dependencies = [ -- "hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", -- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", -+ "hermit-abi", -+ "libc", - ] - - [[package]] - name = "ppv-lite86" --version = "0.2.8" -+version = "0.2.10" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - - [[package]] - name = "proc-macro2" --version = "1.0.18" -+version = "1.0.27" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" - dependencies = [ -- "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "unicode-xid", - ] - - [[package]] - name = "quick-xml" - version = "0.18.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "3cc440ee4802a86e357165021e3e255a9143724da31db1e2ea540214c96a0f82" - dependencies = [ -- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -+ "memchr", - ] - - [[package]] - name = "quickcheck" - version = "0.9.2" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "a44883e74aa97ad63db83c4bf8ca490f02b2fc02f92575e720c8551e843c945f" - dependencies = [ -- "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -- "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", -- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -+ "env_logger", -+ "log", -+ "rand 0.7.3", -+ "rand_core 0.5.1", - ] - - [[package]] - name = "quickcheck_macros" - version = "0.9.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "608c156fd8e97febc07dc9c2e2c80bf74cfc6ef26893eae3daf8bc2bc94a4b7f" - dependencies = [ -- "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", -- "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", -- "syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)", -+ "proc-macro2", -+ "quote", -+ "syn", - ] - - [[package]] - name = "quote" --version = "1.0.6" -+version = "1.0.9" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" - dependencies = [ -- "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", -+ "proc-macro2", - ] - - [[package]] - name = "rand" - version = "0.7.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" - dependencies = [ -- "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", -- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", -- "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "getrandom 0.1.16", -+ "libc", -+ "rand_chacha 0.2.2", -+ "rand_core 0.5.1", -+ "rand_hc 0.2.0", -+] -+ -+[[package]] -+name = "rand" -+version = "0.8.4" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -+dependencies = [ -+ "libc", -+ "rand_chacha 0.3.1", -+ "rand_core 0.6.3", -+ "rand_hc 0.3.1", - ] - - [[package]] - name = "rand_chacha" - version = "0.2.2" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" - dependencies = [ -- "ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -+ "ppv-lite86", -+ "rand_core 0.5.1", -+] -+ -+[[package]] -+name = "rand_chacha" -+version = "0.3.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -+dependencies = [ -+ "ppv-lite86", -+ "rand_core 0.6.3", - ] - - [[package]] - name = "rand_core" - version = "0.5.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" - dependencies = [ -- "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", -+ "getrandom 0.1.16", -+] -+ -+[[package]] -+name = "rand_core" -+version = "0.6.3" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -+dependencies = [ -+ "getrandom 0.2.3", - ] - - [[package]] - name = "rand_hc" - version = "0.2.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -+dependencies = [ -+ "rand_core 0.5.1", -+] -+ -+[[package]] -+name = "rand_hc" -+version = "0.3.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" - dependencies = [ -- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -+ "rand_core 0.6.3", - ] - - [[package]] - name = "redox_syscall" --version = "0.1.56" -+version = "0.2.9" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" -+dependencies = [ -+ "bitflags", -+] - - [[package]] - name = "regex" --version = "1.3.9" -+version = "1.5.4" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" - dependencies = [ -- "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", -- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -- "regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)", -- "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -+ "aho-corasick", -+ "memchr", -+ "regex-syntax", - ] - - [[package]] - name = "regex-syntax" --version = "0.6.18" -+version = "0.6.25" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - - [[package]] - name = "remove_dir_all" - version = "0.5.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" - dependencies = [ -- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -+ "winapi", - ] - - [[package]] - name = "rustc_version" - version = "0.2.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" - dependencies = [ -- "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "semver", - ] - - [[package]] - name = "ryu" - version = "1.0.5" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - - [[package]] - name = "semver" - version = "0.9.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" - dependencies = [ -- "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "semver-parser", - ] - - [[package]] - name = "semver-parser" - version = "0.7.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - - [[package]] - name = "static_assertions" --version = "0.3.4" -+version = "1.1.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - - [[package]] - name = "strsim" - version = "0.8.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - - [[package]] - name = "syn" --version = "1.0.30" -+version = "1.0.73" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" - dependencies = [ -- "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", -- "quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", -- "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "proc-macro2", -+ "quote", -+ "unicode-xid", - ] - - [[package]] - name = "tempfile" --version = "3.1.0" -+version = "3.2.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" - dependencies = [ -- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", -- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", -- "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", -- "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", -- "remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", -- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -+ "cfg-if 1.0.0", -+ "libc", -+ "rand 0.8.4", -+ "redox_syscall", -+ "remove_dir_all", -+ "winapi", - ] - - [[package]] - name = "textwrap" - version = "0.11.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" - dependencies = [ -- "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -+ "unicode-width", - ] - - [[package]] - name = "thinp" - version = "0.1.0" - dependencies = [ -- "anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", -- "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -- "clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "crc32c 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "fixedbitset 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", -- "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", -- "nix 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", -- "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "quick-xml 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "quickcheck 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", -- "quickcheck_macros 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", -- "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", --] -- --[[package]] --name = "thread_local" --version = "1.0.1" --source = "registry+https://github.com/rust-lang/crates.io-index" --dependencies = [ -- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "anyhow", -+ "byteorder", -+ "clap", -+ "crc32c", -+ "fixedbitset", -+ "flate2", -+ "libc", -+ "nix", -+ "nom", -+ "num-derive", -+ "num-traits", -+ "num_cpus", -+ "quick-xml", -+ "quickcheck", -+ "quickcheck_macros", -+ "rand 0.7.3", -+ "tempfile", - ] - - [[package]] - name = "unicode-width" --version = "0.1.7" -+version = "0.1.8" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" - - [[package]] - name = "unicode-xid" --version = "0.2.0" -+version = "0.2.2" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - - [[package]] - name = "vec_map" - version = "0.8.2" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - - [[package]] - name = "version_check" --version = "0.9.2" -+version = "0.9.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - - [[package]] - name = "void" - version = "1.0.2" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - - [[package]] - name = "wasi" - version = "0.9.0+wasi-snapshot-preview1" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -+ -+[[package]] -+name = "wasi" -+version = "0.10.2+wasi-snapshot-preview1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - - [[package]] - name = "winapi" --version = "0.3.8" -+version = "0.3.9" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" - dependencies = [ -- "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "winapi-i686-pc-windows-gnu", -+ "winapi-x86_64-pc-windows-gnu", - ] - - [[package]] - name = "winapi-i686-pc-windows-gnu" - version = "0.4.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - - [[package]] - name = "winapi-x86_64-pc-windows-gnu" - version = "0.4.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -- --[metadata] --"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" --"checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" --"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" --"checksum anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f" --"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" --"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" --"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" --"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" --"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" --"checksum cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)" = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" --"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" --"checksum clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" --"checksum crc32c 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77ba37ef26c12988c1cee882d522d65e1d5d2ad8c3864665b88ee92767ed84c5" --"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" --"checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" --"checksum fixedbitset 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4fcacf5cd3681968f6524ea159383132937739c6c40dabab9e37ed515911b" --"checksum flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" --"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" --"checksum hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71" --"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" --"checksum lexical-core 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f86d66d380c9c5a685aaac7a11818bdfa1f733198dfd9ec09c70b762cd12ad6f" --"checksum libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)" = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" --"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" --"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" --"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" --"checksum nix 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" --"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" --"checksum nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b471253da97532da4b61552249c521e01e736071f71c1a4f7ebbfbf0a06aad6" --"checksum num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c8b15b261814f992e33760b1fca9fe8b693d8a65299f20c9901688636cfb746" --"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" --"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" --"checksum ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" --"checksum proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" --"checksum quick-xml 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3cc440ee4802a86e357165021e3e255a9143724da31db1e2ea540214c96a0f82" --"checksum quickcheck 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a44883e74aa97ad63db83c4bf8ca490f02b2fc02f92575e720c8551e843c945f" --"checksum quickcheck_macros 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "608c156fd8e97febc07dc9c2e2c80bf74cfc6ef26893eae3daf8bc2bc94a4b7f" --"checksum quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" --"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" --"checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" --"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" --"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" --"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" --"checksum regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" --"checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" --"checksum remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" --"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" --"checksum ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" --"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" --"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" --"checksum static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" --"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" --"checksum syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)" = "93a56fabc59dce20fe48b6c832cc249c713e7ed88fa28b0ee0a3bfcaae5fe4e2" --"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" --"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" --"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" --"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" --"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" --"checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" --"checksum version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" --"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" --"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" --"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" --"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" --"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" --- -1.8.3.1 - diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index f4fb197..1bd5595 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -1,37 +1,26 @@ # # Copyright (C) 2011-2017 Red Hat, Inc # +%bcond_without check +%global debug_package %{nil} #%%global version_suffix -rc2 #%%global release_suffix .test3 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 0.9.0 -Release: 10%{?dist}%{?release_suffix} +Version: 1.0.2 +Release: 1%{?dist}%{?release_suffix} License: GPLv3+ URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd090-vendor3.tar.gz -Patch0: device-mapper-persistent-data-avoid-strip.patch -Patch1: 0001-Update-dependencies.patch -Patch2: 0001-all-Fix-resource-leaks.patch -Patch3: 0002-thin_show_metadata-Fix-out-of-bounds-access.patch -Patch4: 0003-build-Fix-customized-emitter-linkage.patch -Patch5: 0004-thin_dump-Fix-leaked-shared-object-handle.patch -Patch6: 0005-thin_show_duplicates-Fix-potential-errors.patch -Patch7: 0006-thin_metadata_size-Fix-potential-string-overflow.patch -Patch8: 0007-all-Fix-uninitialized-class-members.patch -Patch9: 0008-thin_dump-Fix-warnings-on-potential-NULL-pointer.patch -Patch10: 0009-build-Remove-unused-sources-from-the-regular-build.patch -Patch11: 0010-all-Remove-unreachable-code.patch -Patch12: 0011-file_utils-Fix-resource-leak.patch -Patch13: 0012-thin_delta-Clean-up-duplicated-code.patch -Patch14: 0013-build-Remove-lboost_iostreams-linker-flag.patch -Patch15: 0014-cargo-update.patch +Source1: dmpd102-vendor.tar.gz +#Patch0: device-mapper-persistent-data-avoid-strip.patch +Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +Patch2: 0002-Fix-paths.patch -BuildRequires: autoconf, expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++ +BuildRequires: expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++ Requires: expat %ifarch %{rust_arches} BuildRequires: rust-packaging @@ -52,7 +41,6 @@ snapshot eras %setup -q -n thin-provisioning-tools-%{version}%{?version_suffix} %ifarch %{rust_arches} %patch1 -p1 -b .toml_update -%patch15 -p1 -b .backup15 #%%cargo_prep #%%cargo_generate_buildrequires tar xf %{SOURCE1} @@ -66,40 +54,24 @@ directory = "vendor" END %endif -%patch0 -p1 -b .avoid_strip +#%%patch0 -p1 -b .avoid_strip %patch2 -p1 -b .backup2 -%patch3 -p1 -b .backup3 -%patch4 -p1 -b .backup4 -%patch5 -p1 -b .backup5 -%patch6 -p1 -b .backup6 -%patch7 -p1 -b .backup7 -%patch8 -p1 -b .backup8 -%patch9 -p1 -b .backup9 -%patch10 -p1 -b .backup10 -%patch11 -p1 -b .backup11 -%patch12 -p1 -b .backup12 -%patch13 -p1 -b .backup13 -%patch14 -p1 -b .backup14 # NOTE: patch 15 is above at the rust setup echo %{version}-%{release} > VERSION %generate_buildrequires %build -autoconf -%configure --with-optimisation= -make %{?_smp_mflags} V= -%ifarch %{rust_arches} +#make %{?_smp_mflags} V= %cargo_build + +%if %{with check} +%check +%cargo_test %endif %install make DESTDIR=%{buildroot} MANDIR=%{_mandir} install -%ifarch %{rust_arches} -make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools -# cargo_install installs into /usr/bin -#%%cargo_install -%endif %files %doc COPYING README.md @@ -153,6 +125,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install-rust-tools #% {_sbindir}/thin_show_duplicates %changelog +* Wed Feb 22 2023 Marian Csontos - 1.0.2-1 +- Update to latest upstream release 1.0.2. +- Complete rewrite in rust. + * Sun Feb 05 2023 Fabio Valentini - 0.9.0-10 - Rebuild for fixed frame pointer compiler flags in Rust RPM macros. diff --git a/sources b/sources index 8031915..886ab81 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v0.9.0.tar.gz) = e1796fb3948847d72ca8247cae58017507c0a847a00201b93668eeb8fbfea4107c4c2affa5c211c149798a89b10474e83d2bd61a5545a668299be97aed591e0f -SHA512 (dmpd090-vendor3.tar.gz) = 90891c377a27695b20ce260852260d4fe08f3db6dba99401e56f2643a7ec94115c33e9c84b54188845acfde855e682c9b91c72dec3554effeade226b1df3303e +SHA512 (v1.0.2.tar.gz) = f5401631f0d10cb0fbd8e4b2979b38d2dc42621de558ffb23b2bcc12f1b7fead49ffa8b143af61227917edce9abc7b5a48c94036ae74c035a181661f82e80ed1 +SHA512 (dmpd102-vendor.tar.gz) = bc50c456d2fea1ab4db21d30f66a967bee51b33b5f2435740551b6ad290f8286a14dbadb998b9913900aa71eb2a7ccd01c3e4618937fd67aa7fe8b4591039a15 From db577ef350a909cb398e104e7921e50c3f2777c7 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Fri, 28 Apr 2023 16:41:15 +0200 Subject: [PATCH 102/135] Update to version 1.0.4 --- .gitignore | 2 + ...o.toml-to-work-with-vendor-directory.patch | 41 +++++++++---------- 0002-Fix-paths.patch | 30 -------------- device-mapper-persistent-data.spec | 35 ++++++---------- sources | 4 +- 5 files changed, 37 insertions(+), 75 deletions(-) delete mode 100644 0002-Fix-paths.patch diff --git a/.gitignore b/.gitignore index bb141e9..b2a848e 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ /dmpd090-vendor3.tar.gz /v1.0.2.tar.gz /dmpd102-vendor.tar.gz +/v1.0.4.tar.gz +/dmpd104-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch index eb446ba..ae2234b 100644 --- a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +++ b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch @@ -1,31 +1,30 @@ -From 3d67b5c78f350db25e028112105014b09c2b34b3 Mon Sep 17 00:00:00 2001 +From a6afd3ee7c9b5a6ab2906c827464acceb75123b2 Mon Sep 17 00:00:00 2001 From: Marian Csontos -Date: Wed, 22 Feb 2023 18:07:57 +0100 +Date: Wed, 22 Mar 2023 09:42:15 +0100 Subject: [PATCH] Tweak cargo.toml to work with vendor directory +Mock works offline, cargo would try to download the files from github. +So cargo vendor has to be run first, and then change the Cargo.toml to +make mock happy. --- - Cargo.lock | 2 +- - Cargo.toml | 3 ++- - 2 files changed, 3 insertions(+), 2 deletions(-) + Cargo.toml | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) -diff --git a/Cargo.lock b/Cargo.lock -index 4ff194a7..a4a56d75 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -973,7 +973,7 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - - [[package]] - name = "thinp" --version = "0.1.0" -+version = "1.0.2" - dependencies = [ - "anyhow", - "atty", diff --git a/Cargo.toml b/Cargo.toml -index 94c8e5b3..6f6912ec 100644 +index 135ba5f8..cbb73ec1 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -29,7 +29,8 @@ quick-xml = "0.23.1" +@@ -11,7 +11,8 @@ anyhow = "1.0" + base64 = "0.20" + byteorder = "1.4" + clap = "3.2" +-crc32c = { git = "https://github.com/zowens/crc32c", branch = "master" } ++#crc32c = { git = "https://github.com/zowens/crc32c", branch = "master" } ++crc32c = "0.6" + data-encoding = "2.3" + exitcode = "1.1.2" + fixedbitset = "0.4" +@@ -28,7 +29,8 @@ quick-xml = "0.23.1" rand = "0.8" rangemap = "1.1" roaring = "0.10" @@ -36,5 +35,5 @@ index 94c8e5b3..6f6912ec 100644 threadpool = "1.8" thiserror = "1.0" -- -2.39.1 +2.40.1 diff --git a/0002-Fix-paths.patch b/0002-Fix-paths.patch deleted file mode 100644 index 75858c6..0000000 --- a/0002-Fix-paths.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 26571db5911e6a85e13965d0359799537ac4ce54 Mon Sep 17 00:00:00 2001 -From: Marian Csontos -Date: Thu, 23 Feb 2023 12:11:16 +0100 -Subject: [PATCH] Fix paths - -Use PREFIX instead of DESTDIR. DESTDIR is used for things like BUILDROOT ---- - Makefile | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/Makefile b/Makefile -index 0286000b..92c6d325 100644 ---- a/Makefile -+++ b/Makefile -@@ -6,9 +6,9 @@ PDATA_TOOLS=\ - $(PDATA_TOOLS): - $(V) cargo build --release - --DESTDIR:=/usr --BINDIR:=$(DESTDIR)/sbin --DATADIR:=$(DESTDIR)/share -+PREFIX:=/usr -+BINDIR:=$(DESTDIR)$(PREFIX)/sbin -+DATADIR:=$(DESTDIR)$(PREFIX)/share - MANPATH:=$(DATADIR)/man - - STRIP:=strip --- -2.39.2 - diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 1bd5595..9070dc7 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,25 +9,22 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 1.0.2 +Version: 1.0.4 Release: 1%{?dist}%{?release_suffix} License: GPLv3+ +#ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd102-vendor.tar.gz -#Patch0: device-mapper-persistent-data-avoid-strip.patch +Source1: dmpd104-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch -Patch2: 0002-Fix-paths.patch -BuildRequires: expat-devel, libaio-devel, libstdc++-devel, boost-devel, gcc-c++ -Requires: expat -%ifarch %{rust_arches} BuildRequires: rust-packaging BuildRequires: rust >= 1.35 BuildRequires: cargo -%endif BuildRequires: make +# FIXME: Remove this! +BuildRequires: rust-gdb %description thin-provisioning-tools contains check,dump,restore,repair,rmap @@ -38,9 +35,7 @@ are included and era check, dump, restore and invalidate to manage snapshot eras %prep -%setup -q -n thin-provisioning-tools-%{version}%{?version_suffix} -%ifarch %{rust_arches} -%patch1 -p1 -b .toml_update +%autosetup -p1 -n thin-provisioning-tools-%{version}%{?version_suffix} #%%cargo_prep #%%cargo_generate_buildrequires tar xf %{SOURCE1} @@ -53,10 +48,6 @@ replace-with = "vendored-sources" directory = "vendor" END -%endif -#%%patch0 -p1 -b .avoid_strip -%patch2 -p1 -b .backup2 -# NOTE: patch 15 is above at the rust setup echo %{version}-%{release} > VERSION %generate_buildrequires @@ -67,7 +58,9 @@ echo %{version}-%{release} > VERSION %if %{with check} %check +# FIXME: Reenable testing! %cargo_test +#cargo test --test thin_shrink -- --nocapture --test-threads=1 %endif %install @@ -94,10 +87,8 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_mandir}/man8/thin_restore.8.gz %{_mandir}/man8/thin_rmap.8.gz %{_mandir}/man8/thin_trim.8.gz -%ifarch %{rust_arches} %{_mandir}/man8/thin_metadata_pack.8.gz %{_mandir}/man8/thin_metadata_unpack.8.gz -%endif %{_sbindir}/pdata_tools %{_sbindir}/cache_check %{_sbindir}/cache_dump @@ -118,16 +109,16 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install %{_sbindir}/thin_restore %{_sbindir}/thin_rmap %{_sbindir}/thin_trim -%ifarch %{rust_arches} %{_sbindir}/thin_metadata_pack %{_sbindir}/thin_metadata_unpack -%endif #% {_sbindir}/thin_show_duplicates %changelog -* Wed Feb 22 2023 Marian Csontos - 1.0.2-1 -- Update to latest upstream release 1.0.2. -- Complete rewrite in rust. +* Fri Apr 28 2023 Marian Csontos - 1.0.4-1 +- Update to latest upstream release 1.0.4. + +* Wed Mar 22 2023 Marian Csontos - 1.0.3-1 +- Update to latest upstream release 1.0.3. * Sun Feb 05 2023 Fabio Valentini - 0.9.0-10 - Rebuild for fixed frame pointer compiler flags in Rust RPM macros. diff --git a/sources b/sources index 886ab81..dbf8c9f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.0.2.tar.gz) = f5401631f0d10cb0fbd8e4b2979b38d2dc42621de558ffb23b2bcc12f1b7fead49ffa8b143af61227917edce9abc7b5a48c94036ae74c035a181661f82e80ed1 -SHA512 (dmpd102-vendor.tar.gz) = bc50c456d2fea1ab4db21d30f66a967bee51b33b5f2435740551b6ad290f8286a14dbadb998b9913900aa71eb2a7ccd01c3e4618937fd67aa7fe8b4591039a15 +SHA512 (v1.0.4.tar.gz) = a6700ea26dd24e8285d85e58f9016dccca071d21b20650f8a39e523e6f0394891e57615caaad4c16290961e170fe4ab4bec9ae38bc06dcc9ddac9114a0374034 +SHA512 (dmpd104-vendor.tar.gz) = d14a10fdbe1535b64c1911878da1be8dce3ce5e89c66fc0648e2a9c3e5e27b4874a99eee17175bf88e2d0c7dfa68382ba6746de3563feb28d6e070beae394f65 From ee730faf27105f3ebe01736670409d1c36ecbe71 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 30 May 2023 16:15:12 -0400 Subject: [PATCH 103/135] Use rust-toolset in RHEL builds RHEL provides a minimal set of macros compared to Fedora. --- device-mapper-persistent-data.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 9070dc7..5af6792 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.4 -Release: 1%{?dist}%{?release_suffix} +Release: 2%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools @@ -19,9 +19,13 @@ Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version Source1: dmpd104-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +%if %{defined rhel} +BuildRequires: rust-toolset +%else BuildRequires: rust-packaging BuildRequires: rust >= 1.35 BuildRequires: cargo +%endif BuildRequires: make # FIXME: Remove this! BuildRequires: rust-gdb @@ -114,6 +118,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Tue May 30 2023 Yaakov Selkowitz - 1.0.4-2 +- Use rust-toolset in RHEL builds + * Fri Apr 28 2023 Marian Csontos - 1.0.4-1 - Update to latest upstream release 1.0.4. From e1a1e8841fcdc5a2e2dfdf3242e1892393473aa6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jul 2023 17:19:36 +0000 Subject: [PATCH 104/135] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 5af6792..8638005 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.4 -Release: 2%{?dist}%{?release_suffix} +Release: 3%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools @@ -118,6 +118,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Wed Jul 19 2023 Fedora Release Engineering - 1.0.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue May 30 2023 Yaakov Selkowitz - 1.0.4-2 - Use rust-toolset in RHEL builds From 9ca4681979e359aa57ff4d9031a0b9a8ad845c9a Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 27 Jul 2023 12:15:09 +0200 Subject: [PATCH 105/135] Update to version 1.0.5 --- .gitignore | 2 ++ ...go.toml-to-work-with-vendor-directory.patch | 18 +++++++++--------- device-mapper-persistent-data.spec | 12 +++++++++--- sources | 4 ++-- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index b2a848e..3fa2933 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ /dmpd102-vendor.tar.gz /v1.0.4.tar.gz /dmpd104-vendor.tar.gz +/v1.0.5.tar.gz +/dmpd105-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch index ae2234b..4d10720 100644 --- a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +++ b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch @@ -1,6 +1,6 @@ -From a6afd3ee7c9b5a6ab2906c827464acceb75123b2 Mon Sep 17 00:00:00 2001 +From 8b3609298420f5984ac3a2c74cb2ac4f94897eb0 Mon Sep 17 00:00:00 2001 From: Marian Csontos -Date: Wed, 22 Mar 2023 09:42:15 +0100 +Date: Thu, 27 Jul 2023 11:37:01 +0200 Subject: [PATCH] Tweak cargo.toml to work with vendor directory Mock works offline, cargo would try to download the files from github. @@ -11,22 +11,22 @@ make mock happy. 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml -index 135ba5f8..cbb73ec1 100644 +index 8be49a52..b9b05ce6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,8 @@ anyhow = "1.0" - base64 = "0.20" + base64 = "0.21" byteorder = "1.4" - clap = "3.2" + clap = { version = "4.3", default-features = false, features = ["std", "help", "usage", "error-context", "suggestions"] } -crc32c = { git = "https://github.com/zowens/crc32c", branch = "master" } +#crc32c = { git = "https://github.com/zowens/crc32c", branch = "master" } +crc32c = "0.6" - data-encoding = "2.3" + data-encoding = "2.4" exitcode = "1.1.2" fixedbitset = "0.4" -@@ -28,7 +29,8 @@ quick-xml = "0.23.1" +@@ -27,7 +28,8 @@ quick-xml = "0.29" rand = "0.8" - rangemap = "1.1" + rangemap = "1.3" roaring = "0.10" -rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } +#rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } @@ -35,5 +35,5 @@ index 135ba5f8..cbb73ec1 100644 threadpool = "1.8" thiserror = "1.0" -- -2.40.1 +2.41.0 diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 8638005..ab2456f 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,14 +9,19 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data +<<<<<<< HEAD Version: 1.0.4 Release: 3%{?dist}%{?release_suffix} +======= +Version: 1.0.5 +Release: 2%{?dist}%{?release_suffix} +>>>>>>> 23c38f8 (Update to version 1.0.5) License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd104-vendor.tar.gz +Source1: dmpd105-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch %if %{defined rhel} @@ -27,8 +32,6 @@ BuildRequires: rust >= 1.35 BuildRequires: cargo %endif BuildRequires: make -# FIXME: Remove this! -BuildRequires: rust-gdb %description thin-provisioning-tools contains check,dump,restore,repair,rmap @@ -118,6 +121,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Thu Jul 27 2023 Marian Csontos - 1.0.5-1 +- Update to latest upstream release 1.0.5. + * Wed Jul 19 2023 Fedora Release Engineering - 1.0.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild diff --git a/sources b/sources index dbf8c9f..5d2a63d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.0.4.tar.gz) = a6700ea26dd24e8285d85e58f9016dccca071d21b20650f8a39e523e6f0394891e57615caaad4c16290961e170fe4ab4bec9ae38bc06dcc9ddac9114a0374034 -SHA512 (dmpd104-vendor.tar.gz) = d14a10fdbe1535b64c1911878da1be8dce3ce5e89c66fc0648e2a9c3e5e27b4874a99eee17175bf88e2d0c7dfa68382ba6746de3563feb28d6e070beae394f65 +SHA512 (v1.0.5.tar.gz) = 1ba305770caf65fbba45ea4795bc7edf0dff06d72633f5293750051426c37a4ba44fffd71e2c57415af4683d8f3a8293b08eca0cdce45fd718b6699b7c419f2e +SHA512 (dmpd105-vendor.tar.gz) = 3641ec72048dcc2bd68fcdc43429652991822642fc599287ccd016531dd20f24efcae969ea5dcbcbd5a4712e5a80512621caf9f8e67736397d6ed08397c4a962 From 74d27c1f2565baa4af6dc33e6d87ed7f251f6d46 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 27 Jul 2023 12:27:19 +0200 Subject: [PATCH 106/135] Fix previous commit --- device-mapper-persistent-data.spec | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index ab2456f..b51b0cd 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,13 +9,8 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -<<<<<<< HEAD -Version: 1.0.4 -Release: 3%{?dist}%{?release_suffix} -======= Version: 1.0.5 -Release: 2%{?dist}%{?release_suffix} ->>>>>>> 23c38f8 (Update to version 1.0.5) +Release: 1%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools From 80bd16a71593aca38eed244eed6eaa9d33ee099d Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Wed, 9 Aug 2023 14:32:11 +0200 Subject: [PATCH 107/135] Update to version 1.0.6 --- .gitignore | 2 ++ ...-cargo.toml-to-work-with-vendor-directory.patch | 14 ++++++-------- device-mapper-persistent-data.spec | 7 +++++-- sources | 4 ++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 3fa2933..1540d23 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,5 @@ /dmpd104-vendor.tar.gz /v1.0.5.tar.gz /dmpd105-vendor.tar.gz +/v1.0.6.tar.gz +/dmpd106-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch index 4d10720..2e51e47 100644 --- a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +++ b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch @@ -1,4 +1,4 @@ -From 8b3609298420f5984ac3a2c74cb2ac4f94897eb0 Mon Sep 17 00:00:00 2001 +From 732ff5861a1525944a927439d1c075ac269788ce Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 27 Jul 2023 11:37:01 +0200 Subject: [PATCH] Tweak cargo.toml to work with vendor directory @@ -7,23 +7,21 @@ Mock works offline, cargo would try to download the files from github. So cargo vendor has to be run first, and then change the Cargo.toml to make mock happy. --- - Cargo.toml | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) + Cargo.toml | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml -index 8be49a52..b9b05ce6 100644 +index c2b496ac..562c40d3 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -11,7 +11,8 @@ anyhow = "1.0" +@@ -11,6 +11,7 @@ anyhow = "1.0" base64 = "0.21" byteorder = "1.4" clap = { version = "4.3", default-features = false, features = ["std", "help", "usage", "error-context", "suggestions"] } --crc32c = { git = "https://github.com/zowens/crc32c", branch = "master" } +#crc32c = { git = "https://github.com/zowens/crc32c", branch = "master" } -+crc32c = "0.6" + crc32c = "0.6" data-encoding = "2.4" exitcode = "1.1.2" - fixedbitset = "0.4" @@ -27,7 +28,8 @@ quick-xml = "0.29" rand = "0.8" rangemap = "1.3" diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index b51b0cd..756981b 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,14 +9,14 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 1.0.5 +Version: 1.0.6 Release: 1%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd105-vendor.tar.gz +Source1: dmpd106-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch %if %{defined rhel} @@ -116,6 +116,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Wed Aug 09 2023 Marian Csontos - 1.0.6-1 +- Update to latest upstream release 1.0.6. + * Thu Jul 27 2023 Marian Csontos - 1.0.5-1 - Update to latest upstream release 1.0.5. diff --git a/sources b/sources index 5d2a63d..c46e38d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.0.5.tar.gz) = 1ba305770caf65fbba45ea4795bc7edf0dff06d72633f5293750051426c37a4ba44fffd71e2c57415af4683d8f3a8293b08eca0cdce45fd718b6699b7c419f2e -SHA512 (dmpd105-vendor.tar.gz) = 3641ec72048dcc2bd68fcdc43429652991822642fc599287ccd016531dd20f24efcae969ea5dcbcbd5a4712e5a80512621caf9f8e67736397d6ed08397c4a962 +SHA512 (v1.0.6.tar.gz) = b6a778048315fa83b8ffae797a406facd2be1552516f96abd0da5d02892be73f27c54e4e0a674b2f0253aa6fcdac187fc40d7a455eddfb25bc30f55a5e435b00 +SHA512 (dmpd106-vendor.tar.gz) = df7d77c83e6c6d3843ea61a0f0bfd414d0eef404a21046f04bd56f764f20cb33b3807b1606cf9eb6e2ee3fd0d5311b3582defbcf61692f3d10c4cd70769625d1 From a6ab2577d82b57744cae2133291c31c672da8a3a Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 31 Aug 2023 11:44:12 +0200 Subject: [PATCH 108/135] Fix ioctl call on ppc64le breaking installation. --- ...he-ioctl-request-code-for-the-powerp.patch | 217 ++++++++++++++++++ ...s-Verify-ioctl-request-code-in-tests.patch | 120 ++++++++++ device-mapper-persistent-data.spec | 7 +- 3 files changed, 343 insertions(+), 1 deletion(-) create mode 100644 0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch create mode 100644 0003-file_utils-Verify-ioctl-request-code-in-tests.patch diff --git a/0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch b/0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch new file mode 100644 index 0000000..e2a6f0e --- /dev/null +++ b/0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch @@ -0,0 +1,217 @@ +From 6de336c0e974989010c32693c9540180d4f28f0b Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Sat, 26 Aug 2023 18:19:15 +0800 +Subject: [PATCH 2/3] [file_utils] Fix the ioctl request code for the powerpc + architecture + +The PowerPC architecture employees a different bitwise layout in the +request code than other platforms, resulting in different request code +values. + +(cherry picked from commit afcbcd7d85902fc7f1e51fc5302230851303ab85) +--- + src/file_utils.rs | 14 ++---- + src/ioctl.rs | 106 ++++++++++++++++++++++++++++++++++++++++++++++ + src/lib.rs | 1 + + src/thin/trim.rs | 11 ++--- + 4 files changed, 115 insertions(+), 17 deletions(-) + create mode 100644 src/ioctl.rs + +diff --git a/src/file_utils.rs b/src/file_utils.rs +index 81d4a8a7..97400272 100644 +--- a/src/file_utils.rs ++++ b/src/file_utils.rs +@@ -5,6 +5,8 @@ use std::os::unix::ffi::OsStrExt; + use std::os::unix::io::AsRawFd; + use std::path::Path; + ++use crate::ioctl::{self, *}; ++ + //--------------------------------------- + + fn test_bit(mode: u32, flag: u32) -> bool { +@@ -41,10 +43,7 @@ pub fn is_file(path: &Path) -> io::Result { + + //--------------------------------------- + +-#[cfg(target_pointer_width = "32")] +-const BLKGETSIZE64: u32 = 0x80041272; +-#[cfg(target_pointer_width = "64")] +-const BLKGETSIZE64: u32 = 0x80081272; ++const BLKGETSIZE64: ioctl::RequestType = crate::request_code_read!(0x12, 114, usize); + + pub fn fail(msg: &str) -> io::Result { + let e = io::Error::new(io::ErrorKind::Other, msg); +@@ -56,13 +55,8 @@ fn get_device_size>(path: P) -> io::Result { + let fd = file.as_raw_fd(); + let mut cap = 0u64; + +- #[cfg(target_env = "musl")] +- type RequestType = libc::c_int; +- #[cfg(not(target_env = "musl"))] +- type RequestType = libc::c_ulong; +- + unsafe { +- if libc::ioctl(fd, BLKGETSIZE64 as RequestType, &mut cap) == 0 { ++ if libc::ioctl(fd, BLKGETSIZE64, &mut cap) == 0 { + Ok(cap) + } else { + Err(io::Error::last_os_error()) +diff --git a/src/ioctl.rs b/src/ioctl.rs +new file mode 100644 +index 00000000..84933648 +--- /dev/null ++++ b/src/ioctl.rs +@@ -0,0 +1,106 @@ ++/* Rust port of kernel include/uapi/asm-generic/ioctl.h */ ++ ++//------------------------------------------ ++ ++#[cfg(target_env = "musl")] ++pub type RequestType = libc::c_int; ++#[cfg(not(target_env = "musl"))] ++pub type RequestType = libc::c_ulong; ++ ++#[cfg(any( ++ target_arch = "mips", ++ target_arch = "mips64", ++ target_arch = "powerpc", ++ target_arch = "powerpc64", ++ target_arch = "powerpc64le", ++ target_arch = "sparc", ++ target_arch = "sparc64" ++))] ++mod defs { ++ use super::RequestType; ++ pub const IOC_NONE: RequestType = 1; ++ pub const IOC_READ: RequestType = 2; ++ pub const IOC_WRITE: RequestType = 4; ++ pub const IOC_DIRBITS: RequestType = 3; ++ pub const IOC_SIZEBITS: RequestType = 13; ++} ++ ++#[cfg(not(any( ++ target_arch = "mips", ++ target_arch = "mips64", ++ target_arch = "powerpc", ++ target_arch = "powerpc64", ++ target_arch = "powerpc64le", ++ target_arch = "sparc", ++ target_arch = "sparc64" ++)))] ++mod defs { ++ use super::RequestType; ++ pub const IOC_NONE: RequestType = 0; ++ pub const IOC_WRITE: RequestType = 1; ++ pub const IOC_READ: RequestType = 2; ++ pub const IOC_DIRBITS: RequestType = 2; ++ pub const IOC_SIZEBITS: RequestType = 14; ++} ++ ++pub use defs::*; ++ ++pub const IOC_NRBITS: RequestType = 8; ++pub const IOC_TYPEBITS: RequestType = 8; ++ ++pub const IOC_NRMASK: RequestType = (1 << IOC_NRBITS) - 1; ++pub const IOC_TYPEMASK: RequestType = (1 << IOC_TYPEBITS) - 1; ++pub const IOC_SIZEMASK: RequestType = (1 << IOC_SIZEBITS) - 1; ++pub const IOC_DIRMASK: RequestType = (1 << IOC_DIRBITS) - 1; ++ ++pub const IOC_NRSHIFT: RequestType = 0; ++pub const IOC_TYPESHIFT: RequestType = IOC_NRSHIFT + IOC_NRBITS; ++pub const IOC_SIZESHIFT: RequestType = IOC_TYPESHIFT + IOC_TYPEBITS; ++pub const IOC_DIRSHIFT: RequestType = IOC_SIZESHIFT + IOC_SIZEBITS; ++ ++#[macro_export] ++macro_rules! ioc { ++ ($dir: expr, $typ: expr, $nr: expr, $size: expr) => { ++ (($dir as RequestType & IOC_DIRMASK) << IOC_DIRSHIFT) ++ | (($typ as RequestType & IOC_TYPEMASK) << IOC_TYPESHIFT) ++ | (($nr as RequestType & IOC_NRMASK) << IOC_NRSHIFT) ++ | (($size as RequestType & IOC_SIZEMASK) << IOC_SIZESHIFT) ++ }; ++} ++ ++//------------------------------------------ ++ ++#[macro_export] ++macro_rules! request_code_none { ++ ($typ: expr, $nr: expr) => { ++ $crate::ioc!(IOC_NONE, $typ, $nr, 0) ++ }; ++} ++ ++#[macro_export] ++macro_rules! request_code_read { ++ ($typ: expr, $nr: expr, $size_type: ty) => { ++ $crate::ioc!(IOC_READ, $typ, $nr, ::std::mem::size_of::<$size_type>()) ++ }; ++} ++ ++#[macro_export] ++macro_rules! request_code_write { ++ ($typ: expr, $nr: expr, $size_type: ty) => { ++ $crate::ioc!(IOC_WRITE, $typ, $nr, ::std::mem::size_of::<$size_type>()) ++ }; ++} ++ ++#[macro_export] ++macro_rules! request_code_readwrite { ++ ($typ: expr, $nr: expr, $size_type: ty) => { ++ $crate::ioc!( ++ IOC_READ | IOC_WRITE, ++ $typ, ++ $nr, ++ ::std::mem::size_of::<$size_type>() ++ ) ++ }; ++} ++ ++//------------------------------------------ +diff --git a/src/lib.rs b/src/lib.rs +index b12146ef..1371baac 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -14,6 +14,7 @@ pub mod era; + pub mod file_utils; + pub mod grid_layout; + pub mod io_engine; ++pub mod ioctl; + pub mod math; + pub mod pack; + pub mod pdata; +diff --git a/src/thin/trim.rs b/src/thin/trim.rs +index 0d1fb590..b92a4bbd 100644 +--- a/src/thin/trim.rs ++++ b/src/thin/trim.rs +@@ -8,6 +8,7 @@ use std::sync::Arc; + use crate::commands::engine::*; + use crate::file_utils::file_size; + use crate::io_engine::*; ++use crate::ioctl::{self, *}; + use crate::pdata::btree_walker::*; + use crate::pdata::space_map::common::*; + use crate::pdata::unpack::unpack; +@@ -132,15 +133,11 @@ impl<'a> Iterator for RangeIterator<'a> { + + //------------------------------------------ + +-const BLKDISCARD: u32 = 0x1277; +-fn ioctl_blkdiscard(fd: i32, range: &[u64; 2]) -> std::io::Result<()> { +- #[cfg(target_env = "musl")] +- type RequestType = libc::c_int; +- #[cfg(not(target_env = "musl"))] +- type RequestType = libc::c_ulong; ++const BLKDISCARD: ioctl::RequestType = crate::request_code_none!(0x12, 119); + ++fn ioctl_blkdiscard(fd: i32, range: &[u64; 2]) -> std::io::Result<()> { + unsafe { +- if libc::ioctl(fd, BLKDISCARD as RequestType, range) == 0 { ++ if libc::ioctl(fd, BLKDISCARD, range) == 0 { + Ok(()) + } else { + Err(std::io::Error::last_os_error()) +-- +2.41.0 + diff --git a/0003-file_utils-Verify-ioctl-request-code-in-tests.patch b/0003-file_utils-Verify-ioctl-request-code-in-tests.patch new file mode 100644 index 0000000..7e37307 --- /dev/null +++ b/0003-file_utils-Verify-ioctl-request-code-in-tests.patch @@ -0,0 +1,120 @@ +From 38e497f4200a0d2fcb043941d4a5792c76e47bbb Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Wed, 30 Aug 2023 18:11:45 +0800 +Subject: [PATCH 3/3] [file_utils] Verify ioctl request code in tests + +(cherry picked from commit f049fda90bbf74ab26bfd38e26e7c92de8f50e30) +--- + src/ioctl.rs | 3 ++ + src/ioctl/tests.rs | 86 ++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 89 insertions(+) + create mode 100644 src/ioctl/tests.rs + +diff --git a/src/ioctl.rs b/src/ioctl.rs +index 84933648..221bd4e9 100644 +--- a/src/ioctl.rs ++++ b/src/ioctl.rs +@@ -1,5 +1,8 @@ + /* Rust port of kernel include/uapi/asm-generic/ioctl.h */ + ++#[cfg(test)] ++mod tests; ++ + //------------------------------------------ + + #[cfg(target_env = "musl")] +diff --git a/src/ioctl/tests.rs b/src/ioctl/tests.rs +new file mode 100644 +index 00000000..17a395df +--- /dev/null ++++ b/src/ioctl/tests.rs +@@ -0,0 +1,86 @@ ++use crate::ioctl::*; ++ ++//------------------------------------------ ++ ++#[cfg(any( ++ target_arch = "mips", ++ target_arch = "mips64", ++ target_arch = "powerpc", ++ target_arch = "powerpc64", ++ target_arch = "powerpc64le", ++ target_arch = "sparc", ++ target_arch = "sparc64" ++))] ++mod expected { ++ use super::RequestType; ++ pub const BLKDISCARD: RequestType = 0x20001277; ++ ++ #[cfg(target_pointer_width = "32")] ++ mod sized { ++ use super::RequestType; ++ pub const BLKBSZSET: RequestType = 0x80041271; ++ pub const BLKGETSIZE64: RequestType = 0x40041272; ++ } ++ ++ #[cfg(target_pointer_width = "64")] ++ mod sized { ++ use super::RequestType; ++ pub const BLKBSZSET: RequestType = 0x80081271; ++ pub const BLKGETSIZE64: RequestType = 0x40081272; ++ } ++ ++ pub use sized::*; ++} ++ ++#[cfg(not(any( ++ target_arch = "mips", ++ target_arch = "mips64", ++ target_arch = "powerpc", ++ target_arch = "powerpc64", ++ target_arch = "powerpc64le", ++ target_arch = "sparc", ++ target_arch = "sparc64" ++)))] ++mod expected { ++ use super::RequestType; ++ pub const BLKDISCARD: RequestType = 0x1277; ++ ++ #[cfg(target_pointer_width = "32")] ++ mod sized { ++ use super::RequestType; ++ pub const BLKBSZSET: RequestType = 0x40041271; ++ pub const BLKGETSIZE64: RequestType = 0x80041272; ++ } ++ ++ #[cfg(target_pointer_width = "64")] ++ mod sized { ++ use super::RequestType; ++ pub const BLKBSZSET: RequestType = 0x40081271; ++ pub const BLKGETSIZE64: RequestType = 0x80081272; ++ } ++ ++ pub use sized::*; ++} ++ ++#[test] ++fn test_ioc_none() { ++ assert_eq!(crate::request_code_none!(0x12, 119), expected::BLKDISCARD); ++} ++ ++#[test] ++fn test_ioc_read_usize() { ++ assert_eq!( ++ crate::request_code_read!(0x12, 114, usize), ++ expected::BLKGETSIZE64 ++ ); ++} ++ ++#[test] ++fn test_ioc_write_usize() { ++ assert_eq!( ++ crate::request_code_write!(0x12, 113, usize), ++ expected::BLKBSZSET ++ ); ++} ++ ++//------------------------------------------ +-- +2.41.0 + diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 756981b..75e4952 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.6 -Release: 1%{?dist}%{?release_suffix} +Release: 2%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools @@ -18,6 +18,8 @@ URL: https://github.com/jthornber/thin-provisioning-tools Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz Source1: dmpd106-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +Patch2: 0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch +Patch3: 0003-file_utils-Verify-ioctl-request-code-in-tests.patch %if %{defined rhel} BuildRequires: rust-toolset @@ -116,6 +118,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Thu Aug 31 2023 Marian Csontos - 1.0.6-2 +- Fix broken installation on ppc64le caused by incorrect ioctl call. + * Wed Aug 09 2023 Marian Csontos - 1.0.6-1 - Update to latest upstream release 1.0.6. From c950fe5f288e3f2bbb2cccb6f87b3379d8978286 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Mon, 11 Dec 2023 16:43:41 +0100 Subject: [PATCH 109/135] Update to version 1.0.9 --- .gitignore | 2 + ...o.toml-to-work-with-vendor-directory.patch | 22 +- ...he-ioctl-request-code-for-the-powerp.patch | 217 ------------------ ...s-Verify-ioctl-request-code-in-tests.patch | 120 ---------- device-mapper-persistent-data.spec | 46 +++- sources | 4 +- 6 files changed, 51 insertions(+), 360 deletions(-) delete mode 100644 0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch delete mode 100644 0003-file_utils-Verify-ioctl-request-code-in-tests.patch diff --git a/.gitignore b/.gitignore index 1540d23..4b9fa80 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,5 @@ /dmpd105-vendor.tar.gz /v1.0.6.tar.gz /dmpd106-vendor.tar.gz +/v1.0.9.tar.gz +/dmpd109-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch index 2e51e47..1bdbce3 100644 --- a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +++ b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch @@ -1,4 +1,4 @@ -From 732ff5861a1525944a927439d1c075ac269788ce Mon Sep 17 00:00:00 2001 +From 0d5347bd771e960294cd0c2f083d96448613ab9c Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 27 Jul 2023 11:37:01 +0200 Subject: [PATCH] Tweak cargo.toml to work with vendor directory @@ -7,24 +7,16 @@ Mock works offline, cargo would try to download the files from github. So cargo vendor has to be run first, and then change the Cargo.toml to make mock happy. --- - Cargo.toml | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) + Cargo.toml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml -index c2b496ac..562c40d3 100644 +index 500345a4..d4aa38a6 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -11,6 +11,7 @@ anyhow = "1.0" - base64 = "0.21" - byteorder = "1.4" - clap = { version = "4.3", default-features = false, features = ["std", "help", "usage", "error-context", "suggestions"] } -+#crc32c = { git = "https://github.com/zowens/crc32c", branch = "master" } - crc32c = "0.6" - data-encoding = "2.4" - exitcode = "1.1.2" -@@ -27,7 +28,8 @@ quick-xml = "0.29" +@@ -27,7 +27,8 @@ quick-xml = "0.29" rand = "0.8" - rangemap = "1.3" + rangemap = "1.4" roaring = "0.10" -rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } +#rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } @@ -33,5 +25,5 @@ index c2b496ac..562c40d3 100644 threadpool = "1.8" thiserror = "1.0" -- -2.41.0 +2.43.0 diff --git a/0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch b/0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch deleted file mode 100644 index e2a6f0e..0000000 --- a/0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch +++ /dev/null @@ -1,217 +0,0 @@ -From 6de336c0e974989010c32693c9540180d4f28f0b Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Sat, 26 Aug 2023 18:19:15 +0800 -Subject: [PATCH 2/3] [file_utils] Fix the ioctl request code for the powerpc - architecture - -The PowerPC architecture employees a different bitwise layout in the -request code than other platforms, resulting in different request code -values. - -(cherry picked from commit afcbcd7d85902fc7f1e51fc5302230851303ab85) ---- - src/file_utils.rs | 14 ++---- - src/ioctl.rs | 106 ++++++++++++++++++++++++++++++++++++++++++++++ - src/lib.rs | 1 + - src/thin/trim.rs | 11 ++--- - 4 files changed, 115 insertions(+), 17 deletions(-) - create mode 100644 src/ioctl.rs - -diff --git a/src/file_utils.rs b/src/file_utils.rs -index 81d4a8a7..97400272 100644 ---- a/src/file_utils.rs -+++ b/src/file_utils.rs -@@ -5,6 +5,8 @@ use std::os::unix::ffi::OsStrExt; - use std::os::unix::io::AsRawFd; - use std::path::Path; - -+use crate::ioctl::{self, *}; -+ - //--------------------------------------- - - fn test_bit(mode: u32, flag: u32) -> bool { -@@ -41,10 +43,7 @@ pub fn is_file(path: &Path) -> io::Result { - - //--------------------------------------- - --#[cfg(target_pointer_width = "32")] --const BLKGETSIZE64: u32 = 0x80041272; --#[cfg(target_pointer_width = "64")] --const BLKGETSIZE64: u32 = 0x80081272; -+const BLKGETSIZE64: ioctl::RequestType = crate::request_code_read!(0x12, 114, usize); - - pub fn fail(msg: &str) -> io::Result { - let e = io::Error::new(io::ErrorKind::Other, msg); -@@ -56,13 +55,8 @@ fn get_device_size>(path: P) -> io::Result { - let fd = file.as_raw_fd(); - let mut cap = 0u64; - -- #[cfg(target_env = "musl")] -- type RequestType = libc::c_int; -- #[cfg(not(target_env = "musl"))] -- type RequestType = libc::c_ulong; -- - unsafe { -- if libc::ioctl(fd, BLKGETSIZE64 as RequestType, &mut cap) == 0 { -+ if libc::ioctl(fd, BLKGETSIZE64, &mut cap) == 0 { - Ok(cap) - } else { - Err(io::Error::last_os_error()) -diff --git a/src/ioctl.rs b/src/ioctl.rs -new file mode 100644 -index 00000000..84933648 ---- /dev/null -+++ b/src/ioctl.rs -@@ -0,0 +1,106 @@ -+/* Rust port of kernel include/uapi/asm-generic/ioctl.h */ -+ -+//------------------------------------------ -+ -+#[cfg(target_env = "musl")] -+pub type RequestType = libc::c_int; -+#[cfg(not(target_env = "musl"))] -+pub type RequestType = libc::c_ulong; -+ -+#[cfg(any( -+ target_arch = "mips", -+ target_arch = "mips64", -+ target_arch = "powerpc", -+ target_arch = "powerpc64", -+ target_arch = "powerpc64le", -+ target_arch = "sparc", -+ target_arch = "sparc64" -+))] -+mod defs { -+ use super::RequestType; -+ pub const IOC_NONE: RequestType = 1; -+ pub const IOC_READ: RequestType = 2; -+ pub const IOC_WRITE: RequestType = 4; -+ pub const IOC_DIRBITS: RequestType = 3; -+ pub const IOC_SIZEBITS: RequestType = 13; -+} -+ -+#[cfg(not(any( -+ target_arch = "mips", -+ target_arch = "mips64", -+ target_arch = "powerpc", -+ target_arch = "powerpc64", -+ target_arch = "powerpc64le", -+ target_arch = "sparc", -+ target_arch = "sparc64" -+)))] -+mod defs { -+ use super::RequestType; -+ pub const IOC_NONE: RequestType = 0; -+ pub const IOC_WRITE: RequestType = 1; -+ pub const IOC_READ: RequestType = 2; -+ pub const IOC_DIRBITS: RequestType = 2; -+ pub const IOC_SIZEBITS: RequestType = 14; -+} -+ -+pub use defs::*; -+ -+pub const IOC_NRBITS: RequestType = 8; -+pub const IOC_TYPEBITS: RequestType = 8; -+ -+pub const IOC_NRMASK: RequestType = (1 << IOC_NRBITS) - 1; -+pub const IOC_TYPEMASK: RequestType = (1 << IOC_TYPEBITS) - 1; -+pub const IOC_SIZEMASK: RequestType = (1 << IOC_SIZEBITS) - 1; -+pub const IOC_DIRMASK: RequestType = (1 << IOC_DIRBITS) - 1; -+ -+pub const IOC_NRSHIFT: RequestType = 0; -+pub const IOC_TYPESHIFT: RequestType = IOC_NRSHIFT + IOC_NRBITS; -+pub const IOC_SIZESHIFT: RequestType = IOC_TYPESHIFT + IOC_TYPEBITS; -+pub const IOC_DIRSHIFT: RequestType = IOC_SIZESHIFT + IOC_SIZEBITS; -+ -+#[macro_export] -+macro_rules! ioc { -+ ($dir: expr, $typ: expr, $nr: expr, $size: expr) => { -+ (($dir as RequestType & IOC_DIRMASK) << IOC_DIRSHIFT) -+ | (($typ as RequestType & IOC_TYPEMASK) << IOC_TYPESHIFT) -+ | (($nr as RequestType & IOC_NRMASK) << IOC_NRSHIFT) -+ | (($size as RequestType & IOC_SIZEMASK) << IOC_SIZESHIFT) -+ }; -+} -+ -+//------------------------------------------ -+ -+#[macro_export] -+macro_rules! request_code_none { -+ ($typ: expr, $nr: expr) => { -+ $crate::ioc!(IOC_NONE, $typ, $nr, 0) -+ }; -+} -+ -+#[macro_export] -+macro_rules! request_code_read { -+ ($typ: expr, $nr: expr, $size_type: ty) => { -+ $crate::ioc!(IOC_READ, $typ, $nr, ::std::mem::size_of::<$size_type>()) -+ }; -+} -+ -+#[macro_export] -+macro_rules! request_code_write { -+ ($typ: expr, $nr: expr, $size_type: ty) => { -+ $crate::ioc!(IOC_WRITE, $typ, $nr, ::std::mem::size_of::<$size_type>()) -+ }; -+} -+ -+#[macro_export] -+macro_rules! request_code_readwrite { -+ ($typ: expr, $nr: expr, $size_type: ty) => { -+ $crate::ioc!( -+ IOC_READ | IOC_WRITE, -+ $typ, -+ $nr, -+ ::std::mem::size_of::<$size_type>() -+ ) -+ }; -+} -+ -+//------------------------------------------ -diff --git a/src/lib.rs b/src/lib.rs -index b12146ef..1371baac 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -14,6 +14,7 @@ pub mod era; - pub mod file_utils; - pub mod grid_layout; - pub mod io_engine; -+pub mod ioctl; - pub mod math; - pub mod pack; - pub mod pdata; -diff --git a/src/thin/trim.rs b/src/thin/trim.rs -index 0d1fb590..b92a4bbd 100644 ---- a/src/thin/trim.rs -+++ b/src/thin/trim.rs -@@ -8,6 +8,7 @@ use std::sync::Arc; - use crate::commands::engine::*; - use crate::file_utils::file_size; - use crate::io_engine::*; -+use crate::ioctl::{self, *}; - use crate::pdata::btree_walker::*; - use crate::pdata::space_map::common::*; - use crate::pdata::unpack::unpack; -@@ -132,15 +133,11 @@ impl<'a> Iterator for RangeIterator<'a> { - - //------------------------------------------ - --const BLKDISCARD: u32 = 0x1277; --fn ioctl_blkdiscard(fd: i32, range: &[u64; 2]) -> std::io::Result<()> { -- #[cfg(target_env = "musl")] -- type RequestType = libc::c_int; -- #[cfg(not(target_env = "musl"))] -- type RequestType = libc::c_ulong; -+const BLKDISCARD: ioctl::RequestType = crate::request_code_none!(0x12, 119); - -+fn ioctl_blkdiscard(fd: i32, range: &[u64; 2]) -> std::io::Result<()> { - unsafe { -- if libc::ioctl(fd, BLKDISCARD as RequestType, range) == 0 { -+ if libc::ioctl(fd, BLKDISCARD, range) == 0 { - Ok(()) - } else { - Err(std::io::Error::last_os_error()) --- -2.41.0 - diff --git a/0003-file_utils-Verify-ioctl-request-code-in-tests.patch b/0003-file_utils-Verify-ioctl-request-code-in-tests.patch deleted file mode 100644 index 7e37307..0000000 --- a/0003-file_utils-Verify-ioctl-request-code-in-tests.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 38e497f4200a0d2fcb043941d4a5792c76e47bbb Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Wed, 30 Aug 2023 18:11:45 +0800 -Subject: [PATCH 3/3] [file_utils] Verify ioctl request code in tests - -(cherry picked from commit f049fda90bbf74ab26bfd38e26e7c92de8f50e30) ---- - src/ioctl.rs | 3 ++ - src/ioctl/tests.rs | 86 ++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 89 insertions(+) - create mode 100644 src/ioctl/tests.rs - -diff --git a/src/ioctl.rs b/src/ioctl.rs -index 84933648..221bd4e9 100644 ---- a/src/ioctl.rs -+++ b/src/ioctl.rs -@@ -1,5 +1,8 @@ - /* Rust port of kernel include/uapi/asm-generic/ioctl.h */ - -+#[cfg(test)] -+mod tests; -+ - //------------------------------------------ - - #[cfg(target_env = "musl")] -diff --git a/src/ioctl/tests.rs b/src/ioctl/tests.rs -new file mode 100644 -index 00000000..17a395df ---- /dev/null -+++ b/src/ioctl/tests.rs -@@ -0,0 +1,86 @@ -+use crate::ioctl::*; -+ -+//------------------------------------------ -+ -+#[cfg(any( -+ target_arch = "mips", -+ target_arch = "mips64", -+ target_arch = "powerpc", -+ target_arch = "powerpc64", -+ target_arch = "powerpc64le", -+ target_arch = "sparc", -+ target_arch = "sparc64" -+))] -+mod expected { -+ use super::RequestType; -+ pub const BLKDISCARD: RequestType = 0x20001277; -+ -+ #[cfg(target_pointer_width = "32")] -+ mod sized { -+ use super::RequestType; -+ pub const BLKBSZSET: RequestType = 0x80041271; -+ pub const BLKGETSIZE64: RequestType = 0x40041272; -+ } -+ -+ #[cfg(target_pointer_width = "64")] -+ mod sized { -+ use super::RequestType; -+ pub const BLKBSZSET: RequestType = 0x80081271; -+ pub const BLKGETSIZE64: RequestType = 0x40081272; -+ } -+ -+ pub use sized::*; -+} -+ -+#[cfg(not(any( -+ target_arch = "mips", -+ target_arch = "mips64", -+ target_arch = "powerpc", -+ target_arch = "powerpc64", -+ target_arch = "powerpc64le", -+ target_arch = "sparc", -+ target_arch = "sparc64" -+)))] -+mod expected { -+ use super::RequestType; -+ pub const BLKDISCARD: RequestType = 0x1277; -+ -+ #[cfg(target_pointer_width = "32")] -+ mod sized { -+ use super::RequestType; -+ pub const BLKBSZSET: RequestType = 0x40041271; -+ pub const BLKGETSIZE64: RequestType = 0x80041272; -+ } -+ -+ #[cfg(target_pointer_width = "64")] -+ mod sized { -+ use super::RequestType; -+ pub const BLKBSZSET: RequestType = 0x40081271; -+ pub const BLKGETSIZE64: RequestType = 0x80081272; -+ } -+ -+ pub use sized::*; -+} -+ -+#[test] -+fn test_ioc_none() { -+ assert_eq!(crate::request_code_none!(0x12, 119), expected::BLKDISCARD); -+} -+ -+#[test] -+fn test_ioc_read_usize() { -+ assert_eq!( -+ crate::request_code_read!(0x12, 114, usize), -+ expected::BLKGETSIZE64 -+ ); -+} -+ -+#[test] -+fn test_ioc_write_usize() { -+ assert_eq!( -+ crate::request_code_write!(0x12, 113, usize), -+ expected::BLKBSZSET -+ ); -+} -+ -+//------------------------------------------ --- -2.41.0 - diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 75e4952..9f1d981 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,17 +9,15 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 1.0.6 -Release: 2%{?dist}%{?release_suffix} +Version: 1.0.9 +Release: 1%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd106-vendor.tar.gz +Source1: dmpd109-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch -Patch2: 0002-file_utils-Fix-the-ioctl-request-code-for-the-powerp.patch -Patch3: 0003-file_utils-Verify-ioctl-request-code-in-tests.patch %if %{defined rhel} BuildRequires: rust-toolset @@ -44,7 +42,39 @@ snapshot eras #%%cargo_generate_buildrequires tar xf %{SOURCE1} mkdir -p .cargo -cat > .cargo/config < .cargo/config << EOF +[build] +rustc = "/usr/bin/rustc" +rustdoc = "/usr/bin/rustdoc" + +[profile.rpm] +inherits = "release" +opt-level = 3 +codegen-units = 1 +debug = 2 +strip = "none" + +[env] +CFLAGS = "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer " +CXXFLAGS = "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer " +LDFLAGS = "-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 " + +[install] +root = "/home/mcsontos/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr" + +[term] +verbose = true +EOF + +# Our own part: +cat >> .cargo/config < VERSION %generate_buildrequires @@ -118,6 +149,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install #% {_sbindir}/thin_show_duplicates %changelog +* Mon Dec 11 2023 Marian Csontos - 1.0.9-1 +- Update to latest upstream release 1.0.9. + * Thu Aug 31 2023 Marian Csontos - 1.0.6-2 - Fix broken installation on ppc64le caused by incorrect ioctl call. diff --git a/sources b/sources index c46e38d..dc3f053 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.0.6.tar.gz) = b6a778048315fa83b8ffae797a406facd2be1552516f96abd0da5d02892be73f27c54e4e0a674b2f0253aa6fcdac187fc40d7a455eddfb25bc30f55a5e435b00 -SHA512 (dmpd106-vendor.tar.gz) = df7d77c83e6c6d3843ea61a0f0bfd414d0eef404a21046f04bd56f764f20cb33b3807b1606cf9eb6e2ee3fd0d5311b3582defbcf61692f3d10c4cd70769625d1 +SHA512 (v1.0.9.tar.gz) = c7d137b82cce4286d43f49af039f8026d7d7746e96affebc82e8243173ba9a014e3b462fc4b55850067ecfbcc6113c49f009c1285e272a4d64455715d11a9da1 +SHA512 (dmpd109-vendor.tar.gz) = f2a581da80e4137c6ecab9237587ec42141fdfe8c1bfae2ab5b431b64c100ea6c65cfadbbdd10d665101364731d7c5e61780490b9cfd5231df3f463483890747 From b76b7df037e61ca7dfa6d3209cb7f4be09ebbdd2 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 2 May 2023 11:29:10 +0200 Subject: [PATCH 110/135] Fix test incompatibility with python-3.7+ platform.linux_distribution was removed in python-3.7. Related: #2175198 (cherry picked from commit a517fa496c7a947b0d943fdf90a70b9d6eb312a8) --- tests/functions_test/dmpd_library.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/functions_test/dmpd_library.py b/tests/functions_test/dmpd_library.py index 04286f4..4d70400 100755 --- a/tests/functions_test/dmpd_library.py +++ b/tests/functions_test/dmpd_library.py @@ -155,11 +155,11 @@ def dist_release(): """ Find out the release number of Linux distribution. """ - dist = platform.linux_distribution() - if not dist or dist[1] == "": + dist = platform.release() + if not dist: _print("WARN: dist_release() - Could not determine dist release") return None - return dist[1] + return dist def dist_ver(): From e3c64593c679edaa470a1c47630330338ea58822 Mon Sep 17 00:00:00 2001 From: Filip Suba Date: Thu, 18 May 2023 15:00:27 +0200 Subject: [PATCH 111/135] Fix dmpd_functions test Related: #2175198 (cherry picked from commit 6daf341749b4830d1e00d5ebedee62c8fb2fcac1) --- tests/functions_test/Makefile | 7 +++--- tests/functions_test/dmpd_functions.py | 35 ++++++++++++++------------ tests/functions_test/dmpd_library.py | 5 ++-- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/tests/functions_test/Makefile b/tests/functions_test/Makefile index 85cc8dd..d9e7f97 100644 --- a/tests/functions_test/Makefile +++ b/tests/functions_test/Makefile @@ -40,7 +40,7 @@ export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) BUILT_FILES= # data files, .c files, scripts anything needed to either compile the test and/or run it. -FILES=$(METADATA) runtest.sh PURPOSE +FILES=$(METADATA) runtest.sh PURPOSE testinfo.desc dmpd_functions.py dmpd_library.py Makefile run: $(FILES) build ./runtest.sh @@ -62,7 +62,7 @@ include /usr/share/rhts/lib/rhts-make.include $(METADATA): Makefile @touch $(METADATA) # Change to the test owner's name - @echo "Owner: Jakub Krysl " > $(METADATA) + @echo "Owner: Filip Suba " > $(METADATA) @echo "Name: $(TEST)" >> $(METADATA) @echo "Path: $(TEST_DIR)" >> $(METADATA) @echo "License: GPL" >> $(METADATA) @@ -71,6 +71,5 @@ $(METADATA): Makefile @echo "TestTime: 1h" >> $(METADATA) @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA) @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA) - @echo "RhtsRequires: kernel-kernel-storage-misc-env_setup" >> $(METADATA) - rhts-lint $(METADATA) + rhts-lint $(METADATA) \ No newline at end of file diff --git a/tests/functions_test/dmpd_functions.py b/tests/functions_test/dmpd_functions.py index bcf02d6..686ada1 100755 --- a/tests/functions_test/dmpd_functions.py +++ b/tests/functions_test/dmpd_functions.py @@ -39,7 +39,7 @@ def thin_init(args): atomic_run("Creating thin pool", vg_name=args["group"], lv_name=args["pool"], - options=["-T", "-L 500"], + options=["-T", "-L 1500"], command=lvm.lv_create, errors=errors) @@ -48,7 +48,7 @@ def thin_init(args): atomic_run("Creating thin LV No. %s" % i, vg_name=args["group"] + "/" + args["pool"], lv_name=args["vol"] + str(i), - options=["-T", "-V 100"], + options=["-T", "-V 300"], command=lvm.lv_create, errors=errors) @@ -58,28 +58,16 @@ def thin_init(args): command=create_filesystem, errors=errors) - atomic_run("Deactivating thin LV No. %s" % i, - lv_name=args["vol"] + str(i), - vg_name=args["group"], - command=lvm.lv_deactivate, - errors=errors) - atomic_run("Creating metadata snapshot", lv_name=args["pool"], vg_name=args["group"], command=metadata_snapshot, errors=errors) - atomic_run("Deactivating pool", - lv_name=args["pool"], - vg_name=args["group"], - command=lvm.lv_deactivate, - errors=errors) - atomic_run("Creating swap LV", vg_name=args["group"], lv_name=args["swap"], - options=["-L 100"], + options=["-L 300"], command=lvm.lv_create, errors=errors) @@ -89,6 +77,19 @@ def thin_init(args): command=lvm.lv_deactivate, errors=errors) + atomic_run("Deactivating pool", + lv_name=args["pool"], + vg_name=args["group"], + command=lvm.lv_deactivate, + errors=errors) + + for i in range(args["number of vols"]): + atomic_run("Deactivating thin LV No. %s" % i, + lv_name=args["vol"] + str(i), + vg_name=args["group"], + command=lvm.lv_deactivate, + errors=errors) + atomic_run("Swapping metadata", vg_name=args["group"], lv_name=args["swap"], @@ -1111,6 +1112,7 @@ def cache_errors_test(args): # errors=errors) #FIXME: Find other way to corrupt metadata, this exploits a bug + """ atomic_run("Corrupting mappings on metadata device", False, source_file="Makefile", @@ -1139,7 +1141,7 @@ def cache_errors_test(args): source_lv=args['swap'], target_file="/tmp/metadata_repair", command=dmpd.cache_repair, - errors=errors) + errors=errors)""" atomic_run("Corrupting metadata on device", cmd="echo 'nothing' >> /dev/mapper/%s-%s" % (args['group'], args['swap']), @@ -1208,6 +1210,7 @@ def main(): "swap": "swapvol"} # Initialization + install_package("lvm2") install_package("device-mapper-persistent-data") # Tests for thin tools provided by device-mapper-persistent-data diff --git a/tests/functions_test/dmpd_library.py b/tests/functions_test/dmpd_library.py index 4d70400..c690a3d 100755 --- a/tests/functions_test/dmpd_library.py +++ b/tests/functions_test/dmpd_library.py @@ -194,7 +194,8 @@ def show_sys_info(): if run("rpm -q device-mapper-multipath") == 0: #Abort test execution if multipath is not working well if run("multipath -l 2>/dev/null") != 0: - sys.exit(1) + print("WARN: Multipath is not configured correctly") + return #Flush all unused multipath devices before starting the test run("multipath -F") run("multipath -r") @@ -605,7 +606,7 @@ class LogChecker: _print("WARN: Could not open %s" % log_msg_file) return True - log_file = open(log_msg_file) + log_file = open(log_msg_file, encoding="utf-8", errors="ignore") log = log_file.read() begin_tag = "\\[ cut here \\]" From d37efc87961df0506c83f75ac980a740d82f7bce Mon Sep 17 00:00:00 2001 From: Filip Suba Date: Mon, 14 Aug 2023 13:31:31 +0200 Subject: [PATCH 112/135] Change expected result of thin_rmap test with negatine number in region Related: #2227208 (cherry picked from commit fb7da57375717002f0cc4af5676175e9b996a6b6) --- tests/functions_test/dmpd_functions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/functions_test/dmpd_functions.py b/tests/functions_test/dmpd_functions.py index 686ada1..4d23f70 100755 --- a/tests/functions_test/dmpd_functions.py +++ b/tests/functions_test/dmpd_functions.py @@ -282,7 +282,8 @@ def thin_test(args): command=run, errors=errors) - atomic_run("Outputting reverse map of metadata device", + atomic_run("Outputting reverse map of metadata device with negative number in region", + False, source_vg=args["group"], source_lv=args["swap"], region="0..-1", From 0ee1026718693e39950f3939ebfb79e027a733c9 Mon Sep 17 00:00:00 2001 From: Filip Suba Date: Thu, 18 Jan 2024 13:08:38 +0100 Subject: [PATCH 113/135] Backport function tests from centos stream --- tests/functions_test/Makefile | 2 +- tests/functions_test/dmpd_library.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/functions_test/Makefile b/tests/functions_test/Makefile index d9e7f97..6b14a2f 100644 --- a/tests/functions_test/Makefile +++ b/tests/functions_test/Makefile @@ -72,4 +72,4 @@ $(METADATA): Makefile @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA) @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA) - rhts-lint $(METADATA) \ No newline at end of file + rhts-lint $(METADATA) diff --git a/tests/functions_test/dmpd_library.py b/tests/functions_test/dmpd_library.py index c690a3d..1cf44df 100755 --- a/tests/functions_test/dmpd_library.py +++ b/tests/functions_test/dmpd_library.py @@ -16,6 +16,8 @@ """dmpd_library.py: Complete library providing functionality for device-mapper-persistent-data upstream test.""" +from __future__ import print_function + import platform from os.path import expanduser import re #regex @@ -25,7 +27,6 @@ import time import fileinput # TODO: Is this really necessary? Unlikely we will run into python2 in rawhide # again... -from __future__ import print_function def _print(string): @@ -55,7 +56,7 @@ def run(cmd, return_output=False, verbose=True, force_flush=False): date = "date \"+%Y-%m-%d %H:%M:%S\"" p = subprocess.Popen(date, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) stdout, stderr = p.communicate() - stdout = stdout.rstrip("\n") + stdout = stdout.decode('ascii', 'ignore').rstrip("\n") _print("INFO: [%s] Running: '%s'..." % (stdout, cmd)) #enabling shell=True, because was the only way I found to run command with '|' @@ -77,7 +78,7 @@ def run(cmd, return_output=False, verbose=True, force_flush=False): retcode = p.returncode - output = stdout + stderr + output = stdout.decode('ascii', 'ignore') + stderr.decode('ascii', 'ignore') #remove new line from last line output = output.rstrip() From fc4e1a8529686d31f27dd93d3040e2b7e40faba8 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Wed, 17 Jan 2024 15:44:17 +0100 Subject: [PATCH 114/135] Use make_install macro in spec --- device-mapper-persistent-data.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 9f1d981..af895b3 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -93,13 +93,13 @@ echo %{version}-%{release} > VERSION %if %{with check} %check -# FIXME: Reenable testing! %cargo_test #cargo test --test thin_shrink -- --nocapture --test-threads=1 %endif %install -make DESTDIR=%{buildroot} MANDIR=%{_mandir} install +# TODO: Check that MANDIR is unused and remove +%make_install MANDIR=%{_mandir} %files %doc COPYING README.md From 8f47f1dde7d92664ae1c64034f36db98d67786f1 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 18 Jan 2024 11:37:46 +0100 Subject: [PATCH 115/135] Fix some compatibility issues with Python3 --- tests/tools_not_linked_usr/tools_not_linked_usr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/tools_not_linked_usr/tools_not_linked_usr.py b/tests/tools_not_linked_usr/tools_not_linked_usr.py index 74053cf..7be6393 100755 --- a/tests/tools_not_linked_usr/tools_not_linked_usr.py +++ b/tests/tools_not_linked_usr/tools_not_linked_usr.py @@ -14,7 +14,6 @@ # # Author: Bruno Goncalves -from os import walk import subprocess import sys import re @@ -25,7 +24,10 @@ def run(cmd): stdout, stderr = p.communicate() retcode = p.returncode - output = stdout + stderr + output = stdout.decode('ascii', 'ignore') + stderr.decode('ascii', 'ignore') + + # remove new line from last line + output = output.rstrip() print(output) return retcode, output From 62ab60b959cea3ea200be41b059836b2f1e3f9a8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jan 2024 17:03:28 +0000 Subject: [PATCH 116/135] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index af895b3..f503119 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.9 -Release: 1%{?dist}%{?release_suffix} +Release: 2%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools @@ -149,6 +149,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Fri Jan 19 2024 Fedora Release Engineering - 1.0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Mon Dec 11 2023 Marian Csontos - 1.0.9-1 - Update to latest upstream release 1.0.9. From c1fa90d775bb5001af1989752d817b76219297cd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 24 Jan 2024 09:20:18 +0000 Subject: [PATCH 117/135] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index f503119..abac08c 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.9 -Release: 2%{?dist}%{?release_suffix} +Release: 3%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools @@ -149,6 +149,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Wed Jan 24 2024 Fedora Release Engineering - 1.0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 19 2024 Fedora Release Engineering - 1.0.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 32537c977f33bfc2dcd43ed9795c80ec15c7633f Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 8 Feb 2024 15:05:54 +0100 Subject: [PATCH 118/135] Update to version 1.0.11 --- .gitignore | 2 ++ ...-Tweak-cargo.toml-to-work-with-vendor-directory.patch | 8 +++++--- device-mapper-persistent-data.spec | 9 ++++++--- sources | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 4b9fa80..b4fb6f7 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,5 @@ /dmpd106-vendor.tar.gz /v1.0.9.tar.gz /dmpd109-vendor.tar.gz +/v1.0.11.tar.gz +/dmpd1011-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch index 1bdbce3..133165a 100644 --- a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +++ b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch @@ -1,4 +1,4 @@ -From 0d5347bd771e960294cd0c2f083d96448613ab9c Mon Sep 17 00:00:00 2001 +From d7c6150c644a299bb8667a3d5a01b0e03449e996 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 27 Jul 2023 11:37:01 +0200 Subject: [PATCH] Tweak cargo.toml to work with vendor directory @@ -6,15 +6,17 @@ Subject: [PATCH] Tweak cargo.toml to work with vendor directory Mock works offline, cargo would try to download the files from github. So cargo vendor has to be run first, and then change the Cargo.toml to make mock happy. + +(cherry picked from commit 0d5347bd771e960294cd0c2f083d96448613ab9c) --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml -index 500345a4..d4aa38a6 100644 +index 23b46193..b33b7418 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -27,7 +27,8 @@ quick-xml = "0.29" +@@ -27,7 +27,8 @@ quick-xml = "0.31" rand = "0.8" rangemap = "1.4" roaring = "0.10" diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index abac08c..13e1bca 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,14 +9,14 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 1.0.9 -Release: 3%{?dist}%{?release_suffix} +Version: 1.0.11 +Release: 1%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd109-vendor.tar.gz +Source1: dmpd1011-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch %if %{defined rhel} @@ -149,6 +149,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Thu Feb 08 2024 Marian Csontos - 1.0.11-1 +- Update to latest upstream release 1.0.11. + * Wed Jan 24 2024 Fedora Release Engineering - 1.0.9-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index dc3f053..4dee685 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.0.9.tar.gz) = c7d137b82cce4286d43f49af039f8026d7d7746e96affebc82e8243173ba9a014e3b462fc4b55850067ecfbcc6113c49f009c1285e272a4d64455715d11a9da1 -SHA512 (dmpd109-vendor.tar.gz) = f2a581da80e4137c6ecab9237587ec42141fdfe8c1bfae2ab5b431b64c100ea6c65cfadbbdd10d665101364731d7c5e61780490b9cfd5231df3f463483890747 +SHA512 (v1.0.11.tar.gz) = e1adacea2a1d6b07fea288080c0d0c24c99f5e6908ac9ac623b86e068991ceb9ae8967cd253a8ee7bf329ab3d4cf9f57d472438a0b0ffa486f7f8939cf9c10db +SHA512 (dmpd1011-vendor.tar.gz) = 67a9753cf4e488ff37a116dd9232c8dbe2d91047fffd2735025aaa26f804150b5de9324e29a5240af75f1591f518913b7831f980871a4f3175f5a05a56893e9d From e9706a7124731b603260d14383c4f64d0f7b93e9 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 8 Feb 2024 12:26:19 -0500 Subject: [PATCH 119/135] Update Rust macro usage The rust-toolset macros in RHEL 10 are now compatible with Fedora's in terms of handling vendoring and automatic generation of license information and bundled provides. --- device-mapper-persistent-data.spec | 61 +++++++----------------------- 1 file changed, 13 insertions(+), 48 deletions(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 13e1bca..c901155 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.11 -Release: 1%{?dist}%{?release_suffix} +Release: 2%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools @@ -37,52 +37,8 @@ are included and era check, dump, restore and invalidate to manage snapshot eras %prep -%autosetup -p1 -n thin-provisioning-tools-%{version}%{?version_suffix} -#%%cargo_prep -#%%cargo_generate_buildrequires -tar xf %{SOURCE1} -mkdir -p .cargo -( -# Part from %%cargo_prep: -set -euo pipefail -/usr/bin/mkdir -p target/rpm -/usr/bin/ln -s rpm target/release -/usr/bin/rm -rf .cargo/ -/usr/bin/mkdir -p .cargo -cat > .cargo/config << EOF -[build] -rustc = "/usr/bin/rustc" -rustdoc = "/usr/bin/rustdoc" - -[profile.rpm] -inherits = "release" -opt-level = 3 -codegen-units = 1 -debug = 2 -strip = "none" - -[env] -CFLAGS = "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer " -CXXFLAGS = "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer " -LDFLAGS = "-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 " - -[install] -root = "/home/mcsontos/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr" - -[term] -verbose = true -EOF - -# Our own part: -cat >> .cargo/config < VERSION %generate_buildrequires @@ -90,6 +46,9 @@ echo %{version}-%{release} > VERSION %build #make %{?_smp_mflags} V= %cargo_build +%cargo_license_summary +%{cargo_license} > LICENSE.dependencies +%cargo_vendor_manifest %if %{with check} %check @@ -102,7 +61,10 @@ echo %{version}-%{release} > VERSION %make_install MANDIR=%{_mandir} %files -%doc COPYING README.md +%doc README.md +%license COPYING +%license LICENSE.dependencies +%license cargo-vendor.txt %{_mandir}/man8/cache_check.8.gz %{_mandir}/man8/cache_dump.8.gz %{_mandir}/man8/cache_metadata_size.8.gz @@ -149,6 +111,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Thu Feb 08 2024 Yaakov Selkowitz - 1.0.11-2 +- Update Rust macro usage + * Thu Feb 08 2024 Marian Csontos - 1.0.11-1 - Update to latest upstream release 1.0.11. From 36f16d670379620c966d66a905e63707fa5b4e14 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 8 Feb 2024 15:05:54 +0100 Subject: [PATCH 120/135] SPDX migration. --- device-mapper-persistent-data.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index c901155..8644658 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,8 +10,8 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.11 -Release: 2%{?dist}%{?release_suffix} -License: GPLv3+ +Release: 3%{?dist}%{?release_suffix} +License: GPL-3.0-only #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz @@ -111,6 +111,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Tue Feb 13 2024 Marian Csontos - 1.0.11-3 +- SPDX migration + * Thu Feb 08 2024 Yaakov Selkowitz - 1.0.11-2 - Update Rust macro usage From 7ccc70d06b268eb735fbca85666592754fe18130 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 27 Feb 2024 10:41:23 +0100 Subject: [PATCH 121/135] SPDX: Add licenses for vendored libraries. --- device-mapper-persistent-data.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 8644658..e0b2dee 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -11,7 +11,8 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.11 Release: 3%{?dist}%{?release_suffix} -License: GPL-3.0-only +License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) + #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz @@ -111,6 +112,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Tue Feb 13 2024 Marian Csontos - 1.0.11-4 +- Add licenses for statically linked libraries. + * Tue Feb 13 2024 Marian Csontos - 1.0.11-3 - SPDX migration From e10017f3760eaedd0f9db0eb85e5498d269fe608 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 27 Feb 2024 10:42:12 +0100 Subject: [PATCH 122/135] Update to version 1.0.12 --- .gitignore | 2 + ...o.toml-to-work-with-vendor-directory.patch | 10 ++--- ...-set-the-pipe-size-for-triggering-EP.patch | 25 ++++++++++++ ...-tests-Fix-closing-the-pipe-fd-twice.patch | 40 +++++++++++++++++++ device-mapper-persistent-data.spec | 11 +++-- sources | 4 +- 6 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch create mode 100644 0003-tests-Fix-closing-the-pipe-fd-twice.patch diff --git a/.gitignore b/.gitignore index b4fb6f7..8293048 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,5 @@ /dmpd109-vendor.tar.gz /v1.0.11.tar.gz /dmpd1011-vendor.tar.gz +/v1.0.12.tar.gz +/dmpd1012-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch index 133165a..0532ec2 100644 --- a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +++ b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch @@ -1,4 +1,4 @@ -From d7c6150c644a299bb8667a3d5a01b0e03449e996 Mon Sep 17 00:00:00 2001 +From 2a3a7ffa38a2e8ed7f9e89920deabd797ed961d5 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 27 Jul 2023 11:37:01 +0200 Subject: [PATCH] Tweak cargo.toml to work with vendor directory @@ -6,19 +6,17 @@ Subject: [PATCH] Tweak cargo.toml to work with vendor directory Mock works offline, cargo would try to download the files from github. So cargo vendor has to be run first, and then change the Cargo.toml to make mock happy. - -(cherry picked from commit 0d5347bd771e960294cd0c2f083d96448613ab9c) --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml -index 23b46193..b33b7418 100644 +index b33b0a4b..2a87e432 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -27,7 +27,8 @@ quick-xml = "0.31" +@@ -33,7 +33,8 @@ quick-xml = "0.31" rand = "0.8" - rangemap = "1.4" + rangemap = "1.5" roaring = "0.10" -rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } +#rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } diff --git a/0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch b/0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch new file mode 100644 index 0000000..82159b8 --- /dev/null +++ b/0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch @@ -0,0 +1,25 @@ +From 9e55217135b7543f13a5801aafda0fe0a1fb363a Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Mon, 26 Feb 2024 21:11:27 +0800 +Subject: [PATCH] [tests] Explicitly set the pipe size for triggering EPIPE + +(cherry picked from commit 0b3c80efd7c627ce7d75397452f496b6329a90c0) +--- + tests/thin_dump.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/thin_dump.rs b/tests/thin_dump.rs +index 81982188..9eade06e 100644 +--- a/tests/thin_dump.rs ++++ b/tests/thin_dump.rs +@@ -154,6 +154,7 @@ fn test_no_stderr_on_broken_pipe(extra_args: &[&std::ffi::OsStr]) -> Result<()> + let mut pipefd = [0i32; 2]; + unsafe { + ensure!(libc::pipe2(pipefd.as_mut_slice().as_mut_ptr(), libc::O_CLOEXEC) == 0); ++ ensure!(libc::fcntl(pipefd[0], libc::F_SETPIPE_SZ, 65536) == 65536); + } + + let mut args = args![&md].to_vec(); +-- +2.43.0 + diff --git a/0003-tests-Fix-closing-the-pipe-fd-twice.patch b/0003-tests-Fix-closing-the-pipe-fd-twice.patch new file mode 100644 index 0000000..0681b5c --- /dev/null +++ b/0003-tests-Fix-closing-the-pipe-fd-twice.patch @@ -0,0 +1,40 @@ +From 54e7eaf002a2b07cd5571b5d3374eb760d727381 Mon Sep 17 00:00:00 2001 +From: Ming-Hung Tsai +Date: Tue, 27 Feb 2024 01:24:01 +0800 +Subject: [PATCH] [tests] Fix closing the pipe fd twice + +The duct::Expression::stdout_file() takes the ownership of the +passed-in file descriptor, thus the caller doesn't need to close +the fd afterward. Closing a fd twice in tests might inadvertently +closing the fd recently opened by other test threads, leading to +unexpected bugs. + +(cherry picked from commit 3b378b0e39a7ae111a81d394f8721bae89f9ca37) +--- + tests/thin_dump.rs | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tests/thin_dump.rs b/tests/thin_dump.rs +index 9eade06e..caae31ef 100644 +--- a/tests/thin_dump.rs ++++ b/tests/thin_dump.rs +@@ -161,7 +161,7 @@ fn test_no_stderr_on_broken_pipe(extra_args: &[&std::ffi::OsStr]) -> Result<()> + args.extend_from_slice(extra_args); + let cmd = thin_dump_cmd(args) + .to_expr() +- .stdout_file(pipefd[1]) ++ .stdout_file(pipefd[1]) // this transfers ownership of the fd + .stderr_capture(); + let handle = cmd.unchecked().start()?; + +@@ -169,7 +169,6 @@ fn test_no_stderr_on_broken_pipe(extra_args: &[&std::ffi::OsStr]) -> Result<()> + std::thread::sleep(std::time::Duration::from_millis(1000)); + + unsafe { +- libc::close(pipefd[1]); // close the unused write-end + libc::close(pipefd[0]); // causing broken pipe + } + +-- +2.43.0 + diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index e0b2dee..2df597e 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,16 +9,18 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 1.0.11 -Release: 3%{?dist}%{?release_suffix} +Version: 1.0.12 +Release: 1%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd1011-vendor.tar.gz +Source1: dmpd1012-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +Patch2: 0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch +Patch3: 0003-tests-Fix-closing-the-pipe-fd-twice.patch %if %{defined rhel} BuildRequires: rust-toolset @@ -112,6 +114,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Tue Feb 27 2024 Marian Csontos - 1.0.12-1 +- Update to latest upstream release 1.0.12. + * Tue Feb 13 2024 Marian Csontos - 1.0.11-4 - Add licenses for statically linked libraries. diff --git a/sources b/sources index 4dee685..05d1960 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.0.11.tar.gz) = e1adacea2a1d6b07fea288080c0d0c24c99f5e6908ac9ac623b86e068991ceb9ae8967cd253a8ee7bf329ab3d4cf9f57d472438a0b0ffa486f7f8939cf9c10db -SHA512 (dmpd1011-vendor.tar.gz) = 67a9753cf4e488ff37a116dd9232c8dbe2d91047fffd2735025aaa26f804150b5de9324e29a5240af75f1591f518913b7831f980871a4f3175f5a05a56893e9d +SHA512 (v1.0.12.tar.gz) = 2e960e5a0d11016c1131ed48678a44c54164b43811f8efaa7172d9df7f433b185fa4b2f8d3d430affff19ced672f74a1f17614efd00287f2c310a6a3745ff8e5 +SHA512 (dmpd1012-vendor.tar.gz) = 02c0015545f05ac71c427f734a766e75a0f5a17a7edddae57abbb0d1277c0d91c6e26d59dd91aef2f2050aee6aef2e118478ca15183c36348e93185ebad3c1e0 From 226ede080b60c05ed774629191c6afa29da3e64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 17 Apr 2024 23:26:03 +0200 Subject: [PATCH 123/135] Fix build when %_bindir==%_sbindir Preparation for https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin. %install was putting files in the wrong directory. Also, move %install above %test, because %install happens first, and %test after that. --- device-mapper-persistent-data.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 2df597e..eb7bdf4 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -53,16 +53,16 @@ echo %{version}-%{release} > VERSION %{cargo_license} > LICENSE.dependencies %cargo_vendor_manifest +%install +# TODO: Check that MANDIR is unused and remove +%make_install MANDIR=%{_mandir} BINDIR=%{buildroot}%{_sbindir} + %if %{with check} %check %cargo_test #cargo test --test thin_shrink -- --nocapture --test-threads=1 %endif -%install -# TODO: Check that MANDIR is unused and remove -%make_install MANDIR=%{_mandir} - %files %doc README.md %license COPYING From d830fc9808ed959177166fabeb02cda88eaf7f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 9 Jul 2024 12:59:45 +0200 Subject: [PATCH 124/135] Rebuilt for the bin-sbin merge https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index eb7bdf4..f1925e9 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.12 -Release: 1%{?dist}%{?release_suffix} +Release: 2%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) #ExcludeArch: %%{ix86} @@ -114,6 +114,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Tue Jul 09 2024 Zbigniew Jędrzejewski-Szmek - 1.0.12-2 +- Rebuilt for the bin-sbin merge + * Tue Feb 27 2024 Marian Csontos - 1.0.12-1 - Update to latest upstream release 1.0.12. From 4bace50fd14f17ef138bb7b2d7377c4877db8915 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 20:51:53 +0000 Subject: [PATCH 125/135] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index f1925e9..fcac6bf 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.12 -Release: 2%{?dist}%{?release_suffix} +Release: 3%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) #ExcludeArch: %%{ix86} @@ -114,6 +114,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Wed Jul 17 2024 Fedora Release Engineering - 1.0.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Tue Jul 09 2024 Zbigniew Jędrzejewski-Szmek - 1.0.12-2 - Rebuilt for the bin-sbin merge From a540c7b432485d963b1a45fa7765eab155d70de3 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Mon, 2 Sep 2024 15:28:34 +0200 Subject: [PATCH 126/135] Update to version 1.1.0 --- .gitignore | 2 + ...o.toml-to-work-with-vendor-directory.patch | 10 +++-- ...-set-the-pipe-size-for-triggering-EP.patch | 25 ------------ ...-tests-Fix-closing-the-pipe-fd-twice.patch | 40 ------------------- device-mapper-persistent-data.spec | 23 +++++++---- sources | 4 +- 6 files changed, 26 insertions(+), 78 deletions(-) delete mode 100644 0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch delete mode 100644 0003-tests-Fix-closing-the-pipe-fd-twice.patch diff --git a/.gitignore b/.gitignore index 8293048..f182b53 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,5 @@ /dmpd1011-vendor.tar.gz /v1.0.12.tar.gz /dmpd1012-vendor.tar.gz +/v1.1.0.tar.gz +/dmpd110-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch index 0532ec2..fec51a3 100644 --- a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +++ b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch @@ -1,4 +1,4 @@ -From 2a3a7ffa38a2e8ed7f9e89920deabd797ed961d5 Mon Sep 17 00:00:00 2001 +From b0b04e59eb381859f3858120d535cc24059fbc08 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 27 Jul 2023 11:37:01 +0200 Subject: [PATCH] Tweak cargo.toml to work with vendor directory @@ -6,15 +6,17 @@ Subject: [PATCH] Tweak cargo.toml to work with vendor directory Mock works offline, cargo would try to download the files from github. So cargo vendor has to be run first, and then change the Cargo.toml to make mock happy. + +(cherry picked from commit 0d5347bd771e960294cd0c2f083d96448613ab9c) --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml -index b33b0a4b..2a87e432 100644 +index 47703bfc..4c605a54 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -33,7 +33,8 @@ quick-xml = "0.31" +@@ -34,7 +34,8 @@ quick-xml = "0.36" rand = "0.8" rangemap = "1.5" roaring = "0.10" @@ -25,5 +27,5 @@ index b33b0a4b..2a87e432 100644 threadpool = "1.8" thiserror = "1.0" -- -2.43.0 +2.46.0 diff --git a/0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch b/0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch deleted file mode 100644 index 82159b8..0000000 --- a/0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 9e55217135b7543f13a5801aafda0fe0a1fb363a Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Mon, 26 Feb 2024 21:11:27 +0800 -Subject: [PATCH] [tests] Explicitly set the pipe size for triggering EPIPE - -(cherry picked from commit 0b3c80efd7c627ce7d75397452f496b6329a90c0) ---- - tests/thin_dump.rs | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tests/thin_dump.rs b/tests/thin_dump.rs -index 81982188..9eade06e 100644 ---- a/tests/thin_dump.rs -+++ b/tests/thin_dump.rs -@@ -154,6 +154,7 @@ fn test_no_stderr_on_broken_pipe(extra_args: &[&std::ffi::OsStr]) -> Result<()> - let mut pipefd = [0i32; 2]; - unsafe { - ensure!(libc::pipe2(pipefd.as_mut_slice().as_mut_ptr(), libc::O_CLOEXEC) == 0); -+ ensure!(libc::fcntl(pipefd[0], libc::F_SETPIPE_SZ, 65536) == 65536); - } - - let mut args = args![&md].to_vec(); --- -2.43.0 - diff --git a/0003-tests-Fix-closing-the-pipe-fd-twice.patch b/0003-tests-Fix-closing-the-pipe-fd-twice.patch deleted file mode 100644 index 0681b5c..0000000 --- a/0003-tests-Fix-closing-the-pipe-fd-twice.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 54e7eaf002a2b07cd5571b5d3374eb760d727381 Mon Sep 17 00:00:00 2001 -From: Ming-Hung Tsai -Date: Tue, 27 Feb 2024 01:24:01 +0800 -Subject: [PATCH] [tests] Fix closing the pipe fd twice - -The duct::Expression::stdout_file() takes the ownership of the -passed-in file descriptor, thus the caller doesn't need to close -the fd afterward. Closing a fd twice in tests might inadvertently -closing the fd recently opened by other test threads, leading to -unexpected bugs. - -(cherry picked from commit 3b378b0e39a7ae111a81d394f8721bae89f9ca37) ---- - tests/thin_dump.rs | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/tests/thin_dump.rs b/tests/thin_dump.rs -index 9eade06e..caae31ef 100644 ---- a/tests/thin_dump.rs -+++ b/tests/thin_dump.rs -@@ -161,7 +161,7 @@ fn test_no_stderr_on_broken_pipe(extra_args: &[&std::ffi::OsStr]) -> Result<()> - args.extend_from_slice(extra_args); - let cmd = thin_dump_cmd(args) - .to_expr() -- .stdout_file(pipefd[1]) -+ .stdout_file(pipefd[1]) // this transfers ownership of the fd - .stderr_capture(); - let handle = cmd.unchecked().start()?; - -@@ -169,7 +169,6 @@ fn test_no_stderr_on_broken_pipe(extra_args: &[&std::ffi::OsStr]) -> Result<()> - std::thread::sleep(std::time::Duration::from_millis(1000)); - - unsafe { -- libc::close(pipefd[1]); // close the unused write-end - libc::close(pipefd[0]); // causing broken pipe - } - --- -2.43.0 - diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index fcac6bf..4390168 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -2,25 +2,23 @@ # Copyright (C) 2011-2017 Red Hat, Inc # %bcond_without check -%global debug_package %{nil} +#%%global debug_package %%{nil} #%%global version_suffix -rc2 #%%global release_suffix .test3 Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 1.0.12 -Release: 3%{?dist}%{?release_suffix} +Version: 1.1.0 +Release: 1%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd1012-vendor.tar.gz +Source1: dmpd110-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch -Patch2: 0002-tests-Explicitly-set-the-pipe-size-for-triggering-EP.patch -Patch3: 0003-tests-Fix-closing-the-pipe-fd-twice.patch %if %{defined rhel} BuildRequires: rust-toolset @@ -30,6 +28,12 @@ BuildRequires: rust >= 1.35 BuildRequires: cargo %endif BuildRequires: make +BuildRequires: systemd-devel +BuildRequires: clang-libs +BuildRequires: glibc-static +BuildRequires: device-mapper-devel +BuildRequires: clang +#BuildRequires: gcc %description thin-provisioning-tools contains check,dump,restore,repair,rmap @@ -55,7 +59,7 @@ echo %{version}-%{release} > VERSION %install # TODO: Check that MANDIR is unused and remove -%make_install MANDIR=%{_mandir} BINDIR=%{buildroot}%{_sbindir} +%make_install STRIP=true MANDIR=%{_mandir} BINDIR=%{buildroot}%{_sbindir} %if %{with check} %check @@ -83,6 +87,7 @@ echo %{version}-%{release} > VERSION %{_mandir}/man8/thin_dump.8.gz %{_mandir}/man8/thin_ls.8.gz %{_mandir}/man8/thin_metadata_size.8.gz +%{_mandir}/man8/thin_migrate.8.gz %{_mandir}/man8/thin_repair.8.gz %{_mandir}/man8/thin_restore.8.gz %{_mandir}/man8/thin_rmap.8.gz @@ -105,6 +110,7 @@ echo %{version}-%{release} > VERSION %{_sbindir}/thin_dump %{_sbindir}/thin_ls %{_sbindir}/thin_metadata_size +%{_sbindir}/thin_migrate %{_sbindir}/thin_repair %{_sbindir}/thin_restore %{_sbindir}/thin_rmap @@ -114,6 +120,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Mon Sep 02 2024 Marian Csontos - 1.1.0-1 +- Update to latest upstream release 1.1.0. + * Wed Jul 17 2024 Fedora Release Engineering - 1.0.12-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/sources b/sources index 05d1960..0d0f396 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.0.12.tar.gz) = 2e960e5a0d11016c1131ed48678a44c54164b43811f8efaa7172d9df7f433b185fa4b2f8d3d430affff19ced672f74a1f17614efd00287f2c310a6a3745ff8e5 -SHA512 (dmpd1012-vendor.tar.gz) = 02c0015545f05ac71c427f734a766e75a0f5a17a7edddae57abbb0d1277c0d91c6e26d59dd91aef2f2050aee6aef2e118478ca15183c36348e93185ebad3c1e0 +SHA512 (v1.1.0.tar.gz) = 8cf3953743334b5a34504695757fa2de5a5fb5bdb8c7aed859995154fc004f52c3ef041558d307a2309c2de8dcdcbd8a0537bd3408fd78c7ff2f641f28944c1e +SHA512 (dmpd110-vendor.tar.gz) = 05c32ade894331eb11239c88d702d20ac463745b51d2c8b71d5aed75ce443ab160d94cd33bdbf021982fe3edc21c630e5bd5dba66d890b352bb6636d09667077 From 42f0442c767c4c175e834002cb29f7489fd4fbb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 12 Jan 2025 14:26:13 +0100 Subject: [PATCH 127/135] Rebuilt for the bin-sbin merge (2nd attempt) https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 4390168..db4d9c0 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.1.0 -Release: 1%{?dist}%{?release_suffix} +Release: 2%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) #ExcludeArch: %%{ix86} @@ -120,6 +120,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Sun Jan 12 2025 Zbigniew Jędrzejewski-Szmek - 1.1.0-2 +- Rebuilt for the bin-sbin merge (2nd attempt) + * Mon Sep 02 2024 Marian Csontos - 1.1.0-1 - Update to latest upstream release 1.1.0. From cfc94352300c8ee9a02733c7a0229e69d7179c06 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 15:37:25 +0000 Subject: [PATCH 128/135] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index db4d9c0..3ab5afa 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.1.0 -Release: 2%{?dist}%{?release_suffix} +Release: 3%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) #ExcludeArch: %%{ix86} @@ -120,6 +120,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Thu Jan 16 2025 Fedora Release Engineering - 1.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sun Jan 12 2025 Zbigniew Jędrzejewski-Szmek - 1.1.0-2 - Rebuilt for the bin-sbin merge (2nd attempt) From afa261551b1e2910bf7942d68412ab66e8e8217a Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Wed, 11 Jun 2025 15:20:55 +0200 Subject: [PATCH 129/135] Update README Describe Cargo.toml patching. And explain the notes to greater detail. --- README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4c77f74..ab05368 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,30 @@ # Packaging dmpd -This is mostly regular package except recent addition of rust to used languages. +This is rust package using *vendor* file for dependencies. -## rust-tools - -To build the rust-tools (`make rust-tools`) one needs: +To build the package following tooling is needed: - rust >= 1.35 -- cargo with vendor subcommand (now upstream, included in latest Fedora and RHEL8) +- cargo with vendor subcommand (now upstream, included in latest Fedora and RHEL8+) -### cargo vendpr +## cargo vendor -- run `cargo vendor` in the disrectory with sources +- run `cargo vendor` in the directory with sources - run `tar czf device-mapper-persistent-data-vendor-$VERSION.tar.gz ./vendor` - copy the file (if version changed) and run the *fedpkg new-sources* command: - `fedpkg new-sources v$VERSION.tar.gz device-mapper-persistent-data-vendor-$VERSION.tar.gz` +- some dependencies (at the moment only *rio*) are not using upstream from + registry, but a patched version. **After** running cargo vendor apply patch + *0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch* so build does not + try to connect to internet. This dependency is being replaced by supported + crate. ## TODO/NOTES -Some of the dependencies may be already packaged by Fedora. Can we instruct *cargo vendor* to include only those which are not provided by Fedora? +Some of the dependencies are already packaged by Fedora. Can we instruct *cargo vendor* to include only those which are not provided by Fedora? +It would be possible to include these as submodules, and the rest could be used from Fedora. +For RHEL and CentOS Stream using vendor file is the recommended way. -*%cargo_install* installs by defualt in */usr/bin* but the package expects */usr/sbin*. For now I run *make install-rust-tools*. +*%cargo_install* installs by default in */usr/bin* but the package expects */usr/sbin*. For now I run *make install-rust-tools*. +Now Fedora unified the */usr/sbin* and */usr/bin* directories, to this can be "fixed" in Fedora and later in CentOS Stream. From 6eaa83f88661250417023e409095669b27768f42 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Mon, 16 Jun 2025 15:20:46 +0200 Subject: [PATCH 130/135] Update README --- README.md | 60 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ab05368..225838a 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,55 @@ -# Packaging dmpd +# Packaging device-mapper-persitent-data (AKA dmpd) -This is rust package using *vendor* file for dependencies. +This is rust package using *vendor* file for dependencies. (Vendor file is an archive of dependencies' sources.) -To build the package following tooling is needed: +For most of simple fixes, there is nothing special, +to add a patches simply add them to dist-git, +add a corresponding `PatchN: 000N-...` lines, +increase `Release:` or `release_suffix` for Z-stream (or for test build use suffix like `.bzNNNNNN`), +add to `%changelog`, +commit, +push, +and build the package using `fedpkg build`. -- rust >= 1.35 -- cargo with vendor subcommand (now upstream, included in latest Fedora and RHEL8+) +Alternatively before committing anything use `fedpkg srpm` and `fedpkg scratch-build --srpm $SRPM [--arches x86_64]` to create a scratch build. -## cargo vendor +However when building a new version of dmpd or when updating a dependency is +needed (e.g. because of CVE in the dependency) vendor file +has to be regenerated. -- run `cargo vendor` in the directory with sources -- run `tar czf device-mapper-persistent-data-vendor-$VERSION.tar.gz ./vendor` -- copy the file (if version changed) and run the *fedpkg new-sources* command: +## Updating vendor file + +To build a new version of the package following tooling is needed: + +- `rust >= 1.35` +- `cargo` providing vendor subcommand (now upstream, included in latest Fedora and RHEL8+) + +To create the vendor file: + +In the upstream directory: + +1. Run `cargo vendor` in the directory with upstream sources to create *vendor* + directory with sources. + - TODO: There is a *cargo-vendor-filterer* project used by *stratisd* to + filter out unnecessary dependencies for other operating systems. +2. Run `tar czf device-mapper-persistent-data-vendor-$VERSION.tar.gz ./vendor` to create a tarball. +3. Copy the vendor file to dist git directory. + +In the dist-git directory: + +1. Get the upstream tarball `wget https://github.com/mingnus/thin-merge/archive/v$VERSION.tar.gz` +2. Update *Source0* and *Source1* to correct values. +3. Add the tarballs to koji/brew lookaside: - `fedpkg new-sources v$VERSION.tar.gz device-mapper-persistent-data-vendor-$VERSION.tar.gz` -- some dependencies (at the moment only *rio*) are not using upstream from - registry, but a patched version. **After** running cargo vendor apply patch - *0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch* so build does not - try to connect to internet. This dependency is being replaced by supported - crate. +4. You may need to update *0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch* to modify + *Cargo.toml* file. Some dependencies (at the moment only *rio*) are not + using upstream from registry, but a patched version. With unmodified + *Cargo.toml* build would fail as it would try to reach to internet. + - NOTE: This patch **MUST NOT** be present in the upstream source directory + when running `cargo vendor`. + - I apply the patch after step 1, and use `git format-patch HEAD^` to + create the patch and add the patch to dist-git directory afterwards. + - The work to replace dependency on rio is in progress. ## TODO/NOTES From f8b6ae0ff5280ae6cff3ea0d91ca36780e198ec1 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 26 Jun 2025 13:53:30 +0200 Subject: [PATCH 131/135] Fix tarball links --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 225838a..1f4acf9 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,8 @@ In the upstream directory: In the dist-git directory: -1. Get the upstream tarball `wget https://github.com/mingnus/thin-merge/archive/v$VERSION.tar.gz` +1. Get the upstream tarball `wget https://github.com/jthornber/thin-provisioning-tools/archive/v$VERSION.tar.gz` + - NOTE: Migration to `https://github.com/device-mapper-utils/thin-provisioning-tools` is coming. 2. Update *Source0* and *Source1* to correct values. 3. Add the tarballs to koji/brew lookaside: - `fedpkg new-sources v$VERSION.tar.gz device-mapper-persistent-data-vendor-$VERSION.tar.gz` From f5a75df400370d2620d498c6e0a437958baf4d43 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 19:13:00 +0000 Subject: [PATCH 132/135] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- device-mapper-persistent-data.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 3ab5afa..d93a722 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.1.0 -Release: 3%{?dist}%{?release_suffix} +Release: 4%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) #ExcludeArch: %%{ix86} @@ -120,6 +120,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 1.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Thu Jan 16 2025 Fedora Release Engineering - 1.1.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 6e755274167a3b1d286cd794a9508486b11c637c Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 4 Sep 2025 15:46:21 +0200 Subject: [PATCH 133/135] Update to version 1.2.1 --- .gitignore | 2 ++ ...o.toml-to-work-with-vendor-directory.patch | 22 +++++++++---------- device-mapper-persistent-data.spec | 21 +++++++++++++++--- sources | 4 ++-- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index f182b53..b493c9d 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,5 @@ /dmpd1012-vendor.tar.gz /v1.1.0.tar.gz /dmpd110-vendor.tar.gz +/v1.2.1.tar.gz +/dmpd121-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch index fec51a3..1d96b49 100644 --- a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +++ b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch @@ -1,6 +1,6 @@ -From b0b04e59eb381859f3858120d535cc24059fbc08 Mon Sep 17 00:00:00 2001 +From 954a2fd73edd2b07543c37143be7cce5ba4f5459 Mon Sep 17 00:00:00 2001 From: Marian Csontos -Date: Thu, 27 Jul 2023 11:37:01 +0200 +Date: Thu, 4 Sep 2025 11:16:06 +0200 Subject: [PATCH] Tweak cargo.toml to work with vendor directory Mock works offline, cargo would try to download the files from github. @@ -13,19 +13,19 @@ make mock happy. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml -index 47703bfc..4c605a54 100644 +index 7924643f..227ebc06 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -34,7 +34,8 @@ quick-xml = "0.36" - rand = "0.8" - rangemap = "1.5" - roaring = "0.10" +@@ -33,7 +33,8 @@ quick-xml = "0.38" + rand = "0.9" + rangemap = "1.6" + roaring = "0.11" -rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } +#rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } +rio = { version = "0.9.4", optional = true } - safemem = "0.3" - threadpool = "1.8" - thiserror = "1.0" + thiserror = "2.0" + tui = { version = "0.19", default-features = false, features = [ + "termion", -- -2.46.0 +2.51.0 diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index d93a722..078e982 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,15 +9,15 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 1.1.0 -Release: 4%{?dist}%{?release_suffix} +Version: 1.2.1 +Release: 1%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd110-vendor.tar.gz +Source1: dmpd121-vendor.tar.gz Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch %if %{defined rhel} @@ -46,6 +46,18 @@ snapshot eras %prep %autosetup -p1 -n thin-provisioning-tools-%{version}%{?version_suffix} -a1 %cargo_prep -v vendor + +# NOTE: Following could replace Cargo.toml patching, but some macros are not working well with it +# Notably at least one of cargo_license_summary, cargo_license_summary, or cargo_vendor_manifest +#cat >> .cargo/config.toml << EOF +# +#[source."git+https://github.com/jthornber/rio?branch=master"] +#git = "https://github.com/jthornber/rio" +#branch = "master" +#replace-with = "vendored-sources" +# +#EOF + echo %{version}-%{release} > VERSION %generate_buildrequires @@ -120,6 +132,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Thu Sep 04 2025 Marian Csontos - 1.2.1-1 +- Update to latest upstream release 1.2.1. + * Wed Jul 23 2025 Fedora Release Engineering - 1.1.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild diff --git a/sources b/sources index 0d0f396..eb39fed 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.1.0.tar.gz) = 8cf3953743334b5a34504695757fa2de5a5fb5bdb8c7aed859995154fc004f52c3ef041558d307a2309c2de8dcdcbd8a0537bd3408fd78c7ff2f641f28944c1e -SHA512 (dmpd110-vendor.tar.gz) = 05c32ade894331eb11239c88d702d20ac463745b51d2c8b71d5aed75ce443ab160d94cd33bdbf021982fe3edc21c630e5bd5dba66d890b352bb6636d09667077 +SHA512 (v1.2.1.tar.gz) = cc96f8d4b32eb3f905e24db3ba9d291436effdea1c468c1f2292da20fdd8438058552314b5802450f62af414fb338cadff06b37c927f2272b8e34d3704a6a59b +SHA512 (dmpd121-vendor.tar.gz) = 999395721d94f35f459faf855ca718e5746f72989ca532aa85174b3d7d86ba31779718034248cabba708e12f4ef26747970d3ca8a4326eb19012287377aab969 From af8fbf5a507de6aa74b60f437cbb46ac0b92dfcf Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Wed, 22 Oct 2025 16:56:52 +0200 Subject: [PATCH 134/135] Update to version 1.3.0 --- .gitignore | 2 ++ ...o.toml-to-work-with-vendor-directory.patch | 31 ------------------- README.md | 9 ------ device-mapper-persistent-data.spec | 8 +++-- sources | 4 +-- 5 files changed, 9 insertions(+), 45 deletions(-) delete mode 100644 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch diff --git a/.gitignore b/.gitignore index b493c9d..7903be8 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,5 @@ /dmpd110-vendor.tar.gz /v1.2.1.tar.gz /dmpd121-vendor.tar.gz +/v1.3.0.tar.gz +/dmpd130-vendor.tar.gz diff --git a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch b/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch deleted file mode 100644 index 1d96b49..0000000 --- a/0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 954a2fd73edd2b07543c37143be7cce5ba4f5459 Mon Sep 17 00:00:00 2001 -From: Marian Csontos -Date: Thu, 4 Sep 2025 11:16:06 +0200 -Subject: [PATCH] Tweak cargo.toml to work with vendor directory - -Mock works offline, cargo would try to download the files from github. -So cargo vendor has to be run first, and then change the Cargo.toml to -make mock happy. - -(cherry picked from commit 0d5347bd771e960294cd0c2f083d96448613ab9c) ---- - Cargo.toml | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/Cargo.toml b/Cargo.toml -index 7924643f..227ebc06 100644 ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -33,7 +33,8 @@ quick-xml = "0.38" - rand = "0.9" - rangemap = "1.6" - roaring = "0.11" --rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } -+#rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true } -+rio = { version = "0.9.4", optional = true } - thiserror = "2.0" - tui = { version = "0.19", default-features = false, features = [ - "termion", --- -2.51.0 - diff --git a/README.md b/README.md index 1f4acf9..a81396d 100644 --- a/README.md +++ b/README.md @@ -42,15 +42,6 @@ In the dist-git directory: 2. Update *Source0* and *Source1* to correct values. 3. Add the tarballs to koji/brew lookaside: - `fedpkg new-sources v$VERSION.tar.gz device-mapper-persistent-data-vendor-$VERSION.tar.gz` -4. You may need to update *0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch* to modify - *Cargo.toml* file. Some dependencies (at the moment only *rio*) are not - using upstream from registry, but a patched version. With unmodified - *Cargo.toml* build would fail as it would try to reach to internet. - - NOTE: This patch **MUST NOT** be present in the upstream source directory - when running `cargo vendor`. - - I apply the patch after step 1, and use `git format-patch HEAD^` to - create the patch and add the patch to dist-git directory afterwards. - - The work to replace dependency on rio is in progress. ## TODO/NOTES diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 078e982..6d1a0c4 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,7 +9,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 1.2.1 +Version: 1.3.0 Release: 1%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) @@ -17,8 +17,7 @@ License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd121-vendor.tar.gz -Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch +Source1: dmpd130-vendor.tar.gz %if %{defined rhel} BuildRequires: rust-toolset @@ -132,6 +131,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Wed Oct 22 2025 Marian Csontos - 1.3.0-1 +- Update to latest upstream release 1.3.0. + * Thu Sep 04 2025 Marian Csontos - 1.2.1-1 - Update to latest upstream release 1.2.1. diff --git a/sources b/sources index eb39fed..10e4d92 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.2.1.tar.gz) = cc96f8d4b32eb3f905e24db3ba9d291436effdea1c468c1f2292da20fdd8438058552314b5802450f62af414fb338cadff06b37c927f2272b8e34d3704a6a59b -SHA512 (dmpd121-vendor.tar.gz) = 999395721d94f35f459faf855ca718e5746f72989ca532aa85174b3d7d86ba31779718034248cabba708e12f4ef26747970d3ca8a4326eb19012287377aab969 +SHA512 (v1.3.0.tar.gz) = 84e364df240a43fea44edfe14cf428d79d1301891b2482599229e125768912127922377139c2117db50a5370fb08c0f52d589d11b6a90673af2d242ff4ef7920 +SHA512 (dmpd130-vendor.tar.gz) = 9f5e7e68da29189f74dfae5d8c219917b3e11fe73e9f978fec22d3003734a6fff2df6fb1a83c84a666726ba473f611aabd2ecf77ff859c0b3be85dc48a6dcf21 From 010e823bf009dac2fdbd046e5d979d16c536df37 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 2 Dec 2025 12:17:27 +0100 Subject: [PATCH 135/135] Update to version 1.3.1 --- .gitignore | 2 ++ device-mapper-persistent-data.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 7903be8..1844bef 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,5 @@ /dmpd121-vendor.tar.gz /v1.3.0.tar.gz /dmpd130-vendor.tar.gz +/v1.3.1.tar.gz +/dmpd131-vendor.tar.gz diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 6d1a0c4..213bfff 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -9,7 +9,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data -Version: 1.3.0 +Version: 1.3.1 Release: 1%{?dist}%{?release_suffix} License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) @@ -17,7 +17,7 @@ License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache URL: https://github.com/jthornber/thin-provisioning-tools #Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz -Source1: dmpd130-vendor.tar.gz +Source1: dmpd131-vendor.tar.gz %if %{defined rhel} BuildRequires: rust-toolset @@ -131,6 +131,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Tue Dec 02 2025 Marian Csontos - 1.3.1-1 +- Update to latest upstream release 1.3.1. + * Wed Oct 22 2025 Marian Csontos - 1.3.0-1 - Update to latest upstream release 1.3.0. diff --git a/sources b/sources index 10e4d92..4ddfdfb 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v1.3.0.tar.gz) = 84e364df240a43fea44edfe14cf428d79d1301891b2482599229e125768912127922377139c2117db50a5370fb08c0f52d589d11b6a90673af2d242ff4ef7920 -SHA512 (dmpd130-vendor.tar.gz) = 9f5e7e68da29189f74dfae5d8c219917b3e11fe73e9f978fec22d3003734a6fff2df6fb1a83c84a666726ba473f611aabd2ecf77ff859c0b3be85dc48a6dcf21 +SHA512 (v1.3.1.tar.gz) = ff0758b21b50702568cad88522ee4c2b6b4433cec0a5f5074c9d1791c13e630e5c516601d7a68c51ac34e036091fc82fe831dbe51e6776737571d90ed266878e +SHA512 (dmpd131-vendor.tar.gz) = 0e1b8e501e330b64415c9097c94dfc1f1b43d2900a66258e40b6c8f28c51fd61247d60495f594f14550fb349ed4ad435f8959a8808fea1d363a206c5ead7db1e