summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* btrfs-progs: build: only install udev rules for udev >= 190Jeff Mahoney2016-09-05
| | | | | | | | Prior to udev v190, there was no btrfs builtin helper. Installing it on systems with an older udev will cause problems. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests README: fuzzed imagesDavid Sterba2016-09-05
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fuzz-test: Add test case for unaligned extent itemQu Wenruo2016-09-05
| | | | | | | Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ added bko-NNN- prefix to the files ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck: Avoid abort and BUG_ON in add_tree_backrefQu Wenruo2016-09-05
| | | | | | | | | | | | Add_tree_backref() can cause BUG_ON() and abort() in quite a lot of cases, from the ENOMEM to existing tree backref records. Change all these BUG_ON() and abort() to return proper values. And modify all callers to handle such problems. Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck: Check bytenr alignment for extent itemQu Wenruo2016-09-05
| | | | | | | Check bytenr alignment for extent item to filter invalid items early. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fuzz-test: Add test case for invalid drop levelQu Wenruo2016-09-05
| | | | | | | Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ added bko-NNN- prefix to the files ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck: Check drop level before walking through fs treeQu Wenruo2016-09-05
| | | | | | | | | | | | Exposed by fuzzed image from Lukas, which contains invalid drop level (16), causing segfault when accessing path->nodes[drop_level]. This patch will check drop level against fs tree level and BTRFS_MAX_LEVEL to avoid such problem. Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fuzz-test: Add image for unaligned tree block ptrQu Wenruo2016-09-05
| | | | | | | | | | Add test case image for unaligned tree block ptr. It should lead to BUG_ON in free_extent_buffer(). Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ added bko-NNN- prefix to the files ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: do early check for read_tree_blockQu Wenruo2016-09-05
| | | | | | | | | | | | | | | | | | | Although we have enhanced read_tree_block() from a lot of different aspects, it lacks the early bytenr/blocksize alignment check. And the lack of such check can lead to strange use-after-free bugs, due to the fact that alloc_extent_buffer() will free overlapping extent buffers, and allocate new eb for the usage. So we should not allow invalid bytenr/blocksize even passed to btrfs_find_create_tree_block(). This patch will add such check so we won't trigger use-after-free bug then. Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fuzz-test: Add image for wrong chunk item in root treeQu Wenruo2016-09-05
| | | | | | | | | | | | | | Reported by Lukas and the same image from him. DATA_RELOC tree's key type is modifed to CHUNK_ITEM, causing btrfsck interpret it as CHUNK_ITEM and cause 0 num_stripes. Add the image to fuzz-test. Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ added bko-NNN- prefix to the files ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Do extra chunk check before processing chunk itemQu Wenruo2016-09-05
| | | | | | | | | | | | | | | | | | | Current we only do chunk validation check at mount time. It's good for most case, but for fuzzed or manually crafted images, we can insert a CHUNK_ITEM key into root tree. Since mount time check will only check chunk tree, it will not check CHUNK_ITEM in root tree. Even with previous key type check against leaf owner, it is still possible to modify the leaf owner to by-pass it. So we still need to check chunk validation before processing it. Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: ignore invalid key in invalid rootQu Wenruo2016-09-05
| | | | | | | | | | | | | Btrfs tree implies a lot of restriction on which key types are allowed in specific roots. Like CHUNK_ITEM keys are only valid in chunk root. This patch will add such check at run_next_block() for original mode. Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Enhance and export print_key_type functionQu Wenruo2016-09-05
| | | | | | | Just the same thing done for print_objectid(). Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Enhance and export print_objectid functionQu Wenruo2016-09-05
| | | | | | | | | This function is quite useful for a lot of error report. Enhance it to support custom output other than stdout. And export it for later btrfsck enhancement. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.7.1David Sterba2016-08-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update CHANGES for 4.7.1David Sterba2016-08-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add rest of stack operations for btrfs_dir_itemDavid Sterba2016-08-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: switch to common error helpers in do_rollbackDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: reword message when conversion failsDavid Sterba2016-08-24
| | | | | | | The filesystem will not be finalized, no difference if it's before or after the chunk mapping fixups. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: switch to message helpers in do_convertDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: remove redundant checkDavid Sterba2016-08-24
| | | | | | | The check for sectorsize is properly done in do_convert, remove the BUG_ON. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: improve error hanling of init_btrfsDavid Sterba2016-08-24
| | | | | | Replace BUG_ONs and verbosely report the errors. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: improve error hanling of create_subvolDavid Sterba2016-08-24
| | | | | | Replace BUG_ONs and verbosely report the errors. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: improve error hanling of link_subvolDavid Sterba2016-08-24
| | | | | | Replace BUG_ONs and verbosely report the errors. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: make ext2 compilation honor the configure optionsDavid Sterba2016-08-24
| | | | | | | Now ext2 conversion will be built in iff it's selected by --with-convert option. Default is yes. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move prepare_system_chunk_sbDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move migrate_super_blockDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move init_btrfsDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move make_convert_data_block_groupsDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move create_subvolDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move link_subvolDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move create_imageDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move convert_read_used_spaceDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move calculate_available_spaceDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move wipe_reserved_rangesDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move wipe_one_reserved_rangeDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move _expand_extent_cacheDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move migrate_reserved_rangesDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move migrate_one_reserved_rangeDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move create_image_file_rangeDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move block_iterate_procDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move record_file_blocksDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move init_blk_iterate_dataDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move csum_disk_extentDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move read_disk_extentDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move convert_insert_direntDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move intersect_with_sbDavid Sterba2016-08-24
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: prefix all ext2-related helpersDavid Sterba2016-08-24
| | | | | | Add ext2_ prefix to all functions that seem to be ext2-specific. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: extend convert optionsDavid Sterba2016-08-24
| | | | | | | | Add --with-convert[=VALUE] option to configure. Accepts ext2, auto, yes, or no, but will be extended to more in the future. The configure-time defines are not used in the code, ext2 is built-in unconditionally. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add per-tool cflags variableDavid Sterba2016-08-24
| | | | | | | The standalone tools are built from pattern rules, add support for per-tool cflaags, like btrfs_something_clfags. Signed-off-by: David Sterba <dsterba@suse.com>