Commit Graph

2400 Commits

Author SHA1 Message Date
David Sterba
ac45d64c04 btrfs-progs: tests: add missing prerequisites
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:16:11 +01:00
David Sterba
4b9d4fe00f btrfs-porgs: fi usage: rename variable to avoid shadowing
Reported by gcc -Wshadow .

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:57 +01:00
David Sterba
39e98213eb btrfs-porgs: check: rename variable to avoid shadowing
Reported by gcc -Wshadow .

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:56 +01:00
David Sterba
df3a134d0e btrfs-porgs: qgroup: rename variable to avoid shadowing
Reported by gcc -Wshadow .

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:56 +01:00
David Sterba
407f928cd2 btrfs-progs: add function attributes for the printf-like
Reported by gcc -Wsuggest-attribute=format .

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:55 +01:00
David Sterba
f9ae914756 btrfs-progs: build: fix builds with extra warnings, W=1
Wrong variable name used in the main makefile.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:55 +01:00
David Sterba
ac4ec4d4f4 btrfs-progs: check for negative return value from ioctl
Handle only negative values returned by ioctl syscalls, with exception
of the device remove. It returns positive values that are handled later.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:55 +01:00
David Sterba
633dc6f80f btrfs-progs: remove unnecessary errno temp variables
We can read errno directly if it's not clobbered by any intermediate
calls.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:55 +01:00
David Sterba
374d67fdef btrfs-progs: free-space-tree: minor message adjustments
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:55 +01:00
Khem Raj
fcb6b102eb btrfsprogs: corrupt-blocks: include limits.h to define PATH_MAX
limits.h is needed for PATH_MAX definition

Fixes
| btrfs-corrupt-block.c: In function 'corrupt_dir_item':
| btrfs-corrupt-block.c:478:12: error: 'PATH_MAX' undeclared (first use in this function)
|   char name[PATH_MAX];

Signed-off-by: Khem Raj <raj.khem@gmail.com>
[ minor changelog edits ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:54 +01:00
David Sterba
83a7413318 btrfs-progs: docs: document new mount option fragment
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:54 +01:00
David Sterba
23c51533ae btrfs-progs: docs: sort mount options alphabetically
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:54 +01:00
Omar Sandoval
e4797df6a9 btrfs-progs: check the free space tree in btrfsck
This reuses the existing code for checking the free space cache, we just
need to load the free space tree. While we do that, we check a couple of
invariants on the free space tree itself. This requires pulling in some
code from the kernel to exclude the super stripes.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:54 +01:00
Omar Sandoval
d8c537e71f btrfs-progs: add basic awareness of the free space tree
To start, let's tell btrfs-progs to read the free space root and how to
print the on-disk format of the free space tree. However, we're not
adding the FREE_SPACE_TREE read-only compat bit to the set of supported
bits because progs doesn't know how to keep the free space tree
consistent.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:54 +01:00
David Sterba
32c063ccb7 btrfs-progs: docs: rename btrfs-mount to btrfs-man5
The page does will not contain only mount options but other stuff.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:53 +01:00
David Sterba
a8829f5335 btrfs-progs: docs, btrfs-mount: enhance file attributes section
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:53 +01:00
David Sterba
7ccc0543dc btrfs-progs: cleanup, move usage help strings closer to the command callbacks
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:53 +01:00
David Sterba
f7c9278008 btrfs-progs: cmd property: use correct usage strings
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:53 +01:00
David Sterba
0e1acda2b2 btrfs-progs: cmd fi usage: switch to common error message wrapper
Message texts were adjusted.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:53 +01:00
David Sterba
641b5d83dd btrfs-progs: cmd filesystem: switch to common error message wrapper
Message texts were adjusted.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:53 +01:00
David Sterba
edbdd06e25 btrfs-progs: cmd replace: switch to common error message wrapper
Message texts were adjusted.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:52 +01:00
David Sterba
e7e759017d btrfs-progs: cmd subvolume: switch to common error message wrapper
Message texts were adjusted.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:52 +01:00
David Sterba
e67f03887f btrfs-progs: cmd send: switch to common error message wrapper
Message texts were adjusted.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:52 +01:00
David Sterba
7330c881c8 btrfs-progs: cmd receive: switch to common error message wrapper
Message texts were adjusted.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:52 +01:00
David Sterba
e3926b4dc8 btrfs-progs: cmd qgroup: switch to common error message wrapper
Message texts were adjusted.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:52 +01:00
David Sterba
28831d5489 btrfs-progs: cmd property: switch to common error message wrapper
Message texts were adjusted.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:51 +01:00
David Sterba
c8e8509239 btrfs-progs: cmd balance: switch to common error message wrapper
Message texts were adjusted.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:51 +01:00
David Sterba
3d6f61f8cb btrfs-progs: cmd quota: switch to common error message wrapper
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:51 +01:00
David Sterba
6bc6e850ee btrfs-progs: cmd rescue: switch to common error message wrapper
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:51 +01:00
David Sterba
b98ad87a03 btrfs-progs: catch memory allocation failure in btrfs_split_item
Do the dumb BUG_ON now, the function needs more changes to handle all
errors.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:51 +01:00
David Sterba
ef45c6b9db btrfs-progs: handler memory allocation failure in add_extent_rec
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:51 +01:00
David Sterba
87296b5541 btrfs-progs: catch memory allocation failure from alloc_data_backref
Do the dumb BUG_ON now, the function needs more changes to handle all
errors.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:50 +01:00
David Sterba
62b4c169e4 btrfs-progs: catch memory allocation failure from alloc_tree_backref
Do the dumb BUG_ON now, the function needs more changes to handle all
errors.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:50 +01:00
David Sterba
cb2b8b19c8 btrfs-progs: catch memory allocation failure in splice_shared_node
Do the dumb BUG_ON now, the function needs more changes to handle all
errors.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:02:50 +01:00
David Sterba
b317ca97d3 btrfs-progs: handle errors in get_inode_backref and fail in the caller
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:09 +01:00
David Sterba
f72a3f9f9f btrfs-progs: handle errors in get_root_backref and fail in the caller
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:08 +01:00
David Sterba
3823cc2771 btrfs-progs: return errors from get_root_rec, fail in callers
get_root_rec return value is enahanced, callers will just BUG_ON now
and will be fixed one by one.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:08 +01:00
David Sterba
6aff5d74bd btrfs-progs: handle errors in add_shared_node and fail in the caller
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:08 +01:00
David Sterba
e0a28fa2fd btrfs-progs: return errors from clone_inode_rec, fail in callers
clone_inode_rec return value is enahanced, callers will just BUG_ON now
and will be fixed one by one.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:07 +01:00
David Sterba
441f88498d btrfs-progs: return errors from get_inode_rec, fail in callers
get_inode_rec return value is enahanced, callers will just BUG_ON now
and will be fixed one by one.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:07 +01:00
David Sterba
cf0fce7ed4 btrfs-progs: docs, enhance the mount option manual page
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:07 +01:00
David Sterba
154c389e92 btrfs-progs: docs, btrfs-mount: enhance fatal_erros
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:07 +01:00
David Sterba
79b8750fe7 btrfs-progs: docs, btrfs-mount: put NOTE tag to new paragraph
Otherwise it's not rendered properly.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:07 +01:00
David Sterba
7dffef0a37 btrfs-progs: docs, btrfs-mount: unindent descriptions
Asciidoc ignores special keywords like WARNING or NOTE if they're not at
the beginning of the line and they're not renedered very visibly in the
end.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:07 +01:00
Christoph Anton Mitterer
d0ba996f5f btrfs-progs: document snapshot unaware defrag
In btrfs-filesystem(8), improved the documentation of snapshot unaware
defragmentation and included the exact kernel version numbers being affected as
well as the possible effects.
No longer use the word "unlink" which is easily understood as "deleting a file".
Moved the warning more to the beginning of "defragment" subcommand's
documentation where it's more visible to readers.

Added the same warning to the "autodefrag" option of btrfs-mount(5).

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2016-01-12 15:01:06 +01:00
David Sterba
894c346714 btrfs-progs: docs, update btrfs(8) manual page
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:06 +01:00
Liu Bo
4ec28aec76 Btrfs-progs: fix typo in parse_range
s/*end/*start.

This makes 'btrfs balance start -dvrange=xxx..yyy' really work.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:06 +01:00
David Sterba
8b5147d5f3 btrfs-progs: use on-stack buffer in add_symbolic_link
Also get rid of the unhandled memory allocation.

Resolves-coverity-id: 1338298
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:06 +01:00
Neil Horman
2cb9b4dbbd btrfs: only free root_path if it was allocated from the heap
Noticed this while doing some snapshots in a chroot environment

btrfs receive can set root_path to either realmnt, which is passed in from the
command line, or to a heap allocated via find_mount_root  in do_receive.  We
should only free the later, not the former, as the former results in an invalid
pointer warning from glibc during free.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:06 +01:00
Byongho Lee
e3bd2d145f btrfs-progs: fix using on-disk structure to store in memory data
In 'qgroup_count' structure 'diskinfo' and 'info' are used to store only
in memory data but its types are for on-disk structure as a result sparse
warns it (different base types).  So fix it by adding new structure
'qgroup_info' to store in memory data and replace on-disk structure
'btrfs_qgroup_info_item' by 'qgroup_info'.  In addition in alloc_cnt()
'generation' is set but not used after that so remove the relevant code.

Signed-off-by: Byongho Lee <bhlee.kernel@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 15:01:05 +01:00