Accepting request 237294 from filesystems

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/237294
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/btrfsprogs?expand=0&rev=42
This commit is contained in:
Stephan Kulow 2014-06-18 05:50:19 +00:00 committed by Git OBS Bridge
parent 6c4a157a2f
commit e2a69f7e65
16 changed files with 592 additions and 484 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,93 +0,0 @@
From 1e9e1d5c876a4c281b3b9e72f4cbaaef1e3a2fa5 Mon Sep 17 00:00:00 2001
From: David Marcin <djmarcin@google.com>
Date: Mon, 21 Nov 2011 20:51:15 -0600
Subject: [PATCH 170/170] btrfs-progs: In find-root, dump bytenr for every
slot.
Signed-off-by: David Marcin <djmarcin@google.com>
---
btrfs-find-root.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 59 insertions(+), 1 deletion(-)
diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index ffbdde1..00b10e7 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -127,8 +127,63 @@ out:
return NULL;
}
+static int dump_root_bytenr(struct btrfs_root *root, u64 bytenr, u64 gen)
+{
+ struct btrfs_root *tmp = malloc(sizeof(struct btrfs_root));
+ struct btrfs_path *path;
+ struct btrfs_key key;
+ struct btrfs_root_item ri;
+ struct extent_buffer *leaf;
+ struct btrfs_disk_key disk_key;
+ struct btrfs_key found_key;
+ int slot;
+ int ret;
+
+ if (!tmp)
+ return -ENOMEM;
+
+ __setup_root(4096, 4096, 4096, 4096, tmp,
+ root->fs_info, BTRFS_ROOT_TREE_OBJECTID);
+
+ tmp->node = read_tree_block(root, bytenr, 4096, gen);
+
+ key.objectid = 0;
+ key.type = BTRFS_ROOT_ITEM_KEY;
+ key.offset = -1;
+
+ path = btrfs_alloc_path();
+
+ /* Walk the slots of this root looking for BTRFS_ROOT_ITEM_KEYs. */
+ ret = btrfs_search_slot(NULL, tmp, &key, path, 0, 0);
+ BUG_ON(ret < 0);
+ while (1) {
+ leaf = path->nodes[0];
+ slot = path->slots[0];
+ if (slot >= btrfs_header_nritems(leaf)) {
+ ret = btrfs_next_leaf(tmp, path);
+ if (ret != 0)
+ break;
+ leaf = path->nodes[0];
+ slot = path->slots[0];
+ }
+ btrfs_item_key(leaf, &disk_key, path->slots[0]);
+ btrfs_disk_key_to_cpu(&found_key, &disk_key);
+ if (btrfs_key_type(&found_key) == BTRFS_ROOT_ITEM_KEY) {
+ unsigned long offset;
+
+ offset = btrfs_item_ptr_offset(leaf, slot);
+ read_extent_buffer(leaf, &ri, offset, sizeof(ri));
+ printf("Generation: %Lu Root bytenr: %Lu\n", gen, btrfs_root_bytenr(&ri));
+ }
+ path->slots[0]++;
+ }
+ btrfs_free_path(path);
+ free_extent_buffer(leaf);
+ return 0;
+}
+
static int search_iobuf(struct btrfs_root *root, void *iobuf,
- size_t iobuf_size, off_t offset)
+ size_t iobuf_size, off_t offset)
{
u64 gen = search_generation;
u64 objectid = search_objectid;
@@ -160,6 +215,9 @@ static int search_iobuf(struct btrfs_root *root, void *iobuf,
h_byte);
goto next;
}
+ /* Found some kind of root and it's fairly valid. */
+ if (dump_root_bytenr(root, h_byte, h_gen))
+ break;
if (h_gen != gen) {
fprintf(stderr, "Well block %Lu seems great, "
"but generation doesn't match, "
--
1.8.3.1

View File

@ -0,0 +1,182 @@
From d4a4b24f0466b6559d54da3864538afb07188836 Mon Sep 17 00:00:00 2001
From: David Sterba <dsterba@suse.cz>
Date: Wed, 28 May 2014 11:25:24 +0200
Subject: [PATCH] btrfs-progs: make free space checker work on non-4k
sectorsize filesystems
The value of sector for space cache was hardcoded to 4k, and used to
calculate bitmap sizes. In kernel, the BITS_PER_BITMAP is derived from
PAGE_CACHE_SIZE which is not available for userspace, that can also deal
with filesystem of varying sectorsize.
Signed-off-by: David Sterba <dsterba@suse.cz>
---
free-space-cache.c | 39 ++++++++++++++++++++++++---------------
free-space-cache.h | 1 +
2 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/free-space-cache.c b/free-space-cache.c
index bddde2403723..b705f1b8208e 100644
--- a/free-space-cache.c
+++ b/free-space-cache.c
@@ -25,8 +25,12 @@
#include "crc32c.h"
#include "bitops.h"
-#define CACHE_SECTORSIZE 4096
-#define BITS_PER_BITMAP (CACHE_SECTORSIZE * 8)
+/*
+ * Kernel always uses PAGE_CACHE_SIZE for sectorsize, but we don't have
+ * anything like that in userspace and have to get the value from the
+ * filesystem
+ */
+#define BITS_PER_BITMAP(sectorsize) ((sectorsize) * 8)
#define MAX_CACHE_BYTES_PER_GIG (32 * 1024)
static int link_free_space(struct btrfs_free_space_ctl *ctl,
@@ -48,7 +52,7 @@ static int io_ctl_init(struct io_ctl *io_ctl, u64 size, u64 ino,
struct btrfs_root *root)
{
memset(io_ctl, 0, sizeof(struct io_ctl));
- io_ctl->num_pages = (size + CACHE_SECTORSIZE - 1) / CACHE_SECTORSIZE;
+ io_ctl->num_pages = (size + root->sectorsize - 1) / root->sectorsize;
io_ctl->buffer = kzalloc(size, GFP_NOFS);
if (!io_ctl->buffer)
return -ENOMEM;
@@ -75,11 +79,11 @@ static void io_ctl_unmap_page(struct io_ctl *io_ctl)
static void io_ctl_map_page(struct io_ctl *io_ctl, int clear)
{
BUG_ON(io_ctl->index >= io_ctl->num_pages);
- io_ctl->cur = io_ctl->buffer + (io_ctl->index++ * CACHE_SECTORSIZE);
+ io_ctl->cur = io_ctl->buffer + (io_ctl->index++ * io_ctl->root->sectorsize);
io_ctl->orig = io_ctl->cur;
- io_ctl->size = CACHE_SECTORSIZE;
+ io_ctl->size = io_ctl->root->sectorsize;
if (clear)
- memset(io_ctl->cur, 0, CACHE_SECTORSIZE);
+ memset(io_ctl->cur, 0, io_ctl->root->sectorsize);
}
static void io_ctl_drop_pages(struct io_ctl *io_ctl)
@@ -203,7 +207,7 @@ static int io_ctl_check_crc(struct io_ctl *io_ctl, int index)
val = *tmp;
io_ctl_map_page(io_ctl, 0);
- crc = crc32c(crc, io_ctl->orig + offset, CACHE_SECTORSIZE - offset);
+ crc = crc32c(crc, io_ctl->orig + offset, io_ctl->root->sectorsize - offset);
btrfs_csum_final(crc, (char *)&crc);
if (val != crc) {
printk("btrfs: csum mismatch on free space cache\n");
@@ -250,7 +254,7 @@ static int io_ctl_read_bitmap(struct io_ctl *io_ctl,
if (ret)
return ret;
- memcpy(entry->bitmap, io_ctl->cur, CACHE_SECTORSIZE);
+ memcpy(entry->bitmap, io_ctl->cur, io_ctl->root->sectorsize);
io_ctl_unmap_page(io_ctl);
return 0;
@@ -371,7 +375,7 @@ static int __load_free_space_cache(struct btrfs_root *root,
} else {
BUG_ON(!num_bitmaps);
num_bitmaps--;
- e->bitmap = kzalloc(CACHE_SECTORSIZE, GFP_NOFS);
+ e->bitmap = kzalloc(ctl->sectorsize, GFP_NOFS);
if (!e->bitmap) {
free(e);
goto free_cache;
@@ -458,8 +462,9 @@ static inline u64 offset_to_bitmap(struct btrfs_free_space_ctl *ctl,
{
u64 bitmap_start;
u64 bytes_per_bitmap;
+ u32 sectorsize = ctl->sectorsize;
- bytes_per_bitmap = BITS_PER_BITMAP * ctl->unit;
+ bytes_per_bitmap = BITS_PER_BITMAP(sectorsize) * ctl->unit;
bitmap_start = offset - ctl->start;
bitmap_start = bitmap_start / bytes_per_bitmap;
bitmap_start *= bytes_per_bitmap;
@@ -528,6 +533,7 @@ tree_search_offset(struct btrfs_free_space_ctl *ctl,
{
struct rb_node *n = ctl->free_space_offset.rb_node;
struct btrfs_free_space *entry, *prev = NULL;
+ u32 sectorsize = ctl->sectorsize;
/* find entry that is closest to the 'offset' */
while (1) {
@@ -612,7 +618,7 @@ tree_search_offset(struct btrfs_free_space_ctl *ctl,
prev->offset + prev->bytes > offset)
return prev;
}
- if (entry->offset + BITS_PER_BITMAP * ctl->unit > offset)
+ if (entry->offset + BITS_PER_BITMAP(sectorsize) * ctl->unit > offset)
return entry;
} else if (entry->offset + entry->bytes > offset)
return entry;
@@ -622,7 +628,7 @@ tree_search_offset(struct btrfs_free_space_ctl *ctl,
while (1) {
if (entry->bitmap) {
- if (entry->offset + BITS_PER_BITMAP *
+ if (entry->offset + BITS_PER_BITMAP(sectorsize) *
ctl->unit > offset)
break;
} else {
@@ -669,14 +675,15 @@ static int search_bitmap(struct btrfs_free_space_ctl *ctl,
unsigned long found_bits = 0;
unsigned long bits, i;
unsigned long next_zero;
+ u32 sectorsize = ctl->sectorsize;
i = offset_to_bit(bitmap_info->offset, ctl->unit,
max_t(u64, *offset, bitmap_info->offset));
bits = bytes_to_bits(*bytes, ctl->unit);
- for_each_set_bit_from(i, bitmap_info->bitmap, BITS_PER_BITMAP) {
+ for_each_set_bit_from(i, bitmap_info->bitmap, BITS_PER_BITMAP(sectorsize)) {
next_zero = find_next_zero_bit(bitmap_info->bitmap,
- BITS_PER_BITMAP, i);
+ BITS_PER_BITMAP(sectorsize), i);
if ((next_zero - i) >= bits) {
found_bits = next_zero - i;
break;
@@ -763,6 +770,7 @@ int btrfs_init_free_space_ctl(struct btrfs_block_group_cache *block_group,
if (!ctl)
return -ENOMEM;
+ ctl->sectorsize = sectorsize;
ctl->unit = sectorsize;
ctl->start = block_group->key.objectid;
ctl->private = block_group;
@@ -823,6 +831,7 @@ static void merge_space_tree(struct btrfs_free_space_ctl *ctl)
struct btrfs_free_space *e, *prev = NULL;
struct rb_node *n;
int ret;
+ u32 sectorsize = ctl->sectorsize;
again:
prev = NULL;
@@ -832,7 +841,7 @@ again:
u64 offset = e->offset, bytes = ctl->unit;
u64 end;
- end = e->offset + (u64)(BITS_PER_BITMAP * ctl->unit);
+ end = e->offset + (u64)(BITS_PER_BITMAP(sectorsize) * ctl->unit);
unlink_free_space(ctl, e);
while (!(search_bitmap(ctl, e, &offset, &bytes))) {
diff --git a/free-space-cache.h b/free-space-cache.h
index d28625867f76..ec213da66ccf 100644
--- a/free-space-cache.h
+++ b/free-space-cache.h
@@ -36,6 +36,7 @@ struct btrfs_free_space_ctl {
int unit;
u64 start;
void *private;
+ u32 sectorsize;
};
int load_free_space_cache(struct btrfs_fs_info *fs_info,
--
1.9.0

View File

@ -0,0 +1,292 @@
From: Jeff Mahoney <jeffm@suse.com>
Subject: btrfs-progs: canonicalize pathnames for device commands
References: bnc#880486
Patch-mainline: Submitted to linux-btrfs, 4 Jun 2014
mount(8) will canonicalize pathnames before passing them to the kernel.
Links to e.g. /dev/sda will be resolved to /dev/sda. Links to /dev/dm-#
will be resolved using the name of the device mapper table to
/dev/mapper/<name>.
Btrfs will use whatever name the user passes to it, regardless of whether
it is canonical or not. That means that if a 'btrfs device ready' is
issued on any device node pointing to the original device, it will adopt
the new name instead of the name that was used during mount.
Mounting using /dev/sdb2 will result in df:
/dev/sdb2 209715200 39328 207577088 1% /mnt
# ls -la /dev/whatever-i-like
lrwxrwxrwx 1 root root 4 Jun 4 13:36 /dev/whatever-i-like -> sdb2
# btrfs dev ready /dev/whatever-i-like
# df /mnt
/dev/whatever-i-like 209715200 39328 207577088 1% /mnt
Likewise, mounting with /dev/mapper/whatever and using /dev/dm-0 with a
btrfs device command results in df showing /dev/dm-0. This can happen with
multipath devices with friendly names enabled and doing something like
'partprobe' which (at least with our version) ends up issuing a 'change'
uevent on the sysfs node. That *always* uses the dm-# name, and we get
confused users.
This patch does the same canonicalization of the paths that mount does
so that we don't end up having inconsistent names reported by ->show_devices
later.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
cmds-device.c | 60 ++++++++++++++++++++++++++++++++++++++++++++-------------
cmds-replace.c | 13 ++++++++++--
utils.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
utils.h | 2 +
4 files changed, 117 insertions(+), 15 deletions(-)
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -95,6 +95,7 @@ static int cmd_add_dev(int argc, char **
int devfd, res;
u64 dev_block_count = 0;
int mixed = 0;
+ char *path;
res = test_dev_for_mkfs(argv[i], force, estr);
if (res) {
@@ -118,15 +119,24 @@ static int cmd_add_dev(int argc, char **
goto error_out;
}
- strncpy_null(ioctl_args.name, argv[i]);
+ path = canonicalize_path(argv[i]);
+ if (!path) {
+ fprintf(stderr,
+ "ERROR: Could not canonicalize pathname '%s': %s\n",
+ argv[i], strerror(errno));
+ ret++;
+ goto error_out;
+ }
+
+ strncpy_null(ioctl_args.name, path);
res = ioctl(fdmnt, BTRFS_IOC_ADD_DEV, &ioctl_args);
e = errno;
- if(res<0){
+ if (res < 0) {
fprintf(stderr, "ERROR: error adding the device '%s' - %s\n",
- argv[i], strerror(e));
+ path, strerror(e));
ret++;
}
-
+ free(path);
}
error_out:
@@ -242,6 +252,7 @@ static int cmd_scan_dev(int argc, char *
for( i = devstart ; i < argc ; i++ ){
struct btrfs_ioctl_vol_args args;
+ char *path;
if (!is_block_device(argv[i])) {
fprintf(stderr,
@@ -249,9 +260,17 @@ static int cmd_scan_dev(int argc, char *
ret = 1;
goto close_out;
}
- printf("Scanning for Btrfs filesystems in '%s'\n", argv[i]);
+ path = canonicalize_path(argv[i]);
+ if (!path) {
+ fprintf(stderr,
+ "ERROR: Could not canonicalize path '%s': %s\n",
+ argv[i], strerror(errno));
+ ret = 1;
+ goto close_out;
+ }
+ printf("Scanning for Btrfs filesystems in '%s'\n", path);
- strncpy_null(args.name, argv[i]);
+ strncpy_null(args.name, path);
/*
* FIXME: which are the error code returned by this ioctl ?
* it seems that is impossible to understand if there no is
@@ -262,9 +281,11 @@ static int cmd_scan_dev(int argc, char *
if( ret < 0 ){
fprintf(stderr, "ERROR: unable to scan the device '%s' - %s\n",
- argv[i], strerror(e));
+ path, strerror(e));
+ free(path);
goto close_out;
}
+ free(path);
}
close_out:
@@ -284,6 +305,7 @@ static int cmd_ready_dev(int argc, char
struct btrfs_ioctl_vol_args args;
int fd;
int ret;
+ char *path;
if (check_argc_min(argc, 2))
usage(cmd_ready_dev_usage);
@@ -293,22 +315,34 @@ static int cmd_ready_dev(int argc, char
perror("failed to open /dev/btrfs-control");
return 1;
}
- if (!is_block_device(argv[1])) {
+
+ path = canonicalize_path(argv[argc - 1]);
+ if (!path) {
fprintf(stderr,
- "ERROR: %s is not a block device\n", argv[1]);
- close(fd);
- return 1;
+ "ERROR: Could not canonicalize pathname '%s': %s\n",
+ argv[argc - 1], strerror(errno));
+ ret = 1;
+ goto out;
}
- strncpy(args.name, argv[argc - 1], BTRFS_PATH_NAME_MAX);
+ if (!is_block_device(path)) {
+ fprintf(stderr,
+ "ERROR: %s is not a block device\n", path);
+ ret = 1;
+ goto out;
+ }
+
+ strncpy(args.name, path, BTRFS_PATH_NAME_MAX);
ret = ioctl(fd, BTRFS_IOC_DEVICES_READY, &args);
if (ret < 0) {
fprintf(stderr, "ERROR: unable to determine if the device '%s'"
- " is ready for mounting - %s\n", argv[argc - 1],
+ " is ready for mounting - %s\n", path,
strerror(errno));
ret = 1;
}
+out:
+ free(path);
close(fd);
return ret;
}
--- a/cmds-replace.c
+++ b/cmds-replace.c
@@ -134,7 +134,7 @@ static int cmd_start_replace(int argc, c
int fddstdev = -1;
char *path;
char *srcdev;
- char *dstdev;
+ char *dstdev = NULL;
int avoid_reading_from_srcdev = 0;
int force_using_targetdev = 0;
struct stat st;
@@ -204,7 +204,12 @@ static int cmd_start_replace(int argc, c
}
srcdev = argv[optind];
- dstdev = argv[optind + 1];
+ dstdev = canonicalize_path(argv[optind + 1]);
+ if (!dstdev) {
+ fprintf(stderr,
+ "ERROR: Could not canonicalize path '%s': %s\n",
+ argv[optind + 1], strerror(errno));
+ }
if (is_numerical(srcdev)) {
struct btrfs_ioctl_fs_info_args fi_args;
@@ -278,6 +283,8 @@ static int cmd_start_replace(int argc, c
close(fddstdev);
fddstdev = -1;
+ free(dstdev);
+ dstdev = NULL;
dev_replace_handle_sigint(fdmnt);
if (!do_not_background) {
@@ -312,6 +319,8 @@ static int cmd_start_replace(int argc, c
return 0;
leave_with_error:
+ if (dstdev)
+ free(dstdev);
if (fdmnt != -1)
close(fdmnt);
if (fdsrcdev != -1)
--- a/utils.c
+++ b/utils.c
@@ -987,6 +987,63 @@ static int blk_file_in_dev_list(struct b
}
/*
+ * Resolve a pathname to a device mapper node to /dev/mapper/<name>
+ * Returns NULL on invalid input or malloc failure; Other failures
+ * will be handled by the caller using the input pathame.
+ */
+char *canonicalize_dm_name(const char *ptname)
+{
+ FILE *f;
+ size_t sz;
+ char path[256], name[256], *res = NULL;
+
+ if (!ptname || !*ptname)
+ return NULL;
+
+ snprintf(path, sizeof(path), "/sys/block/%s/dm/name", ptname);
+ if (!(f = fopen(path, "r")))
+ return NULL;
+
+ /* read <name>\n from sysfs */
+ if (fgets(name, sizeof(name), f) && (sz = strlen(name)) > 1) {
+ name[sz - 1] = '\0';
+ snprintf(path, sizeof(path), "/dev/mapper/%s", name);
+
+ if (access(path, F_OK) == 0)
+ res = strdup(path);
+ }
+ fclose(f);
+ return res;
+}
+
+/*
+ * Resolve a pathname to a canonical device node, e.g. /dev/sda1 or
+ * to a device mapper pathname.
+ * Returns NULL on invalid input or malloc failure; Other failures
+ * will be handled by the caller using the input pathame.
+ */
+char *canonicalize_path(const char *path)
+{
+ char *canonical, *p;
+
+ if (!path || !*path)
+ return NULL;
+
+ canonical = realpath(path, NULL);
+ if (!canonical)
+ return strdup(path);
+ p = strrchr(canonical, '/');
+ if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) {
+ char *dm = canonicalize_dm_name(p + 1);
+ if (dm) {
+ free(canonical);
+ return dm;
+ }
+ }
+ return canonical;
+}
+
+/*
* returns 1 if the device was mounted, < 0 on error or 0 if everything
* is safe to continue.
*/
--- a/utils.h
+++ b/utils.h
@@ -61,6 +61,8 @@ int btrfs_add_to_fsid(struct btrfs_trans
int btrfs_scan_for_fsid(int run_ioctls);
void btrfs_register_one_device(char *fname);
int btrfs_scan_one_dir(char *dirname, int run_ioctl);
+char *canonicalize_dm_name(const char *ptname);
+char *canonicalize_path(const char *path);
int check_mounted(const char *devicename);
int check_mounted_where(int fd, const char *file, char *where, int size,
struct btrfs_fs_devices **fs_devices_mnt);

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,43 @@
-------------------------------------------------------------------
Fri Jun 6 13:20:54 UTC 2014 - jeffm@suse.com
- btrfs-progs: canonicalize pathnames for device commands (bnc#880486).
- Added patch:
* btrfs-progs-canonicalize-pathnames-for-device-commands
-------------------------------------------------------------------
Fri Jun 6 13:20:10 UTC 2014 - jeffm@suse.com
- fsck: fix checking on filesystems with large sectorsize (bnc#872286)
- Added patches:
* 0171-btrfs-progs-make-free-space-checker-work-on-non-4k-s.patch
-------------------------------------------------------------------
Fri Jun 6 13:15:01 UTC 2014 - jeffm@suse.com
- Do not package btrfs-find-root and btrfs-select-super by default.
- Removed printing byte number for every slot (bnc#872364).
- Removed patch:
* 0170-btrfs-progs-In-find-root-dump-bytenr-for-every-slot.patch
-------------------------------------------------------------------
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 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 Name: btrfsprogs
Version: 3.14.1 Version: 3.14.2
Release: 0 Release: 0
Summary: Utilities for the Btrfs filesystem Summary: Utilities for the Btrfs filesystem
License: GPL-2.0 License: GPL-2.0
@ -31,16 +31,10 @@ Source: btrfs-progs-%{tar_version}.tar.bz2
Source1: boot-btrfs.sh Source1: boot-btrfs.sh
Source4: setup-btrfs.sh Source4: setup-btrfs.sh
Patch1: 0001-Btrfs-progs-fix-check-to-test-trim-support.patch Patch1: 0001-btrfs-progs-doc-fix-symlink-target-for-btrfsck.8.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
Patch6: 0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.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 Patch7: 0007-Btrfs-progs-fsck-avoid-pinning-same-block-several-ti.patch
Patch8: 0008-Btrfs-progs-fsck-add-ability-to-check-reloc-roots.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 Patch11: 0011-btrfs-progs-Enhance-the-command-btrfs-filesystem-df.patch
Patch12: 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch Patch12: 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch
Patch13: 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch Patch13: 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch
@ -68,13 +62,15 @@ Patch164: 0164-btrfs-progs-convert-set-label-or-copy-from-origin.patch
Patch167: 0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch Patch167: 0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch
Patch168: 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch Patch168: 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch
Patch169: 0169-btrfs-progs-Check-metadata-mirrors-in-find-root.patch Patch169: 0169-btrfs-progs-Check-metadata-mirrors-in-find-root.patch
Patch170: 0170-btrfs-progs-In-find-root-dump-bytenr-for-every-slot.patch Patch171: 0171-btrfs-progs-make-free-space-checker-work-on-non-4k-s.patch
Patch172: btrfs-progs-canonicalize-pathnames-for-device-commands
Patch200: 0200-btrfs-progs-print-qgroup-excl-as-unsigned.patch Patch200: 0200-btrfs-progs-print-qgroup-excl-as-unsigned.patch
Patch201: 0201-btrfs-progs-import-ulist.patch Patch201: 0201-btrfs-progs-import-ulist.patch
Patch202: 0202-btrfs-progs-add-quota-group-verify-code.patch Patch202: 0202-btrfs-progs-add-quota-group-verify-code.patch
Patch1000: local-version-override.patch Patch1000: local-version-override.patch
BuildRequires: asciidoc
BuildRequires: libacl-devel BuildRequires: libacl-devel
BuildRequires: libattr-devel BuildRequires: libattr-devel
BuildRequires: libblkid-devel BuildRequires: libblkid-devel
@ -82,9 +78,8 @@ BuildRequires: libext2fs-devel
BuildRequires: libuuid-devel BuildRequires: libuuid-devel
BuildRequires: lzo-devel BuildRequires: lzo-devel
BuildRequires: udev BuildRequires: udev
BuildRequires: xmlto
BuildRequires: zlib-devel BuildRequires: zlib-devel
# for /bin/true
Requires: coreutils
Supplements: filesystem(btrfs) Supplements: filesystem(btrfs)
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -112,15 +107,9 @@ build applications to interface with btrfs.
%prep %prep
%setup -q -n btrfs-progs-%{tar_version} %setup -q -n btrfs-progs-%{tar_version}
%patch1 -p1 %patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1 %patch6 -p1
%patch7 -p1 %patch7 -p1
%patch8 -p1 %patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1 %patch11 -p1
%patch12 -p1 %patch12 -p1
%patch13 -p1 %patch13 -p1
@ -147,7 +136,8 @@ build applications to interface with btrfs.
%patch167 -p1 %patch167 -p1
%patch168 -p1 %patch168 -p1
%patch169 -p1 %patch169 -p1
%patch170 -p1 %patch171 -p1
%patch172 -p1
%patch200 -p1 %patch200 -p1
%patch201 -p1 %patch201 -p1
%patch202 -p1 %patch202 -p1
@ -155,8 +145,7 @@ build applications to interface with btrfs.
%build %build
make %{?_smp_mflags} CFLAGS="%{optflags}" all btrfs-convert \ make %{?_smp_mflags} CFLAGS="%{optflags}" all btrfs-convert \
btrfs-zero-log btrfs-select-super btrfs-image btrfstune \ btrfs-zero-log btrfs-select-super btrfs-image btrfstune
btrfs-find-root
%install %install
make install DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_sbindir} mandir=%{_mandir} libdir=%{_libdir} make install DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_sbindir} mandir=%{_mandir} libdir=%{_libdir}
@ -194,6 +183,17 @@ find %{buildroot} -type f -name "*.la" -delete -print
# don't install .a for now # don't install .a for now
rm -f %{buildroot}/%{_libdir}/*.a rm -f %{buildroot}/%{_libdir}/*.a
%if 0%{!?for_debugging:1}
DEBUG_FILES="/sbin/btrfs-find-root
%{_sbindir}/btrfs-find-root
%_mandir/man8/btrfs-find-root.8.gz
/sbin/btrfs-select-super
%{_sbindir}/btrfs-select-super"
for file in $DEBUG_FILES; do
rm -f %{buildroot}$file
done
%endif
%post -n libbtrfs0 -p /sbin/ldconfig %post -n libbtrfs0 -p /sbin/ldconfig
%postun -n libbtrfs0 -p /sbin/ldconfig %postun -n libbtrfs0 -p /sbin/ldconfig
@ -206,11 +206,9 @@ rm -f %{buildroot}/%{_libdir}/*.a
/sbin/btrfs /sbin/btrfs
/sbin/btrfs-zero-log /sbin/btrfs-zero-log
/sbin/btrfs-convert /sbin/btrfs-convert
/sbin/btrfs-select-super
/sbin/btrfs-image /sbin/btrfs-image
/sbin/btrfstune /sbin/btrfstune
/sbin/btrfsck /sbin/btrfsck
/sbin/btrfs-find-root
/sbin/mkfs.btrfs /sbin/mkfs.btrfs
/sbin/btrfs-debug-tree /sbin/btrfs-debug-tree
/sbin/btrfs-show-super /sbin/btrfs-show-super
@ -218,11 +216,9 @@ rm -f %{buildroot}/%{_libdir}/*.a
%{_sbindir}/btrfs %{_sbindir}/btrfs
%{_sbindir}/btrfs-zero-log %{_sbindir}/btrfs-zero-log
%{_sbindir}/btrfs-convert %{_sbindir}/btrfs-convert
%{_sbindir}/btrfs-select-super
%{_sbindir}/btrfs-image %{_sbindir}/btrfs-image
%{_sbindir}/btrfstune %{_sbindir}/btrfstune
%{_sbindir}/btrfsck %{_sbindir}/btrfsck
%{_sbindir}/btrfs-find-root
%{_sbindir}/fsck.btrfs %{_sbindir}/fsck.btrfs
%{_sbindir}/mkfs.btrfs %{_sbindir}/mkfs.btrfs
%{_sbindir}/btrfs-debug-tree %{_sbindir}/btrfs-debug-tree
@ -240,11 +236,33 @@ rm -f %{buildroot}/%{_libdir}/*.a
%{_mandir}/man8/btrfs.8.gz %{_mandir}/man8/btrfs.8.gz
%{_mandir}/man8/btrfs-convert.8.gz %{_mandir}/man8/btrfs-convert.8.gz
%{_mandir}/man8/btrfs-debug-tree.8.gz %{_mandir}/man8/btrfs-debug-tree.8.gz
%{_mandir}/man8/btrfs-find-root.8.gz
%{_mandir}/man8/btrfs-map-logical.8.gz %{_mandir}/man8/btrfs-map-logical.8.gz
%{_mandir}/man8/btrfs-show-super.8.gz %{_mandir}/man8/btrfs-show-super.8.gz
%{_mandir}/man8/btrfs-zero-log.8.gz %{_mandir}/man8/btrfs-zero-log.8.gz
%{_mandir}/man8/btrfstune.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
%if 0%{?for_debugging:1}
/sbin/btrfs-find-root
%{_sbindir}/btrfs-find-root
%{_mandir}/man8/btrfs-find-root.8.gz
/sbin/btrfs-select-super
%{_sbindir}/btrfs-select-super
%endif
%files -n libbtrfs0 %files -n libbtrfs0
%defattr(-, root, root) %defattr(-, root, root)

View File

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