diff --git a/.btrfs-progs.metadata b/.btrfs-progs.metadata new file mode 100644 index 0000000..964d617 --- /dev/null +++ b/.btrfs-progs.metadata @@ -0,0 +1 @@ +8aa868288cb8b09b881825ca341cebf420037a5e SOURCES/btrfs-progs-0.20.rc1.20130917git194aa4a.tar.bz2 diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch b/SOURCES/0001-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch new file mode 100644 index 0000000..75d8310 --- /dev/null +++ b/SOURCES/0001-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch @@ -0,0 +1,28 @@ +From df1f875e27730fe2b10812b585f3e6bbc5502d8f Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sun, 12 May 2013 16:27:12 +0100 +Subject: [PATCH] libbtrfs: Set SONAME to "libbtrfs.so.0" (instead of + "libbtrfs.so"). + +Signed-off-by: Richard W.M. Jones +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + + + +diff --git a/Makefile b/Makefile +index da7438e..0446836 100644 +--- a/Makefile ++++ b/Makefile +@@ -100,7 +100,7 @@ version.h: + $(libs_shared): $(libbtrfs_objects) $(lib_links) send.h + @echo " [LD] $@" + $(Q)$(CC) $(CFLAGS) $(libbtrfs_objects) $(LDFLAGS) $(lib_LIBS) \ +- -shared -Wl,-soname,libbtrfs.so -o libbtrfs.so.0.1 ++ -shared -Wl,-soname,libbtrfs.so.0 -o libbtrfs.so.0.1 + + $(libs_static): $(libbtrfs_objects) + @echo " [AR] $@" + + diff --git a/SOURCES/btrfs-init-dev-list.patch b/SOURCES/btrfs-init-dev-list.patch new file mode 100644 index 0000000..2dd40fc --- /dev/null +++ b/SOURCES/btrfs-init-dev-list.patch @@ -0,0 +1,12 @@ +diff --git a/utils.c b/utils.c +index a5ffb62..f6686c6 100644 +--- a/utils.c ++++ b/utils.c +@@ -502,6 +502,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, + device->bytes_used = 0; + device->total_ios = 0; + device->dev_root = root->fs_info->dev_root; ++ INIT_LIST_HEAD(&device->dev_list); + + ret = btrfs_add_device(trans, root, device); + BUG_ON(ret); diff --git a/SOURCES/btrfs-progs-Makefile.patch b/SOURCES/btrfs-progs-Makefile.patch new file mode 100644 index 0000000..c80ebaa --- /dev/null +++ b/SOURCES/btrfs-progs-Makefile.patch @@ -0,0 +1,13 @@ +Index: btrfs-progs-0.20.rc1.20130501git7854c8b/Makefile +=================================================================== +--- btrfs-progs-0.20.rc1.20130501git7854c8b.orig/Makefile ++++ btrfs-progs-0.20.rc1.20130501git7854c8b/Makefile +@@ -222,6 +222,8 @@ clean : + install: $(libs) $(progs) install-man + $(INSTALL) -m755 -d $(DESTDIR)$(bindir) + $(INSTALL) $(progs) $(DESTDIR)$(bindir) ++ # make btrfsck a link again under $(DESTDIR) ++ $(LN) -f $(DESTDIR)$(bindir)/btrfs $(DESTDIR)$(bindir)/btrfsck + $(INSTALL) -m755 -d $(DESTDIR)$(libdir) + $(INSTALL) $(libs) $(DESTDIR)$(libdir) + cp -a $(lib_links) $(DESTDIR)$(libdir) diff --git a/SOURCES/btrfs-progs-valgrind.patch b/SOURCES/btrfs-progs-valgrind.patch new file mode 100644 index 0000000..0ad3927 --- /dev/null +++ b/SOURCES/btrfs-progs-valgrind.patch @@ -0,0 +1,152 @@ +Not-upstream changes from Josef. Some bits have made it usptream +and have been removed; the rest needs some reverse-engineering. + +diff -up btrfs-progs-0.19/btrfsck.c.orig btrfs-progs-0.19/btrfsck.c +diff -up btrfs-progs-0.19/disk-io.c.orig btrfs-progs-0.19/disk-io.c +--- btrfs-progs-0.19/disk-io.c.orig 2012-04-11 10:42:36.213042556 -0400 ++++ btrfs-progs-0.19/disk-io.c 2012-04-11 10:42:58.790867701 -0400 +@@ -622,7 +624,7 @@ static struct btrfs_fs_info *__open_ctre + struct btrfs_root *chunk_root = malloc(sizeof(struct btrfs_root)); + struct btrfs_root *dev_root = malloc(sizeof(struct btrfs_root)); + struct btrfs_root *csum_root = malloc(sizeof(struct btrfs_root)); +- struct btrfs_fs_info *fs_info = malloc(sizeof(*fs_info)); ++ struct btrfs_fs_info *fs_info = malloc(sizeof(struct btrfs_fs_info)); + int ret; + struct btrfs_super_block *disk_super; + struct btrfs_fs_devices *fs_devices = NULL; +@@ -646,7 +648,7 @@ static struct btrfs_fs_info *__open_ctre + goto out; + } + +- memset(fs_info, 0, sizeof(*fs_info)); ++ memset(fs_info, 0, sizeof(struct btrfs_fs_info)); + fs_info->tree_root = tree_root; + fs_info->extent_root = extent_root; + fs_info->chunk_root = chunk_root; +@@ -1063,15 +1065,19 @@ static int close_all_devices(struct btrf + { + struct list_head *list; + struct list_head *next; ++ struct list_head *tmp; + struct btrfs_device *device; + +- return 0; +- + list = &fs_info->fs_devices->devices; +- list_for_each(next, list) { ++ list_for_each_safe(next, tmp, list) { + device = list_entry(next, struct btrfs_device, dev_list); + close(device->fd); ++ list_del(&device->dev_list); ++ free(device->name); ++ free(device->label); ++ free(device); + } ++ free(fs_info->fs_devices); + return 0; + } + +@@ -1121,12 +1127,14 @@ int close_ctree(struct btrfs_root *root) + extent_io_tree_cleanup(&fs_info->pinned_extents); + extent_io_tree_cleanup(&fs_info->pending_del); + extent_io_tree_cleanup(&fs_info->extent_ins); ++ btrfs_mapping_tree_free(&fs_info->mapping_tree); + + free(fs_info->tree_root); + free(fs_info->extent_root); + free(fs_info->chunk_root); + free(fs_info->dev_root); + free(fs_info->csum_root); ++ free(fs_info->log_root_tree); + free(fs_info); + + return 0; +diff -up btrfs-progs-0.19/extent-cache.c.orig btrfs-progs-0.19/extent-cache.c +--- btrfs-progs-0.19/extent-cache.c.orig 2012-04-11 10:42:36.214042548 -0400 ++++ btrfs-progs-0.19/extent-cache.c 2012-04-11 10:42:58.833867368 -0400 +@@ -168,3 +168,14 @@ void remove_cache_extent(struct cache_tr + rb_erase(&pe->rb_node, &tree->root); + } + ++void free_cache_tree(struct cache_tree *tree) ++{ ++ struct rb_node *node; ++ struct cache_extent *cache; ++ ++ while ((node = rb_last(&tree->root)) != NULL) { ++ cache = rb_entry(node, struct cache_extent, rb_node); ++ remove_cache_extent(tree, cache); ++ free(cache); ++ } ++} +diff -up btrfs-progs-0.19/extent-cache.h.orig btrfs-progs-0.19/extent-cache.h +--- btrfs-progs-0.19/extent-cache.h.orig 2009-06-11 12:56:15.000000000 -0400 ++++ btrfs-progs-0.19/extent-cache.h 2012-04-11 10:42:58.850867237 -0400 +@@ -43,6 +43,7 @@ struct cache_extent *find_cache_extent(s + int insert_cache_extent(struct cache_tree *tree, u64 start, u64 size); + int insert_existing_cache_extent(struct cache_tree *tree, + struct cache_extent *pe); ++void free_cache_tree(struct cache_tree *tree); + + static inline int cache_tree_empty(struct cache_tree *tree) + { +diff -up btrfs-progs-0.19/extent-tree.c.orig btrfs-progs-0.19/extent-tree.c +--- btrfs-progs-0.19/extent-tree.c.orig 2012-04-11 10:42:36.216042532 -0400 ++++ btrfs-progs-0.19/extent-tree.c 2012-04-11 10:42:58.851867229 -0400 +@@ -2999,6 +2999,7 @@ out: + + int btrfs_free_block_groups(struct btrfs_fs_info *info) + { ++ struct btrfs_space_info *space_info; + u64 start; + u64 end; + u64 ptr; +@@ -3022,6 +3023,15 @@ int btrfs_free_block_groups(struct btrfs + clear_extent_dirty(&info->free_space_cache, start, + end, GFP_NOFS); + } ++ ++ while (!list_empty(&info->space_info)) { ++ space_info = list_entry(info->space_info.next, ++ struct btrfs_space_info, ++ list); ++ list_del(&space_info->list); ++ kfree(space_info); ++ } ++ + return 0; + } + +diff -up btrfs-progs-0.19/volumes.c.orig btrfs-progs-0.19/volumes.c +--- btrfs-progs-0.19/volumes.c.orig 2012-04-11 10:42:36.228042439 -0400 ++++ btrfs-progs-0.19/volumes.c 2012-04-11 10:43:03.313832673 -0400 +@@ -957,6 +957,20 @@ void btrfs_mapping_init(struct btrfs_map + cache_tree_init(&tree->cache_tree); + } + ++void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree) ++{ ++ struct cache_extent *cache; ++ struct rb_node *node; ++ struct map_lookup *map; ++ ++ while ((node = rb_last(&tree->cache_tree.root)) != NULL) { ++ cache = rb_entry(node, struct cache_extent, rb_node); ++ map = container_of(cache, struct map_lookup, ce); ++ remove_cache_extent(&tree->cache_tree, cache); ++ free(map); ++ } ++} ++ + int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len) + { + struct cache_extent *ce; +diff -up btrfs-progs-0.19/volumes.h.orig btrfs-progs-0.19/volumes.h +--- btrfs-progs-0.19/volumes.h.orig 2012-04-11 10:42:36.228042439 -0400 ++++ btrfs-progs-0.19/volumes.h 2012-04-11 10:43:03.314832666 -0400 +@@ -182,4 +182,5 @@ int btrfs_add_system_chunk(struct btrfs_ + struct btrfs_root *root, struct btrfs_key *key, + struct btrfs_chunk *chunk, int item_size); + int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset); ++void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree); + #endif diff --git a/SPECS/btrfs-progs.spec b/SPECS/btrfs-progs.spec new file mode 100644 index 0000000..5210350 --- /dev/null +++ b/SPECS/btrfs-progs.spec @@ -0,0 +1,224 @@ +Name: btrfs-progs +Version: 0.20.rc1.20130917git194aa4a +Release: 1%{?dist} +Summary: Userspace programs for btrfs + +Group: System Environment/Base +License: GPLv2 +URL: http://btrfs.wiki.kernel.org/index.php/Main_Page +Source0: %{name}-%{version}.tar.bz2 + +# Valgrind patch no longer applied, but kept for posterity +# Still must reverse-engineer fixes in there and get upstream +Patch0: btrfs-progs-valgrind.patch +Patch1: btrfs-init-dev-list.patch +Patch2: btrfs-progs-Makefile.patch + +# Patch accepted upstream 2013-05-13: +# http://permalink.gmane.org/gmane.comp.file-systems.btrfs/25681 +Patch3: 0001-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: e2fsprogs-devel, libuuid-devel, zlib-devel +BuildRequires: libacl-devel, libblkid-devel, lzo-devel + +%define _root_sbindir /sbin + +%description +The btrfs-progs package provides all the userspace programs needed to create, +check, modify and correct any inconsistencies in the btrfs filesystem. + +%package devel +Summary: btrfs filesystem-specific libraries and headers +Group: Development/Libraries +Requires: btrfs-progs = %{version}-%{release} + +%description devel +btrfs-progs-devel contains the libraries and header files needed to +develop btrfs filesystem-specific programs. + +You should install btrfs-progs-devel if you want to develop +btrfs filesystem-specific programs. + +%prep +%setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 + +%build +make CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +make mandir=%{_mandir} bindir=%{_sbindir} libdir=%{_libdir} incdir=%{_includedir}/btrfs install DESTDIR=$RPM_BUILD_ROOT +# Nuke the static lib +rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc COPYING +%{_libdir}/libbtrfs.so.0* +%{_sbindir}/btrfsck +%{_sbindir}/mkfs.btrfs +%{_sbindir}/btrfs-debug-tree +%{_sbindir}/btrfs-image +%{_sbindir}/btrfs-convert +%{_sbindir}/btrfstune +%{_sbindir}/btrfs +%{_sbindir}/btrfs-map-logical +%{_sbindir}/btrfs-zero-log +%{_sbindir}/btrfs-find-root +%{_sbindir}/btrfs-show-super +%{_mandir}/man8/btrfs-image.8.gz +%{_mandir}/man8/btrfsck.8.gz +%{_mandir}/man8/mkfs.btrfs.8.gz +%{_mandir}/man8/btrfs.8.gz + +%files devel +%{_includedir}/* +%{_libdir}/libbtrfs.so + +%changelog +* Tue Sep 17 2013 Eric Sandeen 0.20.rc1.20130917git194aa4a-1 +- New upstream snapshot +- Deprecated btrfsctl, btrfs-show, and btrfs-vol; still available in btrfs cmd + +* Sat Aug 03 2013 Fedora Release Engineering - 0.20.rc1.20130501git7854c8b-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon May 13 2013 Richard W.M. Jones 0.20.rc1.20130501git7854c8b-3 +- Add accepted upstream patch to fix SONAME libbtrfs.so -> libbtrfs.so.0 + +* Thu May 02 2013 Eric Sandeen 0.20.rc1.20130501git7854c8b-2 +- Fix subpackage brokenness + +* Wed May 01 2013 Eric Sandeen 0.20.rc1.20130501git7854c8b-1 +- New upstream snapshot +- btrfs-progs-devel subpackage + +* Fri Mar 08 2013 Eric Sandeen 0.20.rc1.20130308git704a08c-1 +- New upstream snapshot +- btrfs-restore is now a command in the btrfs utility + +* Wed Feb 13 2013 Richard W.M. Jones 0.20.rc1.20121017git91d9eec-3 +- Include upstream patch to clear caches as a partial fix for RHBZ#863978. + +* Thu Nov 1 2012 Josef Bacik 0.20.rc1.20121017git91d9eec-2 +- fix a bug when mkfs'ing a file (rhbz# 871778) + +* Wed Oct 17 2012 Josef Bacik 0.20.rc1.20121017git91d9eec-1 +- update to latest btrfs-progs + +* Wed Oct 10 2012 Richard W.M. Jones 0.19.20120817git043a639-2 +- Add upstream patch to correct uninitialized fsid variable + (possible fix for RHBZ#863978). + +* Fri Aug 17 2012 Josef Bacik 0.19.20120817git043a639-1 +- update to latest btrfs-progs + +* Wed Jul 18 2012 Fedora Release Engineering - 0.19-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Apr 25 2012 Josef Bacik 0.19-19 +- make btrfs filesystem show actually work (rhbz# 816293) + +* Wed Apr 11 2012 Josef Bacik 0.19-18 +- updated to latest btrfs-progs + +* Thu Jan 12 2012 Fedora Release Engineering - 0.19-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Aug 05 2011 Josef Bacik 0.19-16 +- fix build-everything patch to actually build everything + +* Fri Aug 05 2011 Josef Bacik 0.19-15 +- actually build btrfs-zero-log + +* Thu Aug 04 2011 Josef Bacik 0.19-14 +- bring btrfs-progs uptodate with upstream + +* Mon Feb 07 2011 Fedora Release Engineering - 0.19-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Aug 20 2010 Adam Tkac 0.19-12 +- rebuild to ensure F14 has bigger NVR than F13 + +* Wed Mar 24 2010 Josef Bacik 0.19-11 +- bring btrfs-progs uptodate with upstream, add btrfs command and other + features. + +* Thu Mar 11 2010 Josef Bacik 0.19-10 +- fix dso linking issue and bring btrfs-progs uptodate with upstream + +* Tue Feb 2 2010 Josef Bacik 0.19-9 +- fix btrfsck so it builds on newer glibcs + +* Tue Feb 2 2010 Josef Bacik 0.19-8 +- fix btrfsctl to return 0 on success and 1 on failure + +* Tue Aug 25 2009 Josef Bacik 0.19-7 +- add btrfs-progs-valgrind.patch to fix memory leaks and segfaults + +* Fri Jul 24 2009 Fedora Release Engineering - 0.19-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Jul 15 2009 Josef Bacik 0.19-5 +- add e2fsprogs-devel back to BuildRequires since its needed for the converter + +* Wed Jul 15 2009 Josef Bacik 0.19-4 +- change BuildRequires for e2fsprogs-devel to libuuid-devel + +* Fri Jun 19 2009 Josef Bacik 0.19-3 +- added man pages to the files list and made sure they were installed properly + +* Fri Jun 19 2009 Josef Bacik 0.19-2 +- add a patch for the Makefile to make it build everything again + +* Fri Jun 19 2009 Josef Bacik 0.19-1 +- update to v0.19 of btrfs-progs for new format + +* Mon Feb 23 2009 Fedora Release Engineering - 0.18-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Jan 22 2009 Josef Bacik 0.18-3 +- updated label patch + +* Thu Jan 22 2009 Josef Bacik 0.18-2 +- add a patch to handle having /'s in labels + +* Sat Jan 17 2009 Josef Bacik 0.18-1 +- updated to 0.18 because of the ioctl change in 2.6.29-rc2 + +* Fri Jan 16 2009 Marek Mahut 0.17-4 +- RHBZ#480219 btrfs-convert is missing + +* Mon Jan 12 2009 Josef Bacik 0.17-2 +- fixed wrong sources upload + +* Mon Jan 12 2009 Josef Bacik 0.17 +- Upstream release 0.17 + +* Sat Jan 10 2009 Kyle McMartin 0.16.git1-1 +- Upstream git sync from -g72359e8 (needed for kernel...) + +* Sat Jan 10 2009 Marek Mahut 0.16-1 +- Upstream release 0.16 + +* Wed Jun 25 2008 Josef Bacik 0.15-4 +-use fedoras normal CFLAGS + +* Mon Jun 23 2008 Josef Bacik 0.15-3 +-Actually defined _root_sbindir +-Fixed the make install line so it would install to the proper dir + +* Mon Jun 23 2008 Josef Bacik 0.15-2 +-Removed a . at the end of the description +-Fixed the copyright to be GPLv2 since GPL doesn't work anymore + +* Mon Jun 23 2008 Josef Bacik 0.15-1 +-Initial build