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>
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>
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>
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>
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>
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>
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>
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>
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>