Commit Graph

2916 Commits

Author SHA1 Message Date
David Sterba ea84d54121 btrfs-progs: improve error handling in clone_inode_rec
Cleanup the rb_tree.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba 7e955fc856 btrfs-progs: corrupt-block: fix assertion condition
The ->data is no longer a pointer but an embedded array.

Resolves-coverity-id: 1372671
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba c7a1f66a20 btrfs-progs: check: switch some messages to common helpers
Switch the messages that do not come from the actual image checking,
more like the parameter verification.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba a4e59b6776 btrfs-progs: image: switch to common message helpers
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba 6733181501 btrfs-progs: convert: improve error handling in do_rollback
Handle transaction errors.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba 1497a772c3 btrfs-progs: check: improve error handling in add_extent_rec_nolookup
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba 257f697962 btrfs-progs: check: handle errors returned by add_extent_rec_nolookup
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba 1ed3426d3f btrfs-progs: use standard allocation functions in non-kenrel code
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba b80a4641e5 btrfs-progs: improve error handling in btrfs_add_to_fsid
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba 7b83595dbd btrfs-progs: corrupt-block: improved error handling in corrupt_item_nocow
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba 689b6249f3 btrfs-progs: dump-super: switch to common message helpers
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba df36cbdad2 btrfs-progs: improve error handling in btrfs_alloc_data_chunk
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba 1424a9b4d9 btrfs-progs: remove redundant check in btrfs_add_to_fsid
The callers do the sanity checks.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:15 +02:00
David Sterba ee3dfeaab2 btrfs-progs: prop: simplify help printing code
Remove a trivial helper.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:14 +02:00
David Sterba acf978a2d4 btrfs-progs: tree-stats: switch to common message helpers
Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:14 +02:00
David Sterba 4a16608150 btrfs-progs: fi du: improved error handling in mark_inode_seen
The callchain handles errors, don't crash on unexpected condition.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:14 +02:00
David Sterba 44af5de2f3 btrfs-progs: fi du: catch bogus extent lengths
If we get a zero-length from the ioctl for whatever reason, we should
not crash.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-10-03 11:33:04 +02:00
David Sterba 939bc6323b btrfs-progs: inspect: improved error handling
Two remaining BUG_ON, be more specific what's wrong.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba ad44d1eb17 btrfs-progs: improved error handling in btrfs_print_tree
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 26fbf0546d btrfs-progs: qgroup: switch to common message helpers
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba c027c13531 btrfs-progs: remove trivial helpers for filtering functions
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 8a167ec579 btrfs-progs: catch invalid flags in open_ctree_fd
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 93a34924e1 btrfs-progs: convert: improve error handling in create_image_file_range
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 030fa48b55 btrfs-progs: mkfs: handle block ordering errors in make_btrfs
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba b83e93e65d btrfs-progs: chunk-recover: improve error handling in insert_stripe
Switch to negative errnos, the callchain handles errors.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 1620e2a042 btrfs-progs: switch column values to asserts
This is checking correct usage, not runtime errors.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 40ca1d513d btrfs-progs: check: improved error handling in calc_extent_flag
All callers handle errors.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 28fdd0d2ae btrfs-progs: receive: improved error handling in process_snapshot
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 1ef93ea863 btrfs-progs: handle errors from btrfs_alloc_path
All functions already return an error condition, so the callers should
expect that.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba b318553f33 btrfs-progs: mkfs: check for sane sectorsize earlier
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 976f6adfb5 btrfs-progs: more verbose error handling in creation helpers
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 2d7c6dc931 btrfs-progs: switch BUG_ON to ASSERT in reserve_free_space
That's not a real error condition, catch bad function usge.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 41fe00e1eb btrfs-progs: dump-tree: improved error handling in cmd_inspect_dump_tree
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:38 +02:00
David Sterba 04b3bf1779 btrfs-progs: dump-tree: improved error handling in print_extents
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:30 +02:00
David Sterba 7febbc9efe btrfs-progs: fi usage: improved error handling in load_device_info
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:10 +02:00
David Sterba 5b16054958 btrfs-progs: scrub: improved error handling in scrub_read_file
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 14:12:10 +02:00
David Sterba 0ce97733fe
Btrfs progs v4.7.3
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 13:59:53 +02:00
David Sterba 72dbd4397d btrfs-progs: update CHANGES for 4.7.3
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 13:57:37 +02:00
David Sterba 7aaa1a92f6 btrfs-progs: mkfs: use preallocated buffers for config uuids
No need for dynamic allocation, the buffers are small, remove the
now-useless error conditions.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 13:44:24 +02:00
David Sterba 90e3e630c2 btrfs-progs: mkfs: fix reading rotational status value
ASAN reports that we're reading beyond the bounds, and is right. The
variable is too short to store a nonempty string for atoi.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 13:36:04 +02:00
David Sterba d75e061bcd btrfs-progs: defrag: set errno correctly in the callback
In case defrag fails, the errno is not properly reported everywhere but
rather the last value of 'e', which could be 0. Then we get confusing
error messages like:

ERROR: defrag failed on /path/to/file: Success

Reported-by: Adam Mizerski <adam@mizerski.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:50:42 +02:00
David Sterba eccba6261a btrfs-progs: subvol create: remove v from getopt
The option 'v' was mistakenly added in
2ed161bd28 but there's no such option for
create at the moment, remove it.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:50:38 +02:00
Vincent Batts c68759eaa6 btrfs-progs: subvol delete: add missing verbose option
There was already the logic for verbose output, but the flag parsing did
not include it.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:50:35 +02:00
adduxa 7f26e64ddd btrfs-progs: docs: fix typos in btrfs-subvolume
[ Documentation fix, github pull request 16 ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:50:13 +02:00
Omar Sandoval 02a9b6cbef Revert "btrfs-progs: fix compat_ro mask for free space tree"
btrfs-progs can't mount space_cache=v2 filesystems read-write, which is
why the compat bit wasn't added to the supported mask in the first
place. Remove it.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:50:09 +02:00
David Sterba da64ae3a0f btrfs-progs: reorganize extent_buffer and fix alignment of data
Reported by UBSAN, the checksum code tries to access unaligned data that
come from the extent_buffer.

struct extent_buffer {
        struct cache_extent        cache_node;           /*     0    48 */
        u64                        start;                /*    48     8 */
        u64                        dev_bytenr;           /*    56     8 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        u32                        len;                  /*    64     4 */

        /* XXX 4 bytes hole, try to pack */

        struct extent_io_tree *    tree;                 /*    72     8 */
        struct list_head           lru;                  /*    80    16 */
        struct list_head           recow;                /*    96    16 */
        int                        refs;                 /*   112     4 */
        u32                        flags;                /*   116     4 */
        int                        fd;                   /*   120     4 */
        char                       data[0];              /*   124     0 */

        /* size: 128, cachelines: 2, members: 11 */
        /* sum members: 120, holes: 1, sum holes: 4 */
        /* padding: 4 */
};

Add explicit alignment to data.

Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156471
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:50:05 +02:00
Wang Xiaoguang f9309584bf btrfs-progs: tests: add 021-partially-dropped-snapshot-case
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:50:01 +02:00
Wang Xiaoguang ac80fca06c btrfs-progs: check: make low memory mode support partially dropped snapshots
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:49:57 +02:00
David Sterba 3f100c5251 btrfs-progs: better error report in btrfs_scan_fs_devices
Print the found sizes.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:49:48 +02:00
David Sterba 2125a65533 btrfs-progs: tests: add fuzzed images for bad block group offset
Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-09-21 11:49:41 +02:00