mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-04 09:18:36 +03:00
cleanup: gcc warnings and report-select test vs snap_percent 0%
Fix gcc warnings: libdm-report.c:1952:5: warning: "end_op_flag_hit" may be used uninitialized in this function [-Wmaybe-uninitialized] libdm-report.c:2232:28: warning: "custom" may be used uninitialized in this function [-Wmaybe-uninitialized] And snap_percent is not 0% in dm < 1.10.0 so don't test comparison with 0% here.
This commit is contained in:
parent
ca1abe70ff
commit
0548a82e63
@ -1879,7 +1879,7 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
|
|||||||
struct selection_str_list *ssl = NULL;
|
struct selection_str_list *ssl = NULL;
|
||||||
struct dm_str_list *item;
|
struct dm_str_list *item;
|
||||||
const char *begin_item, *end_item, *tmp;
|
const char *begin_item, *end_item, *tmp;
|
||||||
uint32_t end_op_flags, end_op_flag_hit;
|
uint32_t end_op_flags, end_op_flag_hit = 0;
|
||||||
struct dm_str_list **arr;
|
struct dm_str_list **arr;
|
||||||
size_t list_size;
|
size_t list_size;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -2400,7 +2400,7 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
|
|||||||
struct selection_str_list *str_list;
|
struct selection_str_list *str_list;
|
||||||
const struct dm_report_reserved_value *reserved;
|
const struct dm_report_reserved_value *reserved;
|
||||||
uint64_t factor;
|
uint64_t factor;
|
||||||
void *custom;
|
void *custom = NULL;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
|
@ -150,7 +150,11 @@ lvs_sel 'size<=8m' "vol2 xyz vol1 orig snap"
|
|||||||
###########################
|
###########################
|
||||||
# PERCENT FIELD SELECTION #
|
# PERCENT FIELD SELECTION #
|
||||||
###########################
|
###########################
|
||||||
|
if aux target_at_least dm-snapshot 1 10 0; then
|
||||||
|
# Test zero percent only if snapshot can be zero.
|
||||||
|
# Before 1.10.0, the snap percent included metadata size.
|
||||||
lvs_sel 'snap_percent=0' "snap"
|
lvs_sel 'snap_percent=0' "snap"
|
||||||
|
fi
|
||||||
dd if=/dev/zero of=$DM_DEV_DIR/$vg3/snap bs=1M count=1
|
dd if=/dev/zero of=$DM_DEV_DIR/$vg3/snap bs=1M count=1
|
||||||
lvs_sel 'snap_percent<50' "snap"
|
lvs_sel 'snap_percent<50' "snap"
|
||||||
lvs_sel 'snap_percent>50'
|
lvs_sel 'snap_percent>50'
|
||||||
|
Loading…
Reference in New Issue
Block a user