summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* btrfs-progs: subvol list: remove ugly goto constructDavid Sterba2016-11-09
| | | | | | Jumping into an if is not considered nice. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove trivial helper root_lookup_initDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: subvol list: consolidate uuid types accross functionsDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: subvol list: add simplified helper for adding root backrefsDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: subvol list: consilidate naming of otime varaiblesDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: subvol list: simplify value assignmentsDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: subvol list: remove useless commentsDavid Sterba2016-11-09
| | | | | | The search ioctl follows a well known usage pattern. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: subvol list: cleanup layout argument setupDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: return void from btrfs_list_setup_filterDavid Sterba2016-11-09
| | | | | | As an early setup function, failure uisng exit is ok. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: subvol list: setup list filters laterDavid Sterba2016-11-09
| | | | | | First check for arguments and whether we can open the filesystem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: list: switch to common message helpersDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: list: rename some helpersDavid Sterba2016-11-09
| | | | | | Using _volume_ is confusing, it's for subvolumes. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use enum for list layout typeDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: list: constify prefix arugmentDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use symbolic tree name when searchingDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove leading underscores from several helperDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: opencode trivial helper __free_all_subvolumnDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use existing rootid resolving helper in btrfs_list_get_path_rootidDavid Sterba2016-11-09
| | | | | | | | The utils helper is not verbose in case of an error, for now the helper used for subvolume listing will print the error message but not duplicate the ioctl anymore. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: rename lookup_ino_rootidDavid Sterba2016-11-09
| | | | | | It does not resolve the inode number but path where fd has been opened. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove unused function btrfs_get_path_rootidDavid Sterba2016-11-09
| | | | | | Last user replaced with a more appropriate helper. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: qgroups show: handle errors when resolving root idDavid Sterba2016-11-09
| | | | | | | If btrfs_get_path_rootid fails, prints an error message but continues. Replace with a helper that returns an error. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove send-test toolQu Wenruo2016-11-09
| | | | | | | | Since new "receive --dump" has better output and structure, it's time to remove old and function-weak send-test tool. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Add travis CI build supportRoman Lebedev2016-11-09
| | | | | | | | | Automated build checks for the devel branch and integration to coverity, using travis.org. Roman's initial .yml version has been adjusted for btrfs-progs needs. Author: Roman Lebedev <lebedev.ri@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: switch more messages to common helpersDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: send: fix handling of multiple snapshots (-p option)Tsutomu Itoh2016-11-09
| | | | | | | | | | | | | | | | | | | | We cannot send multiple snapshots at once by -p option. [before] # btrfs send -f /tmp/data0 -p Snap0 Snap[12] At subvol Snap1 At subvol Snap2 ERROR: parent determination failed for 0 # [after] # btrfs send -f /tmp/data0 -p Snap0 Snap[12] At subvol Snap1 At subvol Snap2 # Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Ignore clang complete fileQu Wenruo2016-11-09
| | | | | | | | | | | | While most guys are using ctags and cscope with vim, new completion tool like vim-clang_completion is gaining its popularity, due to its compiler level accuracy simpleness to use. Since ctags and cscope are already in .gitignore, I see no reason to reject .clang_complete. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: switch to dump- commands from inspectDavid Sterba2016-11-09
| | | | | | | The dump-super and debug-tree commands are replacements for the standalone tools. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fsck-tests: Check if clear space cache worksQu Wenruo2016-11-09
| | | | | | | Add test case to check the basic function of --clear-space-cache. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: add support to clear v1 free space cacheQu Wenruo2016-11-09
| | | | | | | | | | | | | | | | Kernel clear_cache mount option will only rebuild free space cache if the used space of that chunk has changed. So it won't ensure any corrupted free space cache get cleared. So add a new option "--clear-space-cache v1|v2" to btrfsck, to completely wipe out free space cache. So kernel won't complain again. Reported-by: Ivan P <chrnosphered@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ adjusted error messages, doc wording changes ] Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.8.2David Sterba2016-10-26
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: update CHANGES for v4.8.2David Sterba2016-10-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: release path after usageGoldwyn Rodrigues2016-10-25
| | | | | | | | While performing an fsck, an assertion failure occurs because of reusing path in a loop. ctree.c:1112: btrfs_search_slot: Warning: assertion `p->nodes[0] != NULL` failed, value 0 Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Fix wrong tree block alignment for unalianged block groupQu Wenruo2016-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 854437ca(btrfs-progs: extent-tree: avoid allocating tree block that crosses stripe boundary) introduces check for logical bytenr not crossing stripe boundary. However that check is not completely correct. It only checks if the logical bytenr and length agaist absolute logical offset. That's to say, it only check if a tree block lies in 64K logical stripe. But in fact, it's possible a block group starts at bytenr unaligned with 64K, just like the following case. Then btrfsck will give false alert. 0 32K 64K 96K 128K 160K ... |--------------- Block group A --------------------- |<-----TB 32K------>| |/Scrub stripe unit/| | WRONG UNIT | In that case, TB(tree block) at bytenr 32K in fact fits into the kernel scrub stripe unit. But doesn't fit into the pure logical 64K stripe. Fix check_crossing_stripes() to compare bytenr to block group start, not to absolute logical bytenr. Reported-by: Jussi Kansanen <jussi.kansanen@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: ioctl: fix build failure if BUILD_ASSERT is not definedDavid Sterba2016-10-25
| | | | | | | | | | | | The build fails if ioctl.h is included without kerncompat.h which defines BUILD_ASSERT, as reported. The proposed patches add kerncompat.h but I don't want to pull that header via ioctl.h, so the fix will provide an empty macro instead. Reported-by: Eric Sandeen <sandeen@redhat.com> Reported-by: Sergei Trofimovich <slyfox@gentoo.org> Reported-by: Mikhail Pukhlikov <cynede@gentoo.org> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move btrfs_extref_hash() to hash.hLu Fengqi2016-10-25
| | | | | | | | Move btrfs_extref_hash() from inode-item.c to hash.h, so that the function can be called elsewhere. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
* btrfs-progs: send: remove unnecessary codeTsutomu Itoh2016-10-25
| | | | | | | | | | Some unnecessary codes are deleted. - the setting of subvol is duplicated - read only check was already done by the previous loop Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: fix crash on unrecognized tree idDavid Sterba2016-10-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: rename btrfs_scan_lblkid() to btrfs_scan_devices()Karel Zak2016-10-25
| | | | | | | | | It seems like bad idea to use a library name (lblkid) within generic function name. The currently used scanning library is implementation detail and this detail should be hidden for rest of the code. Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: build: detect fiemap shared flag but don't fail buildDavid Sterba2016-10-25
| | | | | | | | | | | | | | The FIEMAP_EXTENT_SHARED fiemap flag was introduced in 2.6.33. If the headers do not provide the definition, the build will fail. The support of the fiemap sharing depends on the running kernel. There are still systems with 2.6.32 kernel headers but running newer versions. To support such environment, don't fail build, provide own defintion of the structure and detect if there's an old kernel in use in the relevant command (btrfs fi du). Reported-by: Abhay Sachan <lkp.abhay@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: detect version of running kernelDavid Sterba2016-10-25
| | | | | | Use the uname syscall and parse the string. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: volumes: Remove BUG_ON in raid56 write routineQu Wenruo2016-10-25
| | | | | | | | | | | | | | | | | | Remove various BUG_ON in raid56 write routine, including: 1) Memory allocation error Old codes allocates memory when code needs new memory in a loop, and catch the error using BUG_ON(). New codes allocates memory in a allocation loop first, if any failure is caught, freeing already allocated memories then throw -ENOMEM. 2) Write error Change BUG_ON() to correct return value. 3) Validation check Same as write error. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: rename raid6.c to raid56.cQu Wenruo2016-10-24
| | | | | | | | This allows us to put raid5 codes into that file other than creating a new raid5.c. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: Add image for quota verify stack overflowQu Wenruo2016-10-24
| | | | | | | | | | | | | For image with tree reloc tree, if its height is over level 2, the root node's backref will point to itself. It's valid for kernel, but quota verify code can't handle it and cause a infinite call, overflowing the stack. Add minimal image to reproduce the bug, as regression test. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ minor cleanups in test.sh ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: test: Add test image for btrfsck qgroup rescan detectionQu Wenruo2016-10-24
| | | | | | | | | | | Fixed by commit 7c646c538e74 btrfs-progs: qgroup: Fix regression leads to corrupted qgroup status. Add minimal test image for that fix. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ minor cleanups in test.sh ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Fix stack overflow for checking qgroup on tree reloc treeQu Wenruo2016-10-24
| | | | | | | | | | | | | | | | | For tree reloc tree whose level is >= 2, the root node's parent will point to itself. In this case it will make btrfsck overflow its stack and cause segfault. While for tree reloc tree, it doesn't affect qgroup and kernel can handle it well. So add tree reloc tree check for qgroup-verify.c and fix the bug. Test case will follow soon after I make a minimal image for it. Current xz ziped image is still over 10M for a 512M fs. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: fix compiler warningTsutomu Itoh2016-10-24
| | | | | | | | | | | | | | | | In v4.8-rc1, gcc 5.3.1 gives following warning. Fixed it. [CC] btrfs-image.o btrfs-image.c: In function 'flush_pending': btrfs-image.c:708:17: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized] header->bytenr = cpu_to_le64(start); ^ btrfs-image.c:927:6: note: 'start' was declared here u64 start; ^ Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert-test: Add test case for common inode flagsQu Wenruo2016-10-24
| | | | | | | | | Add a new test case to check if btrfs-convert copies common inode flags like append(a), immutable(i). Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ minor fixes ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Convert ext inode flags to btrfs inode flagsQu Wenruo2016-10-24
| | | | | | | | | | | | | | | Before this patch, btrfs-convert never copy ext* inode flags to corresponding btrfs inode flags. This makes common flags like APPEND/SYNC/SYNCDIR/IMMUTABLE not copied to btrfs inode. This patch introduces ext2_convert_inode_flags() function to handle the convert, so btrfs-convert can copy as many inode flags as possible. Reported-by: Lakshmipathi.G <lakshmipathi.g@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Make btrfs-debug-tree print all readable strings for inode flagsQu Wenruo2016-10-24
| | | | | | | | | | | | Before this patch, only 3 inode flags have readable string: NODATACOW, NODATASUM, READONLY. This patch will output all readable strings for remaining inode flags, making debug-tree tool more handy. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ minor adjustments ] Signed-off-by: David Sterba <dsterba@suse.com>
* 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>