summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfs-progs: print-tree: factor out block_group_item dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: don't print the item type for all itemsDavid Sterba2017-09-08
| | | | | | | | In some cases it's clear from the context which item is being printed, so we can remove them. If the item has no data, some description is still desired (eg. orphan or various backrefs). Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: rename item callbacks to match the key nameDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: move fs roots check mode switch to a helperDavid Sterba2017-09-08
| | | | | | Simplify main a bit. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: cleanup use of fs_info in check_fs_rootsDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: pass fs_info to check_fs_rootsDavid Sterba2017-09-08
| | | | | | The root pointer is not used anyway, will be cleaned up next. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: move chunk and extent check mode switch to a helperDavid Sterba2017-09-08
| | | | | | Simplify main a bit. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: pass fs_info to check_chunks_and_extents_v2David Sterba2017-09-08
| | | | | | The root pointer is set to fs_root as was originally. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: use local fs_info in check_chunks_and_extentsDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: pass fs_info to check_chunks_and_extentsDavid Sterba2017-09-08
| | | | | | The root pointer is set to fs_root as was originally. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: verify critical root pointers before useDavid Sterba2017-09-08
| | | | | | | The pointers to critical roots must be valid before we start using them, eg. as the space clearing code. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: move more of space cache clearing to a helperDavid Sterba2017-09-08
| | | | | | Move the code out of main. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: remove old mixed backref codeDavid Sterba2017-09-08
| | | | | | | A code added in 2009 (95d3f20b51e9b) for a very short-lived change in the format is no concern to us nowadays. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add more sanitizer message patterns to log scannerDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: don't print message when fs is not recognized, ext2David Sterba2017-09-08
| | | | | | | Bad magic error means it's not the desired filesystem so the error message is just noise. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: limit size of log dump from conver testsDavid Sterba2017-09-08
| | | | | | | The convert tests generate lots of log material, travis CI has limit 4MB so we don't see anything useful when a late test fails. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: handle failed search in find_search_start betterDavid Sterba2017-09-08
| | | | | | | The warning can pop up frequently on a fuzzed image, the message seems to be enough. Add a more fitting error code too. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add more error handling to btrfs_free_block_groupDavid Sterba2017-09-08
| | | | | | | | As btrfs_update_block_group fails when the block group is not found in cache, we can exit btrfs_free_block_group, not much to rollback. The caller will also exit in turn. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix TEST_LOG=dump in convert testsDavid Sterba2017-09-08
| | | | | | | Test failure in convert tests with log dump does not happen because _fail is called before that and exits. Other test types are ok. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: handle transaction start failure in close_ctreeDavid Sterba2017-09-08
| | | | | | | | | Closing the fs will try to commit a pending transaction, but may fail to do so if the filesystem state is not well defined. This will eg. fail for some fuzz tests. The data structures are freed but no furhter attempt to commit is made. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: update READMEDavid Sterba2017-09-08
| | | | | | Wording, runtime dependencies. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: install missing CI packagesDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add more checks for tools used in convert testsDavid Sterba2017-09-08
| | | | | | | Tools that may not be present in common installations should be checked in the tests. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: build preparation phases out of script sectionDavid Sterba2017-09-08
| | | | | | | The logs of before_install are folded and we don't need to see the details, unlike the test logs. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: don't start or commit after transaction abortDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: start framework for transaction abortDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: store pointer to fs_info in transaction handleDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move transaction code out of disk-ioDavid Sterba2017-09-08
| | | | | | Temporarily export the low-level helpers. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move transaction implementation out of headerDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use kzalloc to allocate transaction handleDavid Sterba2017-09-08
| | | | | | Use the kernel-style allocation helpers and remove redundant zeroing. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: switch fs_info::system_allocs to bitDavid Sterba2017-09-08
| | | | | | | The value really is 0 or 1, the test in btrfs_reserve_extent can be simplified. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: return errors from btrfs_start_transactionDavid Sterba2017-09-08
| | | | | | | Now that all callers will catch errors, we can return them from the function. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add crude error handling when transaction start failsDavid Sterba2017-09-08
| | | | | | | | | | Currently transaction bugs out insided btrfs_start_transaction in case of error, we want to lift the error handling to the callers. This patch adds the BUG_ON anywhere it's been missing so far. This is not the best way of course. Transforming BUG_ON to a proper error handling highly depends on the caller and should be dealt with case by case. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: pull and build reiserfs lib inside CIDavid Sterba2017-09-08
| | | | | | | | The functionality needed to support reiserfs in convert has been added recently and is not yet available in the CI images, so we'll download and build it there. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add build checks for sanitization featuresDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: fix asan and ubsan buildDavid Sterba2017-09-08
| | | | | | | Probably with a new gcc (7.1.1) I started to see asan/ubsan link failures. Fixed by explicitly linking the libraries. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: fix building libbtrfs.so with tsanDavid Sterba2017-09-08
| | | | | | | | | | | | Except libbtrfs.so object, all other tools compile fine. The error is: ld: send-stream.o: relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC Compiling with -fPIC fixes the problem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: properly pass the LDFLAGS during tsan buildDavid Sterba2017-09-08
| | | | | | | The variable LD_FLAGS does not exist and the flags are not used, we need to use the newly added internal debugging linker flags. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add internal LDFLAGS for the D= featuresDavid Sterba2017-09-08
| | | | | | | We might want to pass additional linker flags for various sanitization features. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add more fuzzed images from bugzillaDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: handle blockgroup errors when opening filesystemDavid Sterba2017-09-08
| | | | | | | | | | | | | The call to btrfs_read_block_groups could loop if the metadata are damaged (reported eg. for an unaligned block), due to lack of error handling. We have to check for restored images or currently created filesystems, that do not contain the blockgroups. Can be reproduced by fuzzed image bko-155551. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=155551 Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: drop blocksize argument from readahead_tree_blockDavid Sterba2017-09-08
| | | | | | | Tree blocks are always nodesize. As readahead is only an optimization, exact size is not required and is only advisory. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: drop blocksize argument from btrfs_find_create_tree_blockDavid Sterba2017-09-08
| | | | | | | | Metadata blocks are always nodesize. When reading the superblock::sys_array, the actual size of data is fixed to 4k and smaller than nodesize, but otherwise everything works as before. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: drop redundant check of blocksize in read_tree_blockDavid Sterba2017-09-08
| | | | | | | | The tree blocks are supposed to be always of nodesize. Before the parameter has been dropped, it was unlikely but possible to pass a misaligned value. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: cleanup use of level_sizeDavid Sterba2017-09-08
| | | | | | | Nodesize is same for all levels, besides it's been only set and not used, in root_item_record. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: drop blocksize from read_tree_blockDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: drop local blocksize variables if they're nodesizeDavid Sterba2017-09-08
| | | | | | Prep work so we can drop the blocksize argument from several functions. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: fix PIE buildDavid Sterba2017-09-08
| | | | | | | Patch from Marcus Meissner <meissner@suse.com>. The CFLAGS are passed to the linker and mix up the compilation and linker flags for PIE support. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move reiserfs struct definitions to headerDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move and rename dev_t helpers to common fileDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>