David Sterba
7faf96e30a
btrfs-progs: also check filesystem type in test_issubvolume
...
A subvolume is a directory with inode number 256 on a btrfs filesytem.
Add the missing check to test_issubvolume for completeness, otherwise we
always do that in btrfs_open_dir.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-14 11:07:10 +01:00
David Sterba
dddc3e08cb
btrfs-progs: more verbose errors from test_issubvolume
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-14 11:07:10 +01:00
David Sterba
7afde59e38
btrfs-progs: let test_issubvolume return the exact error
...
Return any error from stat, minor cleanups.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-14 11:07:10 +01:00
David Sterba
33ac47b5fb
btrfs-progs: use symbolic name for subvolume inode number in test_issubvolume
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-14 11:07:10 +01:00
David Sterba
5b56fe9db5
btrfs-progs: handle errors from test_isdir
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-14 11:07:09 +01:00
David Sterba
1267c58e58
btrfs-progs: let test_isdir return the exact error
...
Return any error from stat, normalize the return value in case the path
is a directory.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-13 17:45:41 +01:00
David Sterba
2078848983
btrfs-progs: debug-tree: teach -t option about the chunk and root trees
...
A user on IRC wanted to dump the chunk tree using the -t option. As the
-t option enumerates only trees pointed by the tree_root, the chunk tree
is skipped. Similar for th tree of tree roots.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-13 16:43:48 +01:00
David Sterba
0aa796cad7
btrfs-progs: subvol show: handle options by getopt
...
The subvolume show command does not take any optios but at least it
should honor "--", as reported.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=110181
Reported-by: <moviuro+kernel@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-13 16:43:48 +01:00
David Sterba
b9ec406c0f
btrfs-progs: fi usage: support mixed blockgroups
...
Properly account the duplicated block groups and global reserve.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=110111
Reported-by: Chris Murphy <bugzilla@colorremedies.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-13 16:43:13 +01:00
David Sterba
ecd4bb607f
btrfs-progs: docs: enhance btrfs-filesystem manual page
...
Wording, formatting, explanations, examples.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-01-12 18:42:49 +01:00
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