Commit Graph

3237 Commits (fad531e5233343e34f517e46050d860b6225dae0)
 

Author SHA1 Message Date
David Sterba 5d43dfd344 btrfs-progs: dump-tree: print missing data for file extent item
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba 069b0b6d14 btrfs-progs: dump-tree: print more root_item data
Print a few more missing items of root_item (there are still some
remaining). Drop key is printend unconditionally.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 58bef5b4a7 btrfs-progs: dump-tree: print missing dir_item data
Add items from dir_item that are not printed, plus other adjustments.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 6c849c616e btrfs-progs: dump-tree: print missing inode_item data
Add items from inode_item that are not printed.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba f1d4606a6d btrfs-progs: dump-tree: add helper to print timespec
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 58fe71f3f7 btrfs-progs: dump-tree: factor inode_item dump to function
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba cae265e816 btrfs-progs: dump-tree: print missing dev_extent data
Add items from chunk that are not printed, unify names according to
the member names and reorder a bit.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba c6cd8ff6ec btrfs-progs: dump-tree: print missing chunk data
Add items from chunk that are not printed, unify names according to
the member names and reorder a bit.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 20ba2993a5 btrfs-progs: dump-tree: print missing dev_item data
Add items from dev_item that are not printed, unify names according to
the member names.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba d4aa2bc07e btrfs-progs: subvol show: print more details about toplevel subvolume
The toplevel subvolume is special and the other listing code leaves it
out so we have to add several special cases to handle it. There's no
backreference so the path is built artificially. New helper
btrfs_get_toplevel_subvol is a reduced version of btrfs_get_subvol.

There's some information usually missing for the toplevel subvolume, eg.
the uuid or creation info. This has to be fixed on the mkfs side, the
other subvolumes are created by kernel.

Example:
/mnt
        Name:                   <FS_TREE>
        UUID:                   -
        Parent UUID:            -
        Received UUID:          -
        Creation time:          -
        Subvolume ID:           5
        Generation:             233
        Gen at creation:        0
        Parent ID:              0
        Top level ID:           0
        Flags:                  -
        Snapshot(s):
                                subv1

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba eb28e2fcae btrfs-progs: subvol list: better error message if subvol insertion fails
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba fc82ce45dc btrfs-progs: subvol list: remove ugly goto construct
Jumping into an if is not considered nice.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba f4ea2ec981 btrfs-progs: remove trivial helper root_lookup_init
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 65b2f81d77 btrfs-progs: subvol list: consolidate uuid types accross functions
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba e573142d37 btrfs-progs: subvol list: add simplified helper for adding root backrefs
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 1aeb6baee3 btrfs-progs: subvol list: consilidate naming of otime varaibles
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba ebb46b13ac btrfs-progs: subvol list: simplify value assignments
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 37bc144172 btrfs-progs: subvol list: remove useless comments
The search ioctl follows a well known usage pattern.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba f52b559873 btrfs-progs: subvol list: cleanup layout argument setup
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba f1f478ff7b btrfs-progs: return void from btrfs_list_setup_filter
As an early setup function, failure uisng exit is ok.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 8df2d94bf9 btrfs-progs: subvol list: setup list filters later
First check for arguments and whether we can open the filesystem.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 4383bf0c29 btrfs-progs: list: switch to common message helpers
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 8a6a42cd42 btrfs-progs: list: rename some helpers
Using _volume_ is confusing, it's for subvolumes.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba f4556df015 btrfs-progs: use enum for list layout type
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 2c7dc8e210 btrfs-progs: list: constify prefix arugment
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba bcdb7058aa btrfs-progs: use symbolic tree name when searching
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba 1fa9cc4991 btrfs-progs: remove leading underscores from several helper
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:28 +01:00
David Sterba a1f6c59887 btrfs-progs: opencode trivial helper __free_all_subvolumn
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:28 +01:00
David Sterba 1c85c3de5a btrfs-progs: use existing rootid resolving helper in btrfs_list_get_path_rootid
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>
2016-11-09 13:47:28 +01:00
David Sterba 49cb98e5d6 btrfs-progs: rename lookup_ino_rootid
It does not resolve the inode number but path where fd has been opened.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:28 +01:00
David Sterba 3fe243296d btrfs-progs: remove unused function btrfs_get_path_rootid
Last user replaced with a more appropriate helper.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:28 +01:00
David Sterba f2744dbc93 btrfs-progs: qgroups show: handle errors when resolving root id
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>
2016-11-09 13:47:28 +01:00
Qu Wenruo 4dc315e68a btrfs-progs: remove send-test tool
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>
2016-11-09 13:47:28 +01:00
Roman Lebedev 324566bd1a btrfs-progs: Add travis CI build support
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>
2016-11-09 13:47:26 +01:00
David Sterba 365c2de3bc btrfs-progs: convert: switch more messages to common helpers
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:13:52 +01:00
Tsutomu Itoh 6d4fb3dcc1 btrfs-progs: send: fix handling of multiple snapshots (-p option)
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>
2016-11-09 13:13:47 +01:00
Qu Wenruo cf5a680b82 btrfs-progs: Ignore clang complete file
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>
2016-11-09 13:13:41 +01:00
David Sterba c8d1c4c792 btrfs-progs: tests: switch to dump- commands from inspect
The dump-super and debug-tree commands are replacements for the
standalone tools.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:13:37 +01:00
Qu Wenruo 40de2f6279 btrfs-progs: fsck-tests: Check if clear space cache works
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>
2016-11-09 13:12:49 +01:00
Qu Wenruo eb8a61b235 btrfs-progs: check: add support to clear v1 free space cache
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>
2016-11-09 13:12:47 +01:00
David Sterba 08d31c1c7c
Btrfs progs v4.8.2
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-26 19:43:34 +02:00
David Sterba 2690dc5640 btrfs-progs: update CHANGES for v4.8.2
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-25 14:31:44 +02:00
Goldwyn Rodrigues a7ec18a864 btrfs-progs: check: release path after usage
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>
2016-10-25 14:31:06 +02:00
Qu Wenruo ffb1b847bd btrfs-progs: Fix wrong tree block alignment for unalianged block group
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>
2016-10-25 14:31:06 +02:00
David Sterba b2fbfc8cdd btrfs-progs: ioctl: fix build failure if BUILD_ASSERT is not defined
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>
2016-10-25 14:28:36 +02:00
Lu Fengqi 36d02f3eb8 btrfs-progs: move btrfs_extref_hash() to hash.h
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>
2016-10-25 14:28:36 +02:00
Tsutomu Itoh 876db7f50c btrfs-progs: send: remove unnecessary code
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>
2016-10-25 14:28:36 +02:00
David Sterba a0fabf5f1d btrfs-progs: dump-tree: fix crash on unrecognized tree id
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-25 14:28:36 +02:00
Karel Zak dcc3df7e6d btrfs-progs: rename btrfs_scan_lblkid() to btrfs_scan_devices()
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>
2016-10-25 14:28:36 +02:00
David Sterba cf8fd1a708 btrfs-progs: build: detect fiemap shared flag but don't fail build
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>
2016-10-25 14:28:36 +02:00