summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfs-progs: docs: make option -A of mkfs less visibleDavid Sterba2018-01-03
| | | | | | | The option will be removed in the future, move it to the end of the list. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: specify minimal library version for reiserfs supportDavid Sterba2018-01-03
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi defrag: clean up duplicate code if find errorsSu Yue2018-01-03
| | | | | | | | | | In function cmd_filesystem_defrag(), lines of code for error handling are duplicate and hard to expand in further. Create a jump label for errors. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: Only zero out the first 1M for rootdirQu Wenruo2018-01-03
| | | | | | | | | It's a waste of IO to fill the whole image before creating btrfs on it, just wiping the first 1M, and then write 1 byte to the last position to create a sparse file. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: Enhance minimal device size calculation to fix mkfs ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | failure on small file Since commit c11e36a29e84 ("Btrfs-progs: Do not force mixed block group creation unless '-M' option is specified"), mkfs no longer use mixed block group unless specified manually. This breaks the minimal device size calculation, which only considered mixed block group use case. This patch enhances minimal device size calculation for mkfs, by using different minimal stripe length (calculated from code) for different profiles, and use them to calculate minimal device size. Reported-by: Wesley Aptekar-Cassels <W.Aptekar@gmail.com> Fixes: c11e36a29e84 ("Btrfs-progs: Do not force mixed block group creation unless '-M' option is specified") Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> [ updated comments ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/common: Enhance prepare_test_dev to reset device sizeQu Wenruo2018-01-03
| | | | | | | | | So prepare_test_dev() can be called several times in one test case, to test different device sizes. Signed-off-by: Qu Wenruo <wqu@suse.com> [ switch to [ ] ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/common: Introduce run_mustfail_stdoutQu Wenruo2018-01-03
| | | | | | | For later test case which needs info from stderr. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix typos in test namesDavid Sterba2018-01-03
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: check the status of file at mkfsMisono, Tomohiro2018-01-03
| | | | | | | | | | | | | Currently, only the status of block devices is checked at mkfs, but we should also check for regular files whether they are already formatted or mounted to prevent overwrite accidentally. Device status is checked by test_dev_for_mkfs(). The part which is not related to block device is split from this and used for both block device and regular file. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: mkfs/008 mkfs with forceDavid Sterba2018-01-03
| | | | | | | With extended tests in the following patch a file based filesystem image also needs -f, otherwise it will fail. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/fsck/021: Cleanup custom check by overriding check_imageQu Wenruo2018-01-03
| | | | | | Signed-off-by: Qu Wenruo <wqu@suse.com> [ update comment ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/fsck/020: Cleanup custom check function by overriding ↵Qu Wenruo2018-01-03
| | | | | | | check_image function Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test/fsck: Introduce test images containing tree reloc treeQu Wenruo2018-01-03
| | | | | | | | | | | | | Reloc tree is a special tree with very short life span. It acts as a special snapshot for any tree, with related nodes/leaves or EXTENT_DATA modified to point to new position. Considering the short life span and its special purpose, it should be quite reasonable to keep them as both corner case for fsck and educational dump for anyone interested in relocation. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Reword an unclear error message about file extent gapLu Fengqi2018-01-03
| | | | | | | | This error occurs when no_holes is not set, but there is a gap before the file extent. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: update btrfs-subvolume manual pageHoward2018-01-03
| | | | | | | | | To simplify, I suggest moving the 'writable/readonly' issue only to the -r line, instead of having it introduced in two places. Pull-request: #80 Author: Howard <hwj@BridgeportContractor.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump_tree: remove superfluous _TREEHans van Kranenburg2018-01-03
| | | | | | | | | | | | | -# btrfs inspect-internal dump-tree -t fs /dev/block/device ERROR: unrecognized tree id: fs Without this fix I can't dump-tree fs, but I can dump-tree fs_tree and also fs_tree_tree, which is a bit silly. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Hans van Kranenburg <hans@knorrie.org> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: enable check lowmem in travis CIDavid Sterba2018-01-03
| | | | | | | | We missed some regressions because the lowmem mode was not run in the CI tests. This is partially due to the incomplete implementation but we have exceptions for the --repair mode in the tests. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-tests: Introduce test case with keyed data backref with ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | shared tree blocks For snapshot shared tree blocks with source subvolume, the keyed backref counter only counts the exclusive owned references. In the following case, 258 is a snapshot of 257, which inherits all the reference to this data extent. ------ item 4 key (12582912 EXTENT_ITEM 524288) itemoff 3741 itemsize 140 refs 179 gen 9 flags DATA extent data backref root 257 objectid 258 offset 0 count 49 extent data backref root 257 objectid 257 offset 0 count 1 extent data backref root 256 objectid 258 offset 0 count 128 extent data backref root 256 objectid 257 offset 0 count 1 ------ However lowmem mode used to iterate the whole inode to find all references, and doesn't care if a reference is already counted by the shared tree block. Add the test case to check it. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Fix false alerts of referencer count mismatch for ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snapshot Btrfs lowmem check reports such false alerts: ------ ERROR: extent[366498091008, 134217728] referencer count mismatch (root: 827, owner: 73782, offset: 134217728) wanted: 4, have: 26 ERROR: extent[366498091008, 134217728] referencer count mismatch (root: 818, owner: 73782, offset: 134217728) wanted: 4, have: 26 ERROR: extent[366498091008, 134217728] referencer count mismatch (root: 870, owner: 73782, offset: 134217728) wanted: 4, have: 26 ------ While in extent tree, the extent has: ------ item 81 key (366498091008 EXTENT_ITEM 134217728) itemoff 9008 itemsize 169 refs 39 gen 224 flags DATA extent data backref root 827 objectid 73782 offset 134217728 count 4 extent data backref root 818 objectid 73782 offset 134217728 count 4 extent data backref root 259 objectid 73482 offset 134217728 count 1 extent data backref root 644 objectid 73782 offset 134217728 count 26 extent data backref root 870 objectid 73782 offset 134217728 count 4 ------ And in root 827, there is one leaf with 4 references to that extent which is owned by 827: ------ leaf 714964992 items 68 free space 10019 generation 641 owner 827 leaf 714964992 flags 0x1(WRITTEN) backref revision 1 ...... item 64 key (73782 EXTENT_DATA 134217728) itemoff 11878 itemsize 53 generation 224 type 1 (regular) extent data disk byte 366498091008 nr 134217728 extent data offset 0 nr 6410240 ram 134217728 extent compression 0 (none) item 65 key (73782 EXTENT_DATA 140627968) itemoff 11825 itemsize 53 generation 224 type 1 (regular) extent data disk byte 366498091008 nr 134217728 extent data offset 6410240 nr 5120000 ram 134217728 extent compression 0 (none) item 66 key (73782 EXTENT_DATA 145747968) itemoff 11772 itemsize 53 generation 224 type 1 (regular) extent data disk byte 366498091008 nr 134217728 extent data offset 11530240 nr 7675904 ram 134217728 extent compression 0 (none) item 67 key (73782 EXTENT_DATA 153423872) itemoff 11719 itemsize 53 generation 224 type 1 (regular) extent data disk byte 366498091008 nr 134217728 extent data offset 19206144 nr 6397952 ram 134217728 extent compression 0 (none) ------ And starts from next leaf, there are 22 references to the data extent: ------ leaf 894861312 items 208 free space 59 generation 261 owner 644 leaf 894861312 flags 0x1(WRITTEN) backref revision 1 item 0 key (73782 EXTENT_DATA 159821824) itemoff 16230 itemsize 53 generation 224 type 1 (regular) extent data disk byte 366498091008 nr 134217728 extent data offset 25604096 nr 8192 ram 134217728 extent compression 0 (none) item 1 key (73782 EXTENT_DATA 159830016) itemoff 16177 itemsize 53 generation 224 type 1 (regular) extent data disk byte 366498091008 nr 134217728 extent data offset 25612288 nr 7675904 ram 134217728 extent compression 0 (none) ...... ------ However the next leaf is owned by other subvolume, normally owned by (part of) the snapshot source. Fix it by also checking the leaf's owner before increasing the reference counter. Reported-by: Chris Murphy <chris@colorremedies.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-test: Add new image with shared block ref only metadata ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | backref The image is dumped by modifying kernel to sleep long enough before merging relocation trees, so we can just copy the whole image to other place before kernel begins to merge reloc trees. And the base image is created by the following script to bump metadata size: ------ dev=~/test.img mnt=/mnt/btrfs umount $mnt &> /dev/null fallocate -l 128M $dev mkfs.btrfs -f -n 4k -m single -d single $dev mount $dev $mnt -o nospace_cache,max_inline=2048 btrfs subvolume create $mnt/src for i in $(seq -w 0 128); do xfs_io -f -c "pwrite 0 2k" $mnt/src/file_$i > /dev/null done for i in $(seq -w 0 64); do btrfs subvolume snapshot $mnt/src/ $mnt/snapshot_$i touch $mnt/snapshot_$i/new done sync ------ The image triggers several corner cases that the old lowmem mode didn't consider. Like metadata backref with FULL_BACKREF flag and only SHARED_BLOCK_REF backrefs for metadata. And several tree reloc trees with shared leaves/nodes to confuse old lowmem mode. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Fix false alerts for image with shared block ref ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | only backref [BUG] For image with shared block ref only metadata item like: ------ item 66 key (21573632 METADATA_ITEM 0) itemoff 3971 itemsize 24 refs 66 gen 9 flags TREE_BLOCK|FULL_BACKREF tree block skinny level 0 item 0 key (21573632 SHARED_BLOCK_REF 21676032) itemoff 3995 itemsize 0 shared block backref item 1 key (21573632 SHARED_BLOCK_REF 21921792) itemoff 3995 itemsize 0 shared block backref item 2 key (21573632 SHARED_BLOCK_REF 21995520) itemoff 3995 itemsize 0 shared block backref item 3 key (21573632 SHARED_BLOCK_REF 22077440) itemoff 3995 itemsize 0 shared block backref ... ------ Lowmem mode check will report false alerts like: ------ ERROR: extent[21573632 4096] backref lost (owner: 256, level: 0) ------ [CAUSE] In fact, the false alerts are not even from extent tree verfication, but a fs tree helper which is designed to make sure there is some tree block referring to the fs tree block. The idea is to find inlined tree backref then keyed TREE_BLOCK_REF_KEY. However it missed SHARED_BLOCK_REF_KEY, and caused such false alert. [FIX] Add SHARED_BLOCK_REF_KEY to make the warning shut up. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Fix function call stack overflow caused by wrong ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | tree reloc tree detection For reloc tree root, its backref points to itself. So for such case, we should finish the lookup. Previous end condition is to ensure it's reloc tree *and* needs its root bytenr to match the bytenr passed in. However the @root passed can be another tree, e.g. other tree reloc root which shares the node/leaf. This makes any check based on @root passed in invalid. The patch removes the unreliable root objectid detection, and only uses root->bytenr check. For the possibility of invalid self-pointing backref, extent tree checker should have already handled it, so we don't need to bother in fs tree checker. Fixes: 54c8f9152fd9 ("btrfs-progs: check: Fix lowmem mode stack overflow caused by fsck/023") Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: backref: Allow backref walk to handle direct parent refQu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [BUG] Btrfs lowmem mode fails with the following ASSERT() on certain valid image. ------ backref.c:466: __add_missing_keys: Assertion `ref->root_id` failed, value 0 ------ [REASON] Lowmem mode uses btrfs_find_all_roots() when walking down fs trees. However if a tree block with only shared parent backref like below, backref code from btrfs-progs doesn't handle it correct. ------ item 72 key (604653731840 METADATA_ITEM 0) itemoff 13379 itemsize 60 refs 4 gen 7198 flags TREE_BLOCK|FULL_BACKREF tree block skinny level 0 shared block backref parent 604498477056 shared block backref parent 604498460672 shared block backref parent 604498444288 shared block backref parent 604498411520 ------ Such shared block ref is *direct* ref, which means we don't need to solve its key, nor its rootid. As the objective of backref walk is to find all direct parents until it reaches tree root. So for such direct ref, it should be pended to pref_stat->pending, other than pending it to pref_stat->pending_missing_key. [FIX] For direct ref, pending it to pref_state->pending directly to solve the problem. Reported-by: Chris Murphy <chris@colorremedies.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-test: Introduce test case for false data extent backref lostQu Wenruo2018-01-03
| | | | | | | | | | | Introduce a new test image, which has an extent item with no inlined extent data ref, but all keyed extent data ref. Only in this case we can trigger fase data extent backref lost bug in lowmem mode. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Fix false backref lost warning for keyed extent ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | data ref For keyed extent ref, its offset is calculated offset (file offset - file extent offset), just like inlined extent data ref. However the code is using file offset to hash extent data ref offset, causing false backref lost warning like: ------ ERROR: data extent[16913485824 7577600] backref lost ------ Fixes: b0d360b541f0 ("btrfs-progs: check: introduce function to check data backref in extent tree") Reported-by: Chris Murphy <chris@colorremedies.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Fix inlined data extent ref lookupQu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | When lowmem fsck tries to find backref of a specified file extent, it searches inlined data ref first. However, extent data ref contains both owner root objectid, inode number and calculated offset (file offset - extent offset). The code only checks owner root objectid, not checking inode number nor calculated offset. This makes lowmem mode fail to detect any backref mismatch if there is a inlined data ref with the same owner objectid. Fix it by also checking extent data ref's objectid and offset. Fixes: b0d360b541f0 ("btrfs-progs: check: introduce function to check data backref in extent tree") Reported-by: Chris Murphy <chris@colorremedies.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Fix NULL pointer access caused by large tree ↵Qu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | reloc tree [BUG] v4.14 btrfs-progs can't pass new self test image with large tree reloc trees. It will fail with later "shared_block_ref_only.raw.xz" test image with NULL pointer access. [CAUSE] For image with higher (level >= 2) tree reloc tree, for function need_check() its ulist will be empty as tree reloc tree won't be accounted in btrfs_find_all_roots(). Then accessing ulist->roots with rb_first() will return NULL pointer. [FIX] For need_check() function, if @roots is empty, meaning it's a tree reloc tree, always check them. Although this can be slow, but at least it's safe that we won't skip any possible wrong tree block. Fixes: 5e2dc770471b ("btrfs-progs: check: skip shared node or leaf check for low_memory mode") Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Fix regression which screws up extent allocatorQu Wenruo2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [BUG] Commit 723427d7e6b7 ("btrfs-progs: check: change the way lowmem mode traverses metadata") introduces a regression which could make some fsck self test case to fail. For fsck test case 004-no-dir-item, btrfs check --mode=lowmem --repair can cause BUG_ON() with ret = -17 (-EEXIST) when committing transaction. The problem happens with the following backtrace: ./btrfs(+0x22045)[0x555d0dade045] ./btrfs(+0x2216f)[0x555d0dade16f] ./btrfs(+0x29df1)[0x555d0dae5df1] ./btrfs(+0x2a142)[0x555d0dae6142] ./btrfs(btrfs_alloc_free_block+0x78)[0x555d0dae6202] ./btrfs(__btrfs_cow_block+0x177)[0x555d0dad00a2] ./btrfs(btrfs_cow_block+0x116)[0x555d0dad05a8] ./btrfs(commit_tree_roots+0x91)[0x555d0db1fd4f] ./btrfs(btrfs_commit_transaction+0x18c)[0x555d0db20100] ./btrfs(btrfs_fix_super_size+0x190)[0x555d0db005a4] ./btrfs(btrfs_fix_device_and_super_size+0x177)[0x555d0db00771] ./btrfs(cmd_check+0x1757)[0x555d0db4f6ab] ./btrfs(main+0x138)[0x555d0dace5dd] /usr/lib/libc.so.6(__libc_start_main+0xea)[0x7fa5e4613f6a] ./btrfs(_start+0x2a)[0x555d0dacddda] The bug is triggered by that, extent allocator considers range [29360128, 29376512) as free and allocates it. However when inserting EXTENT_ITEM, btrfs finds there is already one tree block (fs tree root), returning -EEXIST and causing the later BUG_ON(). [CAUSE] The cause is in repair mode, lowmem check always pins all metadata blocks. However pinned metadata blocks will be unpined when transaction commits, and will be marked as *FREE* space. So later extent allocator will consider such range free and allocates them incorrectly. [FIX] Don't pin metadata blocks without valid reason or preparation (like discard all free space cache to re-calculate free space on next write). Fixes: 723427d7e6b7 ("btrfs-progs: check: change the way lowmem mode traverses metadata") Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fix build of btrfs-show-superDavid Sterba2018-01-03
| | | | | | | | | The standalone utility btrfs-show-super has been obsoleted by 'btrfs inspect-internal dump-super' but it's still in the repository and should build in case somebody still uses it. Reported-by: "John L. Center" <jlcenter15@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print c/o/s/r time of ROOT_ITEMMisono, Tomohiro2018-01-03
| | | | | | | | | | Currently ctime/otime/stime/rtime of ROOT_ITEM are not printed in print_root_item(). Fix this and print them if the values are not zero. The function print_timespec() is moved forward to reuse. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix path for travis helper scriptDavid Sterba2018-01-03
| | | | | | | | The helper script ./travis-should-run-test has been moved to a directory in 4.13.3 but the path in the config was not updated. This was not caught in the CI environment and the tests did not report a failure. Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.14David Sterba2017-11-20
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update CHANGES for v4.14David Sterba2017-11-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: move the rescue fix-device-size command and updateDavid Sterba2017-11-14
| | | | | | | The subcommands are supposed to be in alphabetical order, move it to the right spot and reword. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: mention library dependency for reiserfsDavid Sterba2017-11-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: require libzstd support by defaultDavid Sterba2017-11-14
| | | | | | | | The kernel 4.14 supports zstd, for version parity the btrfs-progs now require libzstd by default. This can still be disabled by ./configure --disable-zstd. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: add missing types headerBaruch Siach2017-11-14
| | | | | | | | | | | | | | | | | Build with musl libc needs the sys/types.h header for the dev_t type, since this header is not included indirectly. This fixes the following build failure: In file included from convert/source-fs.c:23:0: ./convert/source-fs.h:112:1: error: unknown type name ‘dev_t’ dev_t decode_dev(u32 dev); ^~~~~ convert/source-fs.c:31:1: error: unknown type name ‘dev_t’ dev_t decode_dev(u32 dev) ^~~~~ Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: Print offset as tree objectid for ROOT_ITEMQu Wenruo2017-11-14
| | | | | | | | | | | | | | | | | | | | | For cases like reloc trees and subvolume trees, their key offset is the tree id. The key will be printed as: (TREE_RELOC ROOT_ITEM 18446744073709551607) The negative number is long and even guys with real engineer brains can't easily get the meaning. This patch will change the output format to: (TREE_RELOC ROOT_ITEM DATA_RELOC_TREE) While for special offset value like 0 or (u64)-1, it's still shown as is. Signed-off-by: Qu Wenruo <wqu@suse.com> [ reword comment ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: qgroup: split update_qgroup to reduce argumentsLu Fengqi2017-11-14
| | | | | | | | | The function update_qgroup has too many arguments that are too difficult to use. Therefore, split it to update_qgroup_info, update_qgroup_limit, update_qgroup_relation. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: qgroup: cleanup the redundant function add_qgroupLu Fengqi2017-11-14
| | | | | | | | | | There are reusable parts between update_qgroup and add_qgroup. So introduce the function get_or_add_qgroup and use update_qgroup instead of add_qgroup. No functional changes. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: Add test image for lowmem mode referencer count mismatch ↵Lu Fengqi2017-11-14
| | | | | | | | | | | false alert Add a image which can reproduce the extent item referencer count mismatch false alert for lowmem mode. Reported-by: Marc MERLIN <marc@merlins.org> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Fix false alert about referencer count mismatchLu Fengqi2017-11-14
| | | | | | | | | | The normal back reference counting doesn't care about the extent referred by the extent data in the shared leaf. The check_extent_data_backref function need to skip the leaf that owner mismatch with the root_id. Reported-by: Marc MERLIN <marc@merlins.org> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: lowmem check: Output more detailed information about file ↵Lu Fengqi2017-11-14
| | | | | | | | | | extent interrupt Make lowmem mode output more detailed information about file extent interrupt. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: Add test image for lowmem mode file extent interruptLu Fengqi2017-11-14
| | | | | | | | Add a image that the inlined extent coexist with the regular extent. Reported-by: Marc MERLIN <marc@merlins.org> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: add note about mount option applicabilityDavid Sterba2017-11-14
| | | | | | Copied from https://btrfs.wiki.kernel.org/index.php/Mount_options . Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: add impact of atime/noatimeDavid Sterba2017-11-14
| | | | | | | Copy from wiki https://btrfs.wiki.kernel.org/index.php?title=Mount_options Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: update mount optionsDavid Sterba2017-11-14
| | | | | | Enhance the text, update for 4.14, sync with existing wiki page. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: correct grammarBenjamin Peterson2017-11-14
| | | | | Signed-off-by: Benjamin Peterson <bp@benjamin.pe> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: extend fsck/028 to test fix-device-size and mountDavid Sterba2017-11-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests/fsck: Add test case image for 'rescue fix-dev-size'Qu Wenruo2017-11-14
| | | | | | | | | | | | | | | | The image has 2 problems mixed: 1) Too small super total_bytes This super total_bytes is manually modified to create such problem. 2) Unaligned dev item total_bytes This is created by v4.12 kernel, with 128M + 2K device added, and original device removed. Then we can create such image with unaligned dev item total_bytes. Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>