summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfs-progs: Copy btrfs inode flags from kernel headerQu Wenruo2016-10-24
| | | | | | | | Btrfs-progs header lacks quite a lot inode flags. Copy them from kernel for later use. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Add fast,slow symlinks, fifo types to convert testLakshmipathi.G2016-10-24
| | | | | | Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in> [ fix root helper use in fast_symlink ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: btrfs-debugfs: cleanup unused variables reported by pylintLakshmipathi.G2016-10-24
| | | | | Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: add default ioctl-test buildDavid Sterba2016-10-24
| | | | | | | | Add another target that'll use default compiler options, eg. if we don't know the bitness of the architecture or gcc does not recognize the -m32/-m64 options. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: make the ioctl-test actually usefulDavid Sterba2016-10-24
| | | | | | | | Enhance the test to verify ioctl uniqueness, compare the defined values against the hardcoded expected values, and take care of the 32bit/64bit compatibility workarounds. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: ioctl: add 64bit compat for SENDDavid Sterba2016-10-24
| | | | | | | | | | | | | | | | The ioctl value of SEND will be different on 32bit userspace and 64bit kernel due to different pointer type width, that unfortunatelly made it into the structure definition. To maintain backward compatibility, we must do it in the 64bit->32bit way, because we don't have the kernel side workardound like SET_RECEIVED_SUBVOL has. Changing value of SEND would then break existing users of the raw ioctl. The compatibility structure and ioctl should not be used, exists for documentation, and testing. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: ioctl: add 32bit compat for SET_RECEIVED_SUBVOLDavid Sterba2016-10-24
| | | | | | | | | | | | The ioctl value of SET_RECEIVED_SUBVOL will be different on 32bit userspace and 64bit kernel. This is transparently handled on the kernel side. We now define the same structure so we can verify the ioctl value. The defined structure and ioctl should not be used. It is exists only for testing purposes, documenting the mess and as a warning for the future. Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.8.1David Sterba2016-10-12
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update CHANGES for v4.8.1David Sterba2016-10-12
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: ioctl: make build-time structure size checks optionalDavid Sterba2016-10-10
| | | | | | | | | Temporarily make the build checks optional. The structure sizes could change on arches due to alignment requirements or padding inserted into the structures. We need more extensive tests to make sure we'd not break ioctls. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fix printf format of sizeof on 32bit buildDavid Sterba2016-10-10
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add script to help build coverageDavid Sterba2016-10-10
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Fix warning_trace compile error if backtrace is disabledQu Wenruo2016-10-10
| | | | | | | | | | | If we disable backtrace, btrfs-progs can't be compiled since we don't have warning_trace defined. Fix by move it out of #ifndef BTRFS_DISABLE_BACKTRACE block. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ move warning_trace to the right place ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add explicit option separator to rm commandsDavid Sterba2016-10-10
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.8David Sterba2016-10-05
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update CHANGES for v4.8David Sterba2016-10-05
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add build-time checks for size of ioctl structuresDavid Sterba2016-10-05
| | | | | | | All structures that become part of ioctl definition must never change size. Add the build time checks for that. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: fix warning for printf format on 32bitDavid Sterba2016-10-05
| | | | | | | Compiler complains about nlink_t and %ld format on 32bit build. Add typecast and fix the format. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: kerncompat: add build-time assertion supportDavid Sterba2016-10-05
| | | | | | | Macro to verify compile-time conditions, like sie of structures or types. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add alias for check testsDavid Sterba2016-10-05
| | | | | | $ make test-check" Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: kerncompat: call abort at the end of assert_traceDavid Sterba2016-10-05
| | | | | | | The assert* helpers should not exit normally, mimick the behaviour of the std library assert. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: kerncompat: make WARN_ON more verboseDavid Sterba2016-10-05
| | | | | | | Curretnly WARN_ON would crash but that's not it's purpose. Add helper that prints the warning, optionally with trace. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: teach run_mayfail about sigabrtDavid Sterba2016-10-05
| | | | | | Mayfail helper should stop when we encoutner an abort. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-super: print chunks after validationDavid Sterba2016-10-05
| | | | | | | The fuzz test 005-simple-dump-super hits a crash, because we print the chunks too early. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: add new callback to check stateDavid Sterba2016-10-05
| | | | | | Make the hardcoded ext2 call to a generic per-fs callback. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: rename __setup_root and change to return voidDavid Sterba2016-10-05
| | | | | | Exported function should use a prefix. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: don't treat segfault as ignorable errorDavid Sterba2016-10-05
| | | | | | | | Some fuzzed images cause various tools to crash but the mayfail helper would not recognize that. We don't mind if the utility failes but it must not crash. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: split test 004 to separate testsDavid Sterba2016-10-05
| | | | | | Makes testing specific tool easier. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: don't access freed memory in btrfs_close_devicesDavid Sterba2016-10-05
| | | | | | | Caught by ASAN, as we don't access fs_devices directly, there's no null deref but 0x30 is still wrong. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: chunk-recover: handle duplicate cache entriesDavid Sterba2016-10-05
| | | | | | Triggered by fuzzed image bko-155621-bad-block-group-offset.raw . Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print value when assertion failsDavid Sterba2016-10-05
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: drop useless bug_onDavid Sterba2016-10-05
| | | | | | | The callers touch 'target', no point checking it inside restore_metadump again. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: return negativer error from all paths in mdrestore_initDavid Sterba2016-10-05
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: catch zero length extents, avoid endless loopDavid Sterba2016-10-03
| | | | | | | | If an extent is found to have length 0, we'd loop endlessly in copy_from_extent_tree. Reproduced by fuzzed image bko-166361-blocksize-zero.raw within test 002-simple-image . Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add fuzzed image with bad parent refs, qgroup-verifyDavid Sterba2016-10-03
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: better error handling in find_parent_rootsDavid Sterba2016-10-03
| | | | | | | | | Fix use-before-sanity-check leading to undefined behaviour and handle errors more gracefully. Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156811 Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add fuzzed images with bad blocksize/lengh of ebDavid Sterba2016-10-03
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: more sanity checks in read_tree_block_fs_infoDavid Sterba2016-10-03
| | | | | | | | | If blocksize is 0, it passes the IS_ALIGNED check but fails later as the length of ebs will be zero. Reported-by: Lukas Lueg <lukas.lueg@gmail.com> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=169311 Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: btrfstune: use common message helpersDavid Sterba2016-10-03
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: use common message helpersDavid Sterba2016-10-03
| | | | | | Usage errors are turned to normal errors. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Remove unnecessary parameter to clear_extent_uptodateQu Wenruo2016-10-03
| | | | | Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: qgroup: Fix regression leads to corrupted qgroup statusQu Wenruo2016-10-03
| | | | | | | | | | | | | | | | | | | | | | | Commit 93dabf211d74daf6e3de642bdd887a90a00f7b49 Author: Mark Fasheh <mfasheh@suse.de> Date: Fri Jun 17 13:37:48 2016 -0700 btrfs-progs: check: verify qgroups above level 0 This commit introduced a new regression which corrupts read_qgroup_status, since it iterate leaf with manually specified slot, not correct path->slot[0]. This leads to wrong slot[0] and read_qgroup_status() will read out wrong flags, leading to regression. Fix read_qgroup_status() by using eb and slot instread of wrong path strucutre. Reported-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Cc: Mark Fasheh <mfasheh@suse.de> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: constify string arguments where appropriateDavid Sterba2016-10-03
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: don't write to optarg in btrfs_qgroup_parse_sort_stringDavid Sterba2016-10-03
| | | | | | | Dup the string that gets passed to strtok so we don't destroy callers buffer. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove stray function declarationDavid Sterba2016-10-03
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: restore: update help textDavid Sterba2016-10-03
| | | | | | | Make it clear that --xattr restores the xattrs. Fix some whitespace damage and add an enum for the long-only option. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: super-recover: Reuse btrfs_read_dev_super functionQu Wenruo2016-10-03
| | | | | | | | | | | | We have enhanced super block validation check in disk_io.c, while super-recover doesn't use that function and use a custom one. That is duplicated, so reuse btrfs_read_dev_super to handle it, which not only enhanced super check, but also reduce the code length. Reported-by: hawken <hawken@thehawken.org> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Return more meaningful value for btrfs_read_deve_superQu Wenruo2016-10-03
| | | | | | | | | | | | | | btrfs_read_dev_super() only returns 0 or -1, which doesn't really help, caller won't know if it's caused by bad superblock or superblock out of range. Return -errno if pread64() return -1, and return -EOF if none or part of the super is read out, and return what check_super() returned. So caller can get -EIO to catch real corrupted super blocks. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fix user-facing typos in docs and help stringsNicholas D Steeves2016-10-03
| | | | | Signed-off-by: Nicholas D Steeves <nsteeves@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: document exit codes from scrubAdam Borowski2016-10-03
| | | | | Signed-off-by: Adam Borowski <kilobyte@angband.pl> Signed-off-by: David Sterba <dsterba@suse.com>