Skip to contentSkip to conversation

btrfs-progs: Fix missing internal deps in tests.

PATCH Applied Adam Buchbinder 2 participants 4 messages Jul 10, 2017 – Jul 12, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs-progs: Fix missing internal deps in tests.

Doing a straight 'make test' would fail because some misc and fsck tests require particular tools to already be built. Add dependencies at the Makefile and shell-script level.

---
 Makefile            | 5 +++--
 tests/fsck-tests.sh | 1 +
 tests/misc-tests.sh | 3 +++
 3 files changed, 7 insertions(+), 2 deletions(-)
Makefile +3 -2
index 81598df..4669525 100644
@@ -272,11 +272,12 @@ test-convert: btrfs btrfs-convert
 	$(Q)bash tests/convert-tests.sh
 
 test-check: test-fsck
-test-fsck: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs
+test-fsck: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs btrfstune
 	@echo "    [TEST]   fsck-tests.sh"
 	$(Q)bash tests/fsck-tests.sh
 
-test-misc: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs btrfstune fssum
+test-misc: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs btrfstune fssum \
+		btrfs-zero-log btrfs-find-root btrfs-select-super
 	@echo "    [TEST]   misc-tests.sh"
 	$(Q)bash tests/misc-tests.sh
 
tests/fsck-tests.sh +1 -0
index 44cca1b..15d26c7 100755
@@ -23,6 +23,7 @@ rm -f "$RESULTS"
 check_prereq btrfs-corrupt-block
 check_prereq btrfs-image
 check_prereq btrfs
+check_prereq btrfstune
 check_kernel_support
 
 run_one_test() {
tests/misc-tests.sh +3 -0
index 1c645c9..0898801 100755
@@ -24,6 +24,9 @@ check_prereq btrfs-corrupt-block
 check_prereq btrfs-image
 check_prereq btrfstune
 check_prereq btrfs
+check_prereq btrfs-zero-log
+check_prereq btrfs-find-root
+check_prereq btrfs-select-super
 check_kernel_support
 
 # The tests are driven by their custom script called 'test.sh'
Signature · 1 line
2.13.2.725.g09c95d1e9-goog
#1 lore raw

PATCH 1/1 btrfs-progs: Tighten integer types in print-tree.

There are likely more places where the wrong size types are used, but these tripped Clang's warnings because they eventually get passed to printf.

---
 print-tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
print-tree.c +2 -2
index a0d3395..82d6572 100644
@@ -197,7 +197,7 @@ static void qgroup_flags_to_str(u64 flags, char *ret)
 
 void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
 {
-	int num_stripes = btrfs_chunk_num_stripes(eb, chunk);
+	u16 num_stripes = btrfs_chunk_num_stripes(eb, chunk);
 	int i;
 	u32 chunk_item_size = btrfs_chunk_item_size(num_stripes);
 	char chunk_flags_str[32] = {0};
@@ -336,7 +336,7 @@ static void print_file_extent_item(struct extent_buffer *eb,
 				   int slot,
 				   struct btrfs_file_extent_item *fi)
 {
-	int extent_type = btrfs_file_extent_type(eb, fi);
+	unsigned char extent_type = btrfs_file_extent_type(eb, fi);
 	char compress_str[16];
 
 	compress_type_to_str(btrfs_file_extent_compression(eb, fi),
Signature · 1 line
2.13.2.725.g09c95d1e9-goog
Applied
#2 lore raw

Re: [PATCH] btrfs-progs: Tighten integer types in print-tree.

Quoted 5 lines · Adam Buchbinder

There are likely more places where the wrong size types are used, but these tripped Clang's warnings because they eventually get passed to printf.

Applied, thanks.