Compare commits

...

21 Commits
rawhide ... f20

Author SHA1 Message Date
Eric Sandeen 1c175bb850 New upstream release v4.1 2015-06-23 10:10:28 -05:00
Eric Sandeen bcf101ec43 New upstream version v4.0 2015-04-29 16:40:14 -05:00
Eric Sandeen 176c38495f New upstream version v3.19.1 2015-03-26 13:35:08 -05:00
Eric Sandeen 7f36d225aa New upstream release v3.19 2015-03-11 16:35:34 -05:00
Eric Sandeen 769d1c33cd New upstream release v3.18.2 2015-01-28 01:39:33 -06:00
Eric Sandeen 804da4b72e New upstream version v3.18.1 2015-01-12 14:07:48 -06:00
Eric Sandeen d956f2bfd1 New upstream release v3.18 2015-01-02 10:29:30 -06:00
Eric Sandeen c812a705ca New upstream release v3.18 2015-01-02 10:28:47 -06:00
Eric Sandeen 15b4e047a5 New upstream version v3.17.3 2014-12-05 02:31:03 -06:00
Eric Sandeen d349fb2276 New upstream version v3.17.2 2014-11-20 15:57:17 -06:00
Eric Sandeen 00cf24800c New upstream version v3.17 2014-10-20 14:02:25 -05:00
Eric Sandeen fcd46e68b8 New upstream release v3.16.2 2014-10-03 11:14:28 -05:00
Eric Sandeen 3ddbe3db9c New upstream version v3.16 2014-08-27 12:09:50 -05:00
Eric Sandeen 4d6e6464a2 Allow specification of UUID at mkfs time 2014-06-16 18:40:03 -05:00
Eric Sandeen f88aadb72c New upstream version v3.14.2 2014-05-30 12:56:14 -05:00
Eric Sandeen 18fc9deb16 New upstream version v3.14.1 2014-04-22 13:53:02 -05:00
Eric Sandeen e8f2b2a235 New upstream release v3.14 2014-04-16 09:41:58 -05:00
Eric Sandeen a05d6ee266 And, the sources ... 2013-11-25 19:52:21 -06:00
Eric Sandeen d1f9b7a447 New upstream release v3.12 2013-11-25 19:45:05 -06:00
Eric Sandeen d98d6ddbd3 New upstream snapshot in prep for release 2013-11-14 12:43:41 -06:00
Eric Sandeen 3344acee03 new upstream snapshot 2013-09-17 17:27:41 -05:00
6 changed files with 333 additions and 40 deletions

15
.gitignore vendored
View File

@ -14,3 +14,18 @@ mkfs.btrfs
repair
restore
/btrfs-progs-*.tar.bz2
/btrfs-progs-v3.14.tar.xz
/btrfs-progs-v3.14.1.tar.xz
/btrfs-progs-v3.14.2.tar.xz
/btrfs-progs-v3.16.tar.xz
/btrfs-progs-v3.16.2.tar.xz
/btrfs-progs-v3.17.tar.xz
/btrfs-progs-v3.17.2.tar.xz
/btrfs-progs-v3.17.3.tar.xz
/btrfs-progs-v3.18.tar.xz
/btrfs-progs-v3.18.1.tar.xz
/btrfs-progs-v3.18.2.tar.xz
/btrfs-progs-v3.19.tar.xz
/btrfs-progs-v3.19.1.tar.xz
/btrfs-progs-v4.0.tar.xz
/btrfs-progs-v4.1.tar.xz

View File

@ -9,19 +9,20 @@ Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 9c195b3..d2c2e28 100644
index da7438e..0446836 100644
--- a/Makefile
+++ b/Makefile
@@ -93,7 +93,7 @@ version.h:
@@ -100,7 +100,7 @@ version.h:
$(libs_shared): $(libbtrfs_objects) $(lib_links) send.h
@echo " [LD] $@"
- $(Q)$(CC) $(CFLAGS) $(libbtrfs_objects) $(lib_LIBS) -shared -Wl,-soname,libbtrfs.so -o libbtrfs.so.0.1
+ $(Q)$(CC) $(CFLAGS) $(libbtrfs_objects) $(lib_LIBS) -shared -Wl,-soname,libbtrfs.so.0 -o libbtrfs.so.0.1
$(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] $@"
--
1.8.1.4

View File

@ -2,15 +2,6 @@ diff --git a/utils.c b/utils.c
index a5ffb62..f6686c6 100644
--- a/utils.c
+++ b/utils.c
@@ -476,7 +476,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
u64 num_devs;
int ret;
- device = kmalloc(sizeof(*device), GFP_NOFS);
+ device = kzalloc(sizeof(*device), GFP_NOFS);
if (!device)
return -ENOMEM;
buf = kmalloc(sectorsize, GFP_NOFS);
@@ -502,6 +502,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
device->bytes_used = 0;
device->total_ios = 0;

View File

@ -0,0 +1,221 @@
From: Eric Sandeen <sandeen@redhat.com>
Date: Wed, 14 May 2014 17:39:07 +0000 (-0500)
Subject: btrfs-progs: mkfs: allow UUID specification at mkfs time
X-Git-Url: http://repo.or.cz/w/btrfs-progs-unstable/devel.git/commitdiff_plain/a03901849f868c65f845325fcaeb3d25c6896759
btrfs-progs: mkfs: allow UUID specification at mkfs time
Allow the specification of the filesystem UUID at mkfs time.
Non-unique unique IDs are rejected. This includes attempting
to re-mkfs with the same UUID; if you really want to do that,
you can mkfs with a new UUID, then re-mkfs with the one you
wanted.
(Implemented only for mkfs.btrfs, not btrfs-convert).
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
[converted help to asciidoc]
Signed-off-by: David Sterba <dsterba@suse.cz>
---
Index: btrfs-progs-v3.14.2/Documentation/mkfs.btrfs.txt
===================================================================
--- btrfs-progs-v3.14.2.orig/Documentation/mkfs.btrfs.txt
+++ btrfs-progs-v3.14.2/Documentation/mkfs.btrfs.txt
@@ -21,6 +21,7 @@ $$[-s|--sectorsize <sectorsize>]$$
$$[-r|--rootdir <rootdir>]$$
$$[-K|--nodiscard]$$
$$[-O|--features <feature1>[,<feature2>...]]$$
+$$[-U|--uuid <UUID>]$$
$$[-h]$$
$$[-V|--version]$$
$$<device> [<device>...]$$
@@ -109,6 +110,10 @@ supported by old kernels.
To see all features run::::
mkfs.btrfs -O list-all
+-U|--uuid <UUID>::
+Create the filesystem with the specified UUID, which must not already exist on
+the system.
+
-V|--version::
Print the *mkfs.btrfs* version and exit.
Index: btrfs-progs-v3.14.2/btrfs-convert.c
===================================================================
--- btrfs-progs-v3.14.2.orig/btrfs-convert.c
+++ btrfs-progs-v3.14.2/btrfs-convert.c
@@ -2240,7 +2240,7 @@ static int do_convert(const char *devnam
goto fail;
}
ret = make_btrfs(fd, devname, ext2_fs->super->s_volume_name,
- blocks, total_bytes, blocksize, blocksize,
+ NULL, blocks, total_bytes, blocksize, blocksize,
blocksize, blocksize, 0);
if (ret) {
fprintf(stderr, "unable to create initial ctree: %s\n",
Index: btrfs-progs-v3.14.2/mkfs.c
===================================================================
--- btrfs-progs-v3.14.2.orig/mkfs.c
+++ btrfs-progs-v3.14.2/mkfs.c
@@ -288,6 +288,7 @@ static void print_usage(void)
fprintf(stderr, "\t -r --rootdir the source directory\n");
fprintf(stderr, "\t -K --nodiscard do not perform whole device TRIM\n");
fprintf(stderr, "\t -O --features comma separated list of filesystem features\n");
+ fprintf(stderr, "\t -U --uuid specify the filesystem UUID\n");
fprintf(stderr, "\t -V --version print the mkfs.btrfs version and exit\n");
fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
exit(1);
@@ -351,6 +352,7 @@ static struct option long_options[] = {
{ "rootdir", 1, NULL, 'r' },
{ "nodiscard", 0, NULL, 'K' },
{ "features", 1, NULL, 'O' },
+ { "uuid", 0, NULL, 'U' },
{ NULL, 0, NULL, 0}
};
@@ -1273,11 +1275,12 @@ int main(int ac, char **av)
int dev_cnt = 0;
int saved_optind;
char estr[100];
+ char *fs_uuid = NULL;
u64 features = DEFAULT_MKFS_FEATURES;
while(1) {
int c;
- c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:O:r:VMK",
+ c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:O:r:U:VMK",
long_options, &option_index);
if (c < 0)
break;
@@ -1346,6 +1349,9 @@ int main(int ac, char **av)
source_dir = optarg;
source_dir_set = 1;
break;
+ case 'U':
+ fs_uuid = optarg;
+ break;
case 'K':
discard = 0;
break;
@@ -1368,6 +1374,20 @@ int main(int ac, char **av)
"The -r option is limited to a single device\n");
exit(1);
}
+
+ if (fs_uuid) {
+ uuid_t dummy_uuid;
+
+ if (uuid_parse(fs_uuid, dummy_uuid) != 0) {
+ fprintf(stderr, "could not parse UUID: %s\n", fs_uuid);
+ exit(1);
+ }
+ if (!test_uuid_unique(fs_uuid)) {
+ fprintf(stderr, "non-unique UUID: %s\n", fs_uuid);
+ exit(1);
+ }
+ }
+
while (dev_cnt-- > 0) {
file = av[optind++];
if (is_block_device(file))
@@ -1514,7 +1534,7 @@ int main(int ac, char **av)
process_fs_features(features);
- ret = make_btrfs(fd, file, label, blocks, dev_block_count,
+ ret = make_btrfs(fd, file, label, fs_uuid, blocks, dev_block_count,
nodesize, leafsize,
sectorsize, stripesize, features);
if (ret) {
Index: btrfs-progs-v3.14.2/utils.c
===================================================================
--- btrfs-progs-v3.14.2.orig/utils.c
+++ btrfs-progs-v3.14.2/utils.c
@@ -93,12 +93,41 @@ static u64 reference_root_table[] = {
[6] = BTRFS_CSUM_TREE_OBJECTID,
};
-int make_btrfs(int fd, const char *device, const char *label,
+int test_uuid_unique(char *fs_uuid)
+{
+ int unique = 1;
+ blkid_dev_iterate iter = NULL;
+ blkid_dev dev = NULL;
+ blkid_cache cache = NULL;
+
+ if (blkid_get_cache(&cache, 0) < 0) {
+ printf("ERROR: lblkid cache get failed\n");
+ return 1;
+ }
+ blkid_probe_all(cache);
+ iter = blkid_dev_iterate_begin(cache);
+ blkid_dev_set_search(iter, "UUID", fs_uuid);
+
+ while (blkid_dev_next(iter, &dev) == 0) {
+ dev = blkid_verify(cache, dev);
+ if (dev) {
+ unique = 0;
+ break;
+ }
+ }
+
+ blkid_dev_iterate_end(iter);
+ blkid_put_cache(cache);
+
+ return unique;
+}
+
+int make_btrfs(int fd, const char *device, const char *label, char *fs_uuid,
u64 blocks[7], u64 num_bytes, u32 nodesize,
u32 leafsize, u32 sectorsize, u32 stripesize, u64 features)
{
struct btrfs_super_block super;
- struct extent_buffer *buf;
+ struct extent_buffer *buf = NULL;
struct btrfs_root_item root_item;
struct btrfs_disk_key disk_key;
struct btrfs_extent_item *extent_item;
@@ -125,7 +154,20 @@ int make_btrfs(int fd, const char *devic
memset(&super, 0, sizeof(super));
num_bytes = (num_bytes / sectorsize) * sectorsize;
- uuid_generate(super.fsid);
+ if (fs_uuid) {
+ if (uuid_parse(fs_uuid, super.fsid) != 0) {
+ fprintf(stderr, "could not parse UUID: %s\n", fs_uuid);
+ ret = -EINVAL;
+ goto out;
+ }
+ if (!test_uuid_unique(fs_uuid)) {
+ fprintf(stderr, "non-unique UUID: %s\n", fs_uuid);
+ ret = -EBUSY;
+ goto out;
+ }
+ } else {
+ uuid_generate(super.fsid);
+ }
uuid_generate(super.dev_item.uuid);
uuid_generate(chunk_tree_uuid);
Index: btrfs-progs-v3.14.2/utils.h
===================================================================
--- btrfs-progs-v3.14.2.orig/utils.h
+++ btrfs-progs-v3.14.2/utils.h
@@ -40,7 +40,7 @@
#define BTRFS_UUID_UNPARSED_SIZE 37
int make_btrfs(int fd, const char *device, const char *label,
- u64 blocks[6], u64 num_bytes, u32 nodesize,
+ char *fs_uuid, u64 blocks[6], u64 num_bytes, u32 nodesize,
u32 leafsize, u32 sectorsize, u32 stripesize, u64 features);
int btrfs_make_root_dir(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 objectid);
@@ -101,5 +101,5 @@ int get_btrfs_mount(const char *dev, cha
int find_mount_root(const char *path, char **mount_root);
int get_device_info(int fd, u64 devid,
struct btrfs_ioctl_dev_info_args *di_args);
-
+int test_uuid_unique(char *fs_uuid);
#endif

View File

@ -1,27 +1,24 @@
Name: btrfs-progs
Version: 0.20.rc1.20130501git7854c8b
Release: 4%{?dist}
Version: 4.1
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
Source0: https://www.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version}.tar.xz
# Valgrind patch no longer applied, but kept for posterity
# Patches 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: autoconf, automake
BuildRequires: e2fsprogs-devel, libuuid-devel, zlib-devel
BuildRequires: libacl-devel, libblkid-devel, lzo-devel
BuildRequires: asciidoc, xmlto
%define _root_sbindir /sbin
@ -42,13 +39,12 @@ You should install btrfs-progs-devel if you want to develop
btrfs filesystem-specific programs.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%setup -q -n %{name}-v%{version}
%build
make CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %{?_smp_mflags}
./autogen.sh
%configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
@ -63,32 +59,101 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/libbtrfs.so.0*
%{_sbindir}/btrfsctl
%{_sbindir}/btrfsck
%{_sbindir}/fsck.btrfs
%{_sbindir}/mkfs.btrfs
%{_sbindir}/btrfs-debug-tree
%{_sbindir}/btrfs-image
%{_sbindir}/btrfs-show
%{_sbindir}/btrfs-vol
%{_sbindir}/btrfs-convert
%{_sbindir}/btrfs-select-super
%{_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/btrfs-show.8.gz
%{_mandir}/man8/btrfsck.8.gz
%{_mandir}/man8/btrfsctl.8.gz
%{_mandir}/man8/mkfs.btrfs.8.gz
%{_mandir}/man8/btrfs.8.gz
%{_mandir}/man5/*.gz
%{_mandir}/man8/*.gz
%files devel
%{_includedir}/*
%{_libdir}/libbtrfs.so
%changelog
* Mon Jun 22 2015 Eric Sandeen <sandeen@redhat.com> 4.1-1
- New upstream release
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Wed May 20 2015 Eric Sandeen <sandeen@redhat.com> 4.0.1-1
- New upstream release
* Wed Apr 29 2015 Eric Sandeen <sandeen@redhat.com> 4.0-1
- New upstream release
* Thu Mar 26 2015 Eric Sandeen <sandeen@redhat.com> 3.19.1-1
- New upstream release
* Wed Mar 11 2015 Eric Sandeen <sandeen@redhat.com> 3.19-1
- New upstream release
* Tue Jan 27 2015 Eric Sandeen <sandeen@redhat.com> 3.18.2-1
- New upstream release
* Mon Jan 12 2015 Eric Sandeen <sandeen@redhat.com> 3.18.1-1
- New upstream release
* Fri Jan 02 2015 Eric Sandeen <sandeen@redhat.com> 3.18-1
- New upstream release
* Fri Dec 05 2014 Eric Sandeen <sandeen@redhat.com> 3.17.3-1
- New upstream release
* Fri Nov 21 2014 Eric Sandeen <sandeen@redhat.com> 3.17.2-1
- New upstream release
* Mon Oct 20 2014 Eric Sandeen <sandeen@redhat.com> 3.17-1
- New upstream release
* Fri Oct 03 2014 Eric Sandeen <sandeen@redhat.com> 3.16.2-1
- New upstream release
- Update upstream source location
* Wed Aug 27 2014 Eric Sandeen <sandeen@redhat.com> 3.16-1
- New upstream release
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.14.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Mon Jun 16 2014 Eric Sandeen <sandeen@redhat.com> 3.14.2-3
- Support specification of UUID at mkfs time (#1094857)
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.14.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri May 30 2014 Eric Sandeen <sandeen@redhat.com> 3.14.2-1
- New upstream release
* Tue Apr 22 2014 Eric Sandeen <sandeen@redhat.com> 3.14.1-1
- New upstream release
* Wed Apr 16 2014 Eric Sandeen <sandeen@redhat.com> 3.14-1
- New upstream release
* Mon Jan 20 2014 Eric Sandeen <sandeen@redhat.com> 3.12-2
- Add proper Source0 URL, switch to .xz
* Mon Nov 25 2013 Eric Sandeen <sandeen@redhat.com> 3.12-1
- It's a new upstream release!
* Thu Nov 14 2013 Eric Sandeen <sandeen@redhat.com> 0.20.rc1.20131114git9f0c53f-1
- New upstream snapshot
* Tue Sep 17 2013 Eric Sandeen <sandeen@redhat.com> 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 <rel-eng@lists.fedoraproject.org> - 0.20.rc1.20130501git7854c8b-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

View File

@ -1 +1 @@
369a2c8bbda6cd2e34240b96c357ab01 btrfs-progs-0.20.rc1.20130501git7854c8b.tar.bz2
ff451f4a40ec0c1bdecf3224465a3376 btrfs-progs-v4.1.tar.xz