[PATCH] btrfs-progs: Fix data race in btrfs-convert.

2017-07-12 Thread Adam Buchbinder
/convert/source-ext2.c:853 in ext2_copy_inodes Signed-off-by: Adam Buchbinder <abuchbin...@google.com> --- convert/main.c| 12 ++-- convert/source-ext2.c | 3 +++ convert/source-fs.h | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/convert/main.c b/c

[PATCH] btrfs-progs: Use '-t btrfs' mount option in tests.

2017-07-12 Thread Adam Buchbinder
Without it, mount (at least from util-linux 2.20.1) tries (and fails) to mount some filesystems as NTFS. Signed-off-by: Adam Buchbinder <abuchbin...@google.com> --- tests/common | 2 +- tests/fsck-tests/012-leaf-corruption/test.sh | 2 +- 2 files chan

[PATCH] btrfs-progs: Fix data races in btrfs-image.

2017-07-12 Thread Adam Buchbinder
age/main.c:2534 #3 main btrfs-progs/image/main.c:2859 SUMMARY: ThreadSanitizer: data race btrfs-progs/image/main.c:1931 in add_cluster Signed-off-by: Adam Buchbinder <abuchbin...@google.com> --- image/main.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) di

[PATCH] btrfs-progs: Enable ThreadSanitizer, using D=tsan.

2017-07-12 Thread Adam Buchbinder
Tested with clang-3.9. Signed-off-by: Adam Buchbinder <abuchbin...@google.com> --- Makefile | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 81598df..8948301 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ # abort - call

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

2017-07-10 Thread 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. Signed-off-by: Adam Buchbinder <abuchbin...@google.com> --- print-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] btrfs-progs: Fix missing internal deps in tests.

2017-07-10 Thread Adam Buchbinder
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. Signed-off-by: Adam Buchbinder <abuchbin...@google.com> --- Makefile| 5 +++-- tests/fsck-tests.

[PATCH] btrfs: Fix misspellings in comments.

2016-03-04 Thread Adam Buchbinder
Signed-off-by: Adam Buchbinder <adam.buchbin...@gmail.com> --- fs/btrfs/check-integrity.c | 2 +- fs/btrfs/ctree.h | 10 +- fs/btrfs/dev-replace.c | 2 +- fs/btrfs/disk-io.c | 2 +- fs/btrfs/extent-tree.c | 2 +- fs/btrfs/extent_map.c | 4 ++-- fs

[PATCH] Fix a use-after-free in the volumes code.

2014-06-13 Thread Adam Buchbinder
#4 __open_ctree_fd .../disk-io.c:1090 #5 open_ctree_fd .../disk-io.c:1191 #6 do_convert .../btrfs-convert.c:2256 #7 main .../btrfs-convert.c:2745 Signed-off-by: Adam Buchbinder abuchbin...@google.com --- volumes.c | 1 + volumes.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion

Re: [PATCH] Properly size the leafsize field in the mdrestore_struct struct.

2014-06-13 Thread Adam Buchbinder
libraries as good) is apparently not trivial to install. I may just build zlib.) But the point is, it would have been annoying and sad if this had been a false positive through and through, but I *did* find an actual issue here using MSan, even though MSan was pointing in the exact wrong place. Adam

[PATCH] Use sparse files for filesystem conversion tests.

2014-06-12 Thread Adam Buchbinder
On my system, this brings the FS conversion test suite's runtime from over ten seconds down to under two. Thanks to Julien Muchembled for the suggestion. Signed-off-by: Adam Buchbinder abuchbin...@google.com --- tests/convert-tests.sh | 18 ++ 1 file changed, 10 insertions(+), 8

[PATCH] Add some simple end-to-end tests for btrfs-convert.

2014-05-21 Thread Adam Buchbinder
These use the system's mke2fs, and don't require loop devices or root privileges. They don't pick up anything with the default flags right now, but they do pick up some sanitizer issues when the tools are compiled with any of -fsanitize={address,memory,thread}. Signed-off-by: Adam Buchbinder

[PATCH] btrfs-image: Fix a data race in build_chunk_tree.

2014-05-18 Thread Adam Buchbinder
A mdrestore_struct was being written to without its mutex being held. This race was found with ThreadSanitizer; the relevant part of the report looks like this: WARNING: ThreadSanitizer: data race (pid=18828) Write of size 8 at 0x7fc3d088 by main thread: #0 build_chunk_tree