summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfs-progs: fsck-tests: Add fallback TEST_DEV for test case 013Qu Wenruo2015-04-07
| | | | | | | | | | Add fallback TEST_DEV for test case 013. Fallback to $TOP/tests/test.img. Now all test cases of btrfs-progs need no extra setting except sudo. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fsck-tests: Update 013-extent-tree-rebuild to use more test ↵Qu Wenruo2015-04-07
| | | | | | | | | | | | | framework infrastructure. Update 013-extent-tree-rebuild to use more framework infrastructure, including: 1) Use run_check other than open-coded redirect 2) Add root privillege 3) Add dependency on 'btrfs-debug-tree' command Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fsck-tests: Remove duplicatesd TEST_MNT setup.Qu Wenruo2015-04-07
| | | | | | | | Since we have already had TEST_MNT fallback setup to $TOP/tests/mnt, just remove duplicated setting in 012-leaf-corruption/test.sh Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: test-frame: Update variant namesQu Wenruo2015-04-07
| | | | | | | | | | | | Use upper case variant name for the following variants: 1) top -> TOP 2) script_dir -> SCRIPT_DIR And change the following variant name: 1) RESULT -> RESULTS Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: convert: Make ext*_image file obey datacsum setting.Qu Wenruo2015-04-02
| | | | | | | | | | | | | | | | | | Before this patch, ext*_image is always set NODATACSUM inode flag. However btrfs-convert will set normal file with DATACUSM flag by default, and generate checksum for regular file extent. Now, a regular file extent is shared by a btrfs file inode with DATACSUM and ext*_image with NODATACSUM, and it has checksum in csum tree. This will cause btrfsck complain about odd checksum, since ext*_image is set NODATACSUM but has checksum generated from regular file extent. This patch makes convert completely obey datacsum setting, meaning btrfs-convert will generate csum for every file extent by default. Reported-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs doc: emphasis that only mounted device works for btrfs device statsChen Hanxiao2015-04-02
| | | | | | | | | | We provided format <path>|<device> in command line. But btrfs device stats doesn't work if device is not mounted. Also fix some tailing whitespace. Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: silence fake fsckZach Brown2015-04-02
| | | | | | | | | | | | | | | | | | | | Harald suggested that we remove the message from the fake fsck.btrfs that some distros run at boot: https://bugzilla.redhat.com/show_bug.cgi?id=1206502 "This output does not add anything, but is a disturbing element of booting up a system. It's the only message I get, when starting my system, before gdm is started." I'm inclined to agree. This makes the tiniest change to remove the message that's output for an auto invocation. My guess is that it was just copied from the xfs fsck.xfs and that no one actually cares about it. Signed-off-by: Zach Brown <zab@zabbo.net> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs progs v3.19.1David Sterba2015-03-25
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Fix autoconf handling of --enable-convertMike Gilbert2015-03-25
| | | | | | | AC_ARG_ENABLE(convert) sets $enable_convert, not $enable_btrfsconvert. Signed-off-by: Mike Gilbert <floppym@gentoo.org> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs progs v3.19.1-rc1David Sterba2015-03-24
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: mkfs, add required arguments to help stringsDavid Sterba2015-03-24
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: mkfs, align help stringsDavid Sterba2015-03-24
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: convert, add long options for all short optionsDavid Sterba2015-03-24
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Print warning message if qgroup data is inconsistentQu Wenruo2015-03-24
| | | | | | | | | | | | | | | | | Before this patch, qgroup show won't check btrfs qgroup status, so even the INCONSISTENT flags is set, user is not aware of it. This patch will include BTRFS_QGROUP_STATUS_ITEM in the search range and check the flag, if there is any flag meaning the inconsistence of qgroup data, info user. NOTE: There is several kernel bugs from INCONSISTENT flags is always set to RUNNING flags is not cleared until umount. So this warning will always be here if using a newer kernel fixing these bugs. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add stack get/set functions for btrfs_qgroup_status_itemQu Wenruo2015-03-24
| | | | | | | This provides the basis for later qgroup related changes. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Allow parse_qgroupid() to resolve subvolume path into qgroupidQu Wenruo2015-03-24
| | | | | | | | | | Now parse_qgroupid() can resolve subvolume path into qgroupid. This is quite handy for handling level 0 qgroupid, and user don't need to resolve rootid by hand now. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [constify string in __is_subvol] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Move parse_qgroupid() to utils.cQu Wenruo2015-03-24
| | | | | | Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [constified strings in parse_qgroupid] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Allow btrfs-debug-tree to print human readable qgroup status flag.Qu Wenruo2015-03-24
| | | | | | | | | | | | Now btrfs-debug-tree can print qgroup status flag as ON|INCONSISTENT instead of 0x5. BTW, this patch helped us to find a bug that INCONSISTENT flag is never cleared in kernel. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [renamed to qgroup_flags_to_str] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Update qgroup status flags and replace qgroup level/subvid ↵Qu Wenruo2015-03-24
| | | | | | | | | | | | | | calculation with inline function Ctree.h of btrfs-progs contains wrong flags for btrfs_qgroup_status. Update it with the one in kernel. Also, introduce the inline function btrfs_qgroup_(level/subvid) to get the level/subvolid of qgroup, to replace the old open-coded bit operations. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: restore, fix page alignment issue for lzo compressionGui Hecheng2015-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When runing restore under lzo compression, "bad compress length" problems are encountered. It is because there is a page alignment problem with the @decompress_lzo, as follows: |------| |----|-| |------|...|------| page ^ page page | 3 bytes left When lzo pages are compressed in memory, we will ensure that the 4 bytes length header will not cross a page boundary. There is a situation that 3 (or less) bytes are left at the end of a page, and then the 4 bytes len is stored at the start of the next page. But the @decompress_lzo doesn't go to the start of the next page and continue to read the next 4 bytes which crosses two pages, so a random value is fetched as a "bad compress length". So we check page alignment every time before we are going to fetch the next @len and after the former piece of data is decompressed. If the current page that we reach has less than 4 bytes left, then we should fetch the next @len at the start of next page. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> [simplifed and moved into decompress_lzo] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: completion: add fi and dev usage commandsDavid Sterba2015-03-23
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: convert, fix typo in getopt valueDavid Sterba2015-03-23
| | | | | | | Unfortunatelly GETOPT_VAL_IEC is not equal to GETOPT_VAL_NO_PROGRESS so --no-progress had no effect. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: convert tests: add remaining supported nodesizesDavid Sterba2015-03-23
| | | | | | That's 8k, 32k and 64k. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add nodesize test for btrfs-convertSebastian Thorarensen2015-03-23
| | | | | | | convert-tests now test both 4096 and 16384 nodesizes. Signed-off-by: Sebastian Thorarensen <sebth@naju.se> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: btrfs-convert: Allow setting nodesizeSebastian Thorarensen2015-03-23
| | | | | | | | Allow btrfs-convert to use nodesizes other than 4096. It defaults to max(16384, pagesize), like mkfs. Signed-off-by: Sebastian Thorarensen <sebth@naju.se> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Fix msgs in check_node_or_leaf_sizeSebastian Thorarensen2015-03-23
| | | | | | | | | | check_node_or_leaf_size in utils.c now prints 'nodesize (or leafsize)' instead of 'leafsize (or nodesize)' in the error messages, in order to be less confusing for the user, as leafsize in mkfs is deprecated. 'ERROR: ' is also prepended to be consistent with other error messages. Signed-off-by: Sebastian Thorarensen <sebth@naju.se> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: mkfs: Move out some nodesize codeSebastian Thorarensen2015-03-23
| | | | | | | | | | | Move the constant DEFAULT_MKFS_LEAF_SIZE to utils.h and rename it to BTRFS_MKFS_DEFAULT_NODE_SIZE for consistency. Move the function check_leaf_or_node_size to utils.c and rename it to btrfs_check_node_or_leaf_size. Signed-off-by: Sebastian Thorarensen <sebth@naju.se> [added btrfs_ prefix] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fi usage, fix reporting space for degraded mountsDavid Sterba2015-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | The total size of devices was summed from raw partition size which is wrong in two ways: - if the device is missing, the size is 0 and it mismatches the size summed from chunks, leading to bogus numbers like Device unallocated: 16.00EiB Used: 1.88TiB Free (estimated): 8.00EiB (min: 8.00EiB) - we should really account the device size that's occupied by btrfs, not the real partition size altough it's the same most of the time The sum of missing devices is now printed in the summary and any missing device path is replaced with 'missing' instead of blank: Data,RAID1: Size:972.00GiB, Used:962.15GiB 972.00GiB /dev/sdb1 972.00GiB Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94911 Reported-by: <raffix@web.de> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: re-introduce BTRFS_BUILD_VERSION in version.hLokesh Mandvekar2015-03-16
| | | | | | | | The macro is in a public header and breaks build of some applications. Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org> [edit changelog] Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs progs v3.19David Sterba2015-03-11
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: tests, common: fix typo after cleanupDavid Sterba2015-03-10
| | | | | | | The previous value for unknown was -1. Reported-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs progs v3.19-rc3David Sterba2015-03-09
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: tests, clean up scriptsDavid Sterba2015-03-09
| | | | | | | Rename variables, use caps, call true by full path, add quotation to variables and a few wording fixes. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fsck-test: Add check_sudo to check valid root/sudo privilegeQu Wenruo2015-03-09
| | | | | | | | | | | | | | | | | | | | | | Although fsck-test/012 uses sudo, it uses 'sudo -n', which won't prompt user to input password and will return 1 if no valid credential is found. And this makes test result quite annoying since it fails to mount and still continue, which will always fail. This patch will check 'sudo -v -n' and 'sudo -n true' to determine whether sudo works fine in different version/settings, since in some setting/version, 'sudo -v -n' will fail even the user is set NOPASSWD. Also, remove the 'have_root_helper' variant, since there is a possibility that sudo credential will timeout during the test and 'have_root_helper' won't help to detect such problem. New '_sudo' command will do credential check if needed to avoid such problem. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: convert, adjust help text formattingDavid Sterba2015-03-09
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: convert, add option to disable progressDavid Sterba2015-03-09
| | | | | | | | With progress turned on by default we should be able to disable it as well. Reported-by: Jérôme Poulin <jeromepoulin@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: update INSTALLDavid Sterba2015-02-27
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add more detailed package bdependency information to INSTALL fileAugusto Mecking Caringi2015-02-27
| | | | | Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: doc: clarify toplevel subvolidShriramana Sharma2015-02-27
| | | | | Signed-off-by: Shriramana Sharma <samjnaa@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Move (set/clear_)extent_buffer_uptodate() to extent_io.h.Qu Wenruo2015-02-27
| | | | | | | | Unlike kernel, these functions in userland just test/set/clear a member. So move them to header to avoid extra function call cost. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Make csum tree rebuild works with extent tree rebuild.Qu Wenruo2015-02-27
| | | | | | | | | | | | | | | | Before this patch, csum tree rebuild will not work with extent tree rebuild, since extent tree rebuild will only build up basic block groups, but csum tree rebuild needs data extents to rebuild. So if one use btrfsck with --init-csum-tree and --init-extent-tree, csum tree will be empty and tons of "missing csum" error will be outputted. This patch allows csum tree rebuild get its data from fs/subvol trees using regular file extents (which is also the only one using csum tree currently). Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [renamed to fill_csum_tree_from_one_fs_root] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: use correct the return valueFan Chengniang2015-02-27
| | | | | | | | | The return values 12 and 13 are not used spectially except as return value. No description and definition about them. so I change them to generic errno. Signed-off-by: Fan Chengniang <fancn.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: convert: show progress by defaultDavid Sterba2015-02-27
| | | | | | | Agreed by several people, showing progress by default makes sense as conversion is a one-time and long running action. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Fix a infinite loop when fixing nlink if file name conflicts twice.Qu Wenruo2015-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a case that can cause nlink fix function. For example, lost+found dir already has the following files: --------------------------- |ino |filename | |-------------------------| |258 |normal_file | |259 |normal_file.260 | --------------------------- The next inode to be fixed is the following: --------------------------- |260 |normail_file | --------------------------- And when trying to move inode to lost+found dir, its file name conflicts with inode 258, and even add ".INO" suffix, it still conflicts with inode 259. Since the move failed, the LINK_COUNT_ERR flag is not cleared, the inode record will not be freed, btrfsck will try fix it again and again, causing the infinite loop. The patch will first change the ".INO" suffix naming to a loop behavior, and clear the LINK_COUNT_ERR flag anyway to avoid infinite loop. Reported-by: Naohiro Aota <naota@elisp.net> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: docs: fixed a grammar mistakeStefan Tatschner2015-02-24
| | | | | Signed-off-by: Stefan Tatschner <stefan@sevenbyte.org> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: version.sh: simplify printing the versionDavid Sterba2015-02-13
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: autoconf: define package url manually if not setDavid Sterba2015-02-13
| | | | | | | | | | | | | | The PACKAGE_URL is set from optional parameter of AC_INIT starting in autoconf 2.64. There are enterprise distros with version 2.63, we can make the build work there easily as well. Fixes build failure: mkfs.c: In function ?main?: mkfs.c:1492: error: ?PACKAGE_URL? undeclared (first use in this function) Reported-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fix typo in OPEN_CTREE flagDavid Sterba2015-02-12
| | | | | | | Introduced in "btrfs-progs: Add new btrfs_open_ctree_flags CHUNK_ONLY" by my local fixups. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Fix 2 extent buffer leak in btrfs-debug-treeQu Wenruo2015-02-11
| | | | | | | | | | | | | | There are 2 known extent buffer leaks: 1) With -t option. -t option will skip other tree roots, but it will read the root node first and then skip it. Where it forgets to free the tree block it read. 2) with -b option. It forgets to free the tree block it read. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Move -rdynamic linker only option to LDFLAGSQu Wenruo2015-02-11
| | | | | | | | | | | Same thing as clang cleanup patch commit 040b3f11ba6b5555d793a9ef79ed4d9032d22370 "btrfs-progs: Makefile: Move linker only option to LDFLAGS" But the move to autoconfig seems using old Makefile. So do it again. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>