summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfs-progs: tests: add testing image for zstd for btrfs-restoreNick Terrell2017-09-25
| | | | | | | | | | | Adds tests for the new features based on a prebuilt btrfs image with a zstd compressed file. Split from the previous patch. Signed-off-by: Nick Terrell <terrelln@fb.com> [ with some cleanups ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Add zstd supportNick Terrell2017-09-25
| | | | | | | | | | | | | | | | Adds zstd support to the btrfs program. An optional dependency on libzstd >= 1.0.0 is added. Autoconf accepts `--enable-zstd' or `--disable-zstd' and defaults to detecting if libzstd is present using `pkg-config'. The patch is also available in my fork of btrfs-progs [1], which passes Travis-CI with the new tests. The prebuilt binary is available there. I haven't updated Android.mk. [1] https://github.com/terrelln/btrfs-progs/tree/devel Signed-off-by: Nick Terrell <terrelln@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update btrfs-completionMisono, Tomohiro2017-09-25
| | | | | | | | | | | | This patch updates btrfs-completion: - add "filesystem du" and "rescure zero-log" - restrict _btrfs_mnts to show btrfs type only - add more completion in last case statements (This file contains both spaces/tabs and may need cleanup.) Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: sync Makefile to Android.mkDavid Sterba2017-09-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix run_mustfail in cli-tests/007-check-forceDavid Sterba2017-09-25
| | | | | | | | The sanity check in run_mustfail does not work as expected and allowed the command to continue without the missing parameter Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196893 Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: README: update links, enhance contribution sectionDavid Sterba2017-09-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: use CRC32C reversing instead of brute force to find ↵Piotr Pawlow2017-09-25
| | | | | | | collisions Author: Piotr Pawlow <pp@siedziba.pl> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: add a function to check if generated filename suffix is ↵Piotr Pawlow2017-09-25
| | | | | | | valid Author: Piotr Pawlow <pp@siedziba.pl> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: add a function to calculate CRC32C collisionsPiotr Pawlow2017-09-25
| | | | | | | | | | The function uses the reverse CRC32C table to quickly calculate a 4-byte suffix, that when added to the original data will make it match desired checksum. Author: Piotr Pawlow <pp@siedziba.pl> [ minor adjustments ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: add reverse CRC32C tablePiotr Pawlow2017-09-25
| | | | | | | The table will be used to speed up calculations of CRC32C collisions. Author: Piotr Pawlow <pp@siedziba.pl> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: move core find_collision code to a separate functionPiotr Pawlow2017-09-25
| | | | | Author: Piotr Pawlow <pp@siedziba.pl> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: fix non-printable characters in generated file namesPiotr Pawlow2017-09-25
| | | | | | | | | Function find_collision sometimes generated file names with non-printable DEL characters (code 127), for example file name "|5gp!" would be changed to "U'2<DEL>y" when using "crc-collisions" sanitize mode. Author: Piotr Pawlow <pp@siedziba.pl> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Removed missing header file, fixes compilation errorUli Heller2017-09-25
| | | | | | | (From pull request #61.) Author: Uli Heller <uli.heller@daemons-point.com> Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.13David Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update CHANGES for v4.13David Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: add new test for inspect-internal rootidMisono, Tomohiro2017-09-08
| | | | | | | | | | | This new test checks inspect-internal rootid - handle path to subvolume/directory/file as an argument - get different id for each subvolume - get the expected id for each file/directory (i.e. the same as containing subvolume) Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: check for kernel support for reiserfsDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: enhance post-rollback fsck testsDavid Sterba2017-09-08
| | | | | | | | The post-rollback helper still assumes just extN, we need an extra argument that'll get passed to fsck. Change all callsites at once so the tests do not fail temporarily. Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs-progs: print-tree: check num_stripes in print_chunkZhang Yu2017-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | [TEST/fuzz] case: 004-simple-dump-tree Since the wrong key(DATA_RELOC_TREE CHUNK_ITEM 0) in root tree, error calling print_chunk(), resulting in num_stripes == 0. ERROR: [TEST/fuzz] 004-simple-dump-tree ctree.h:317: btrfs_chunk_item_size: BUG_ON `num_stripes == 0` triggered, value 1 failed (ignored, ret=134): /myproject/btrfs-progs/btrfs inspect-internal dump-tree /myproject/btrfs-progs/tests/fuzz-tests/images/ bko-155201-wrong-chunk-item-in-root-tree.raw.restored test failed for case 004-simple-dump-tree Makefile:288: recipe for target 'test-fuzz' failed make: *** [test-fuzz] Error 1 So, check on num_stripes in print_chunk Signed-off-by: Zhang Yu <zhangyu-fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: fix name generation not to contain trailing spacesMisono, Tomohiro2017-09-08
| | | | | | | | | | | | | First patch causes test-convert fails. This is because generate_dataset() creates a name containing trailing spaces for "slow_symlink" type, and cause getfacl error in convert_test_perm(). (This is not noticed since original run_check_stdout() throws away the error.) Fix this by use space for delimiter for cut. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: fix run_check_stdout() call _fail()Misono, Tomohiro2017-09-08
| | | | | | | | | | run_check_stdout() uses "... | tee ... || _fail". However, since tee won't fail, _fail() is not called even if first command fails. Fix this by checking PIPESTATUS in the end. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Add test case for mkfs --rootdir parameterQu Wenruo2017-09-08
| | | | | | | | Add test case which checks if -r|--rootdir mkfs option can handle symlink/char/block/fifo files. Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: Fix wrong file type for dir items and indexes when ↵Qu Wenruo2017-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | specifying root directory [Bug] If using mkfs.btrfs with "-r" parameter and specified directory has fifo/socket/char/block special file, then created filesystem can't pass fsck: ------ checking fs roots unresolved ref dir 241158 index 3 namelen 9 name S.dirmngr filetype 0 errors 80, filetype mismatch ERROR: errors found in fs roots ------ [Reason] Btrfs dir items/indexes records inode type, while "-r" only handles directories, regular files and symlink, it makes such special files type to be regular file and caused the problem. [Fix] Add missing types for add_directory_items(), so that result of "mkfs.btrfs -r" can pass mkfs. Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: Move the tree root creation to own functionGu Jinxiang2017-09-08
| | | | | | | | | | | | | make_btrfs is too long to understand, make creatation of root tree in a function. Some of the tree roots are now created in a loop, where the code is just copypasted. We now make use of the reference_root_table to translate block index to root objectid. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> [ updated changelog ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: missing device and slack space reportDavid Sterba2017-09-08
| | | | | | | Verify that a missing device will not result in reporting a negative value interpreted as 16EiB. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: device usage: don't calculate slack on missing devicePatrik Lundquist2017-09-08
| | | | | | | | Print Device slack: 0.00B instead of Device slack: 16.00EiB Signed-off-by: Patrik Lundquist <patrik.lundquist@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: inspect rootid: Allow a file to be specifiedMisono, Tomohiro2017-09-08
| | | | | | | | | | | | | Since cmd_inspect_rootid() calls btrfs_open_dir(), it rejects a file to be specified. But as the document says, a file should be supported. This patch introduces btrfs_open_file_or_dir(), which is a counterpart of btrfs_open_dir(), to safely check and open btrfs file or directory. The original btrfs_open_dir() content is moved to btrfs_open() and shared by both function. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: convert misc/011-delete-missing-device to loopdevsDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: convert misc/006-image-on-missing-device to loopdevsDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: move loopdev helpers out of the testcase to commonDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: cleanup loop device helpersDavid Sterba2017-09-08
| | | | | | | Make the loop device helpers a bit more generic before moving them to the common helpers. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: factor out extent_csum dumpDavid Sterba2017-09-08
| | | | | | | Factor out code to own helper and tweak the format so it matches the rest. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print the csum length in debug-treeJosef Bacik2017-09-08
| | | | | | | | | | While looking at a log of a corrupted fs I needed to verify we were missing csums for a given range. Make this easier by printing out the range of bytes a csum item covers. Signed-off-by: Josef Bacik <jbacik@fb.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add testcase for 'fi du' and empty subvolDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: don't call lookup_path_rootid for ↵Goffredo Baroncelli2017-09-08
| | | | | | | | | | | | | | | | | | | | | | | BTRFS_EMPTY_SUBVOL_DIR_OBJECTID When ino is BTRFS_EMPTY_SUBVOL_DIR_OBJECTID, the item is not referred to any file-tree. So lookup_path_rootid() doesn't return any meaningful value. As was reported, this can be triggered by $ btrfs sub create test1 $ btrfs sub create test1/test2 $ btrfs sub snap test1 test1.snap $ btrfs fi du -s test1 Total Exclusive Set shared Filename 0.00B 0.00B 0.00B test1 $ btrfs fi du -s test1.snap Total Exclusive Set shared Filename ERROR: cannot check space of 'test1.snap': Inappropriate ioctl for device Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: reset the ret value when ignoring an error from du_add_fileGoffredo Baroncelli2017-09-08
| | | | | | | | | In du_walk_dir(), when du_add_file() returns an error it is usually ignored. However if the error is returned querying the last item, the error is returned to the caller. Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add test for check --forceDavid Sterba2017-09-08
| | | | | | Basic test of the --force functionality, on an empty filesystem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: add option to skip mount checksDavid Sterba2017-09-08
| | | | | | | | | | | Sometimes it's needed to do a check on a mounted filesystem. This should work fine on a quiescent filesystem or a read-only mount. Changes on the block device done by kernel might confuse the userspace checker and it might crash when it reads some stale data. Repair without mount checks is not supported right now. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: print-tree: factor out temporary_item dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: factor out persistent_item dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: factor out qgroup_limit dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: factor out qgroup_info dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: factor out qgroup_status dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: factor out dev_extent dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: factor out free_space_info dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: factor out shared_data_ref dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: factor out extent_data_ref dumpDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* 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>