Accepting request 236055 from home:dsterba:branches:filesystems

- update to upstream 3.14.2
  - man: separate pages for all subcommands
  - minor bugfixes
  - spec: removed upstreamed patches, update build dependencies
- Added patches:
  * 0001-btrfs-progs-doc-fix-symlink-target-for-btrfsck.8.patch
- Removed patches:
  * 0001-Btrfs-progs-fix-check-to-test-trim-support.patch
  * 0002-Btrfs-progs-fsck-fix-double-free-memory-crash.patch
  * 0003-Btrfs-progs-mkfs-Remove-zero_end-1-since-it-has-been.patch
  * 0004-btrfs-progs-fix-wrong-max-system-array-size-check-in.patch
  * 0005-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch
  * 0009-btrfs-progs-prevent-close_root-if-the-root-to-close-.patch
  * 0010-btrfs-progs-fix-mkfs.btrfs-segfault-with-features-op.patch

OBS-URL: https://build.opensuse.org/request/show/236055
OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=161
This commit is contained in:
David Sterba 2014-06-02 15:01:45 +00:00 committed by Git OBS Bridge
parent 154cf4c193
commit 4b765ed3cf
13 changed files with 72 additions and 382 deletions

View File

@ -1,30 +0,0 @@
From f7025683c14debd0ca3ee21dc64699a185849b35 Mon Sep 17 00:00:00 2001
From: Rakesh Pandit <rakesh@tuxera.com>
Date: Tue, 22 Apr 2014 16:30:27 +0300
Subject: [PATCH 03/42] Btrfs-progs: fix check to test trim support
It was added in 25d82d22 but broke recently in 4724d7b0 while making
discard interruptible.
Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils.c b/utils.c
index 3e9c527a492c..187ad3b9b12b 100644
--- a/utils.c
+++ b/utils.c
@@ -626,7 +626,7 @@ int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
* is not necessary for the mkfs functionality but just an
* optimization.
*/
- if (discard_blocks(fd, 0, 0) == 0) {
+ if (discard_range(fd, 0, 0) == 0) {
fprintf(stderr, "Performing full device TRIM (%s) ...\n",
pretty_size(block_count));
discard_blocks(fd, 0, block_count);
--
1.9.0

View File

@ -0,0 +1,29 @@
From 1982864ee7028c36be8636d1fb2e4e679ee66bed Mon Sep 17 00:00:00 2001
From: David Sterba <dsterba@suse.cz>
Date: Mon, 5 May 2014 16:54:00 +0200
Subject: [PATCH] btrfs-progs: doc: fix symlink target for btrfsck.8
The manpage of btrfsck.8 is supposed to link to btrfs-check.8 .
Reported-by: WorMzy Tykashi <wormzy.tykashi@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
Documentation/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 45299bb29f9b..2df6af001cbc 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -74,7 +74,7 @@ install: install-man
install-man: man
$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
$(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir)
- $(LNS) btrfs-check.8.gz $(DESTDIR)$(man8dir)
+ $(LNS) btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz
clean:
$(RM) *.xml *.xml+ *.8 *.8.gz
--
1.9.0

View File

@ -1,35 +0,0 @@
From 4c92a4a31b51950d8d0f167a0391586803802f4c Mon Sep 17 00:00:00 2001
From: Rakesh Pandit <rakesh@tuxera.com>
Date: Sun, 20 Apr 2014 16:17:53 +0300
Subject: [PATCH 08/42] Btrfs-progs: fsck: fix double free memory crash
Fix double free of memory if btrfs_open_devices fails:
*** Error in `btrfs': double free or corruption (fasttop): 0x000000000066e020 ***
Crash happened because when open failed on device inside
btrfs_open_devices it freed all memory by calling btrfs_close_devices but
inside disk-io.c we call btrfs_close_again it again.
Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
disk-io.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/disk-io.c b/disk-io.c
index 19b95a724f1b..8db0335bc81b 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -1091,8 +1091,7 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path,
ret = btrfs_open_devices(fs_devices, oflags);
if (ret)
- goto out_devices;
-
+ goto out;
disk_super = fs_info->super_copy;
if (!(flags & OPEN_CTREE_RECOVER_SUPER))
--
1.9.0

View File

@ -1,44 +0,0 @@
From e7cd3d7fa55bb26d9b4579fececc863db6555d97 Mon Sep 17 00:00:00 2001
From: Li Yang <liyang.fnst@cn.fujitsu.com>
Date: Mon, 21 Apr 2014 05:38:08 -0400
Subject: [PATCH 09/42] Btrfs-progs: mkfs: Remove 'zero_end =1' since it has
been set to a value
In utils.c, zero_end is used as a parameter, should not force it to 1.
In mkfs.c, zero_end is set to 1 or 0(-b) at the beginning, should not
force it to 1 unconditionally.
Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
mkfs.c | 1 -
utils.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/mkfs.c b/mkfs.c
index dbd83f5ce168..f2b577922c9e 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1543,7 +1543,6 @@ int main(int ac, char **av)
btrfs_register_one_device(file);
- zero_end = 1;
while (dev_cnt-- > 0) {
int old_mixed = mixed;
diff --git a/utils.c b/utils.c
index 44c0e4ab39f2..29953d9dd2a9 100644
--- a/utils.c
+++ b/utils.c
@@ -613,7 +613,6 @@ int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
}
if (max_block_count)
block_count = min(block_count, max_block_count);
- zero_end = 1;
if (block_count < 1024 * 1024 * 1024 && !(*mixed)) {
printf("SMALL VOLUME: forcing mixed metadata/data groups\n");
--
1.9.0

View File

@ -1,34 +0,0 @@
From b014a6150ebaa97cee780fca184df626c173c30e Mon Sep 17 00:00:00 2001
From: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Date: Mon, 21 Apr 2014 20:13:31 +0800
Subject: [PATCH 10/42] btrfs-progs: fix wrong max system array size check in
user space
For system chunk array,
We copy a "disk_key" and an chunk item each time,
so there should be enough space to hold both of them,
not only the chunk item.
Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
volumes.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/volumes.c b/volumes.c
index 77ffd3252c38..b39f374305bc 100644
--- a/volumes.c
+++ b/volumes.c
@@ -630,7 +630,8 @@ int btrfs_add_system_chunk(struct btrfs_trans_handle *trans,
u8 *ptr;
array_size = btrfs_super_sys_array_size(super_copy);
- if (array_size + item_size > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE)
+ if (array_size + item_size + sizeof(disk_key)
+ > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE)
return -EFBIG;
ptr = super_copy->sys_chunk_array + array_size;
--
1.9.0

View File

@ -1,137 +0,0 @@
From b5230eca8a9214c7290ed818ff9792eb5d3e142b Mon Sep 17 00:00:00 2001
From: David Sterba <dsterba@suse.cz>
Date: Fri, 11 Apr 2014 13:22:50 +0200
Subject: [PATCH 12/42] btrfs-progs: move arg_strtou64 to a separate file for
library
Linking with libbtrfs fails because arg_strtou64 is not defined and we
cannot just add utils.o to library objects because it's not
library-clean.
Reported-by: Arvin Schnell <aschnell@suse.com>
Reported-by: Anton Farygin <rider@altlinux.org>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
Makefile | 5 +++--
utils-lib.c | 42 ++++++++++++++++++++++++++++++++++++++++++
utils.c | 33 ---------------------------------
3 files changed, 45 insertions(+), 35 deletions(-)
create mode 100644 utils-lib.c
diff --git a/Makefile b/Makefile
index 51d53fadf5af..76565e8b2307 100644
--- a/Makefile
+++ b/Makefile
@@ -9,14 +9,15 @@ CFLAGS = -g -O1 -fno-strict-aliasing
objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
root-tree.o dir-item.o file-item.o inode-item.o inode-map.o \
extent-cache.o extent_io.o volumes.o utils.o repair.o \
- qgroup.o raid6.o free-space-cache.o list_sort.o props.o
+ qgroup.o raid6.o free-space-cache.o list_sort.o props.o \
+ utils-lib.o
cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \
cmds-quota.o cmds-qgroup.o cmds-replace.o cmds-check.o \
cmds-restore.o cmds-rescue.o chunk-recover.o super-recover.o \
cmds-property.o
libbtrfs_objects = send-stream.o send-utils.o rbtree.o btrfs-list.o crc32c.o \
- uuid-tree.o
+ uuid-tree.o utils-lib.o
libbtrfs_headers = send-stream.h send-utils.h send.h rbtree.h btrfs-list.h \
crc32c.h list.h kerncompat.h radix-tree.h extent-cache.h \
extent_io.h ioctl.h ctree.h btrfsck.h
diff --git a/utils-lib.c b/utils-lib.c
new file mode 100644
index 000000000000..9d53c6e5c710
--- /dev/null
+++ b/utils-lib.c
@@ -0,0 +1,42 @@
+#define _GNU_SOURCE
+
+#include "kerncompat.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <limits.h>
+
+#if BTRFS_FLAT_INCLUDES
+#else
+#endif /* BTRFS_FLAT_INCLUDES */
+
+/*
+ * This function should be only used when parsing command arg, it won't return
+ * error to its caller and rather exit directly just like usage().
+ */
+u64 arg_strtou64(const char *str)
+{
+ u64 value;
+ char *ptr_parse_end = NULL;
+
+ value = strtoull(str, &ptr_parse_end, 0);
+ if (ptr_parse_end && *ptr_parse_end != '\0') {
+ fprintf(stderr, "ERROR: %s is not a valid numeric value.\n",
+ str);
+ exit(1);
+ }
+
+ /*
+ * if we pass a negative number to strtoull, it will return an
+ * unexpected number to us, so let's do the check ourselves.
+ */
+ if (str[0] == '-') {
+ fprintf(stderr, "ERROR: %s: negative value is invalid.\n",
+ str);
+ exit(1);
+ }
+ if (value == ULLONG_MAX) {
+ fprintf(stderr, "ERROR: %s is too large.\n", str);
+ exit(1);
+ }
+ return value;
+}
diff --git a/utils.c b/utils.c
index 29953d9dd2a9..e130849c7bb5 100644
--- a/utils.c
+++ b/utils.c
@@ -1538,39 +1538,6 @@ scan_again:
return 0;
}
-/*
- * This function should be only used when parsing
- * command arg, it won't return error to it's
- * caller and rather exit directly just like usage().
- */
-u64 arg_strtou64(const char *str)
-{
- u64 value;
- char *ptr_parse_end = NULL;
-
- value = strtoull(str, &ptr_parse_end, 0);
- if (ptr_parse_end && *ptr_parse_end != '\0') {
- fprintf(stderr, "ERROR: %s is not a valid numeric value.\n",
- str);
- exit(1);
- }
- /*
- * if we pass a negative number to strtoull,
- * it will return an unexpected number to us,
- * so let's do the check ourselves.
- */
- if (str[0] == '-') {
- fprintf(stderr, "ERROR: %s: negative value is invalid.\n",
- str);
- exit(1);
- }
- if (value == ULLONG_MAX) {
- fprintf(stderr, "ERROR: %s is too large.\n", str);
- exit(1);
- }
- return value;
-}
-
u64 parse_size(char *s)
{
int i;
--
1.9.0

View File

@ -1,43 +0,0 @@
From 07bb42ca797d78333b0fd47189a6504cd25b28d5 Mon Sep 17 00:00:00 2001
From: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Date: Thu, 24 Apr 2014 11:39:28 +0800
Subject: [PATCH 16/42] btrfs-progs: prevent close_root if the root to close is
potentially NULL
Originally only if 'block_only' is specified, the 'fs_root == NULL'
will be checked. But if 'block_only' is not specified and close_root
will be called blindly without checking 'fs_root == NULL', which is
unsafe.
Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
btrfs-debug-tree.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c
index 8ae7270dc2fe..cb6c1061b329 100644
--- a/btrfs-debug-tree.c
+++ b/btrfs-debug-tree.c
@@ -177,13 +177,14 @@ int main(int ac, char **av)
fprintf(stderr, "unable to open %s\n", av[optind]);
exit(1);
}
+
root = info->fs_root;
+ if (!root) {
+ fprintf(stderr, "unable to open %s\n", av[optind]);
+ exit(1);
+ }
if (block_only) {
- if (!root) {
- fprintf(stderr, "unable to open %s\n", av[optind]);
- exit(1);
- }
leaf = read_tree_block(root,
block_only,
root->leafsize, 0);
--
1.9.0

View File

@ -1,37 +0,0 @@
From 61e0b6eaf4d98ddea540ebbf6b7ad7202ffc6786 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?=
<holger.hoffstaette@googlemail.com>
Date: Sat, 26 Apr 2014 09:41:04 +0000
Subject: [PATCH 19/42] btrfs-progs: fix mkfs.btrfs segfault with --features
option
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The mkfs.btrfs --features long option takes an argument but does not
declare it. Consequently getopt does not allocate an argument, which
makes an unconditional strdup() crash during options parsing.
Fix by declaring the argument in the options alias array.
Signed-off-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
mkfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkfs.c b/mkfs.c
index 4f5ee07e5ef9..16e92221a547 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -350,7 +350,7 @@ static struct option long_options[] = {
{ "version", 0, NULL, 'V' },
{ "rootdir", 1, NULL, 'r' },
{ "nodiscard", 0, NULL, 'K' },
- { "features", 0, NULL, 'O' },
+ { "features", 1, NULL, 'O' },
{ NULL, 0, NULL, 0}
};
--
1.9.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:91b731c9889cdad80d36e6f0345b9dc6fa0e7f98eda5730bfd88947ff4afedb1
size 281329

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ed0530d52ca779c3453ac46fbeb64c59b5500ad909eef0837205aa1796fe880a
size 284230

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Mon Jun 2 14:47:05 UTC 2014 - dsterba@suse.cz
- update to upstream 3.14.2
- man: separate pages for all subcommands
- minor bugfixes
- spec: removed upstreamed patches, update build dependencies
- Added patches:
* 0001-btrfs-progs-doc-fix-symlink-target-for-btrfsck.8.patch
- Removed patches:
* 0001-Btrfs-progs-fix-check-to-test-trim-support.patch
* 0002-Btrfs-progs-fsck-fix-double-free-memory-crash.patch
* 0003-Btrfs-progs-mkfs-Remove-zero_end-1-since-it-has-been.patch
* 0004-btrfs-progs-fix-wrong-max-system-array-size-check-in.patch
* 0005-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch
* 0009-btrfs-progs-prevent-close_root-if-the-root-to-close-.patch
* 0010-btrfs-progs-fix-mkfs.btrfs-segfault-with-features-op.patch
-------------------------------------------------------------------
Wed May 21 19:32:13 UTC 2014 - mfasheh@suse.com

View File

@ -16,9 +16,9 @@
#
%define tar_version v3.14.1
%define tar_version v3.14.2
Name: btrfsprogs
Version: 3.14.1
Version: 3.14.2
Release: 0
Summary: Utilities for the Btrfs filesystem
License: GPL-2.0
@ -31,16 +31,10 @@ Source: btrfs-progs-%{tar_version}.tar.bz2
Source1: boot-btrfs.sh
Source4: setup-btrfs.sh
Patch1: 0001-Btrfs-progs-fix-check-to-test-trim-support.patch
Patch2: 0002-Btrfs-progs-fsck-fix-double-free-memory-crash.patch
Patch3: 0003-Btrfs-progs-mkfs-Remove-zero_end-1-since-it-has-been.patch
Patch4: 0004-btrfs-progs-fix-wrong-max-system-array-size-check-in.patch
Patch5: 0005-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch
Patch1: 0001-btrfs-progs-doc-fix-symlink-target-for-btrfsck.8.patch
Patch6: 0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.patch
Patch7: 0007-Btrfs-progs-fsck-avoid-pinning-same-block-several-ti.patch
Patch8: 0008-Btrfs-progs-fsck-add-ability-to-check-reloc-roots.patch
Patch9: 0009-btrfs-progs-prevent-close_root-if-the-root-to-close-.patch
Patch10: 0010-btrfs-progs-fix-mkfs.btrfs-segfault-with-features-op.patch
Patch11: 0011-btrfs-progs-Enhance-the-command-btrfs-filesystem-df.patch
Patch12: 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch
Patch13: 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch
@ -75,6 +69,7 @@ Patch201: 0201-btrfs-progs-import-ulist.patch
Patch202: 0202-btrfs-progs-add-quota-group-verify-code.patch
Patch1000: local-version-override.patch
BuildRequires: asciidoc
BuildRequires: libacl-devel
BuildRequires: libattr-devel
BuildRequires: libblkid-devel
@ -82,9 +77,8 @@ BuildRequires: libext2fs-devel
BuildRequires: libuuid-devel
BuildRequires: lzo-devel
BuildRequires: udev
BuildRequires: xmlto
BuildRequires: zlib-devel
# for /bin/true
Requires: coreutils
Supplements: filesystem(btrfs)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -112,15 +106,9 @@ build applications to interface with btrfs.
%prep
%setup -q -n btrfs-progs-%{tar_version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
@ -245,6 +233,21 @@ rm -f %{buildroot}/%{_libdir}/*.a
%{_mandir}/man8/btrfs-show-super.8.gz
%{_mandir}/man8/btrfs-zero-log.8.gz
%{_mandir}/man8/btrfstune.8.gz
%{_mandir}/man8/btrfs-balance.8.gz
%{_mandir}/man8/btrfs-check.8.gz
%{_mandir}/man8/btrfs-device.8.gz
%{_mandir}/man8/btrfs-filesystem.8.gz
%{_mandir}/man8/btrfs-inspect-internal.8.gz
%{_mandir}/man8/btrfs-property.8.gz
%{_mandir}/man8/btrfs-qgroup.8.gz
%{_mandir}/man8/btrfs-quota.8.gz
%{_mandir}/man8/btrfs-receive.8.gz
%{_mandir}/man8/btrfs-replace.8.gz
%{_mandir}/man8/btrfs-rescue.8.gz
%{_mandir}/man8/btrfs-restore.8.gz
%{_mandir}/man8/btrfs-scrub.8.gz
%{_mandir}/man8/btrfs-send.8.gz
%{_mandir}/man8/btrfs-subvolume.8.gz
%files -n libbtrfs0
%defattr(-, root, root)

View File

@ -6,8 +6,8 @@ Index: btrfs-progs-v0.19-116-g13eced9/version.sh
# Copyright 2008, Oracle
# Released under the GNU GPLv2
-v="v3.14.1"
+v="v3.14.1+20140502"
-v="v3.14.2"
+v="v3.14.2+20140530"
which git &> /dev/null
if [ $? == 0 -a -d .git ]; then