dev-prajnoha-pv-ext-flag-used - configure: check for -lm and log10 function
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c1bd76d6fcbbc7...
Commit: c1bd76d6fcbbc7c07c99a5738dea99f830f79810
Parent: a7abade088b5085eed248ab4369fa70263a40bfc
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Tue Aug 18 15:21:19 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Aug 18 15:25:54 2015 +0100
configure: check for -lm and log10 function
We already use -lm functions in a couple of places (these are
satisfied by gcc built-ins for most builds): add a configure.in
check and explicitly link to -lm.
---
configure | 46 ++++++++++++++++++++++++++++++++++++++++++++++
configure.in | 5 +++++
libdm/Makefile.in | 2 +-
make.tmpl.in | 1 +
4 files changed, 53 insertions(+), 1 deletions(-)
diff --git a/configure b/configure
index 630f12a..57bec69 100755
--- a/configure
+++ b/configure
@@ -665,6 +665,7 @@ PYTHON_LIBDIRS
PYTHON_INCDIRS
PYTHON_BINDINGS
PTHREAD_LIBS
+M_LIBS
POOL
PKGCONFIG
OCFDIR
@@ -12570,6 +12571,50 @@ if [ \( "$LVM1" = shared -o "$POOL" = shared -o "$CLUSTER" = shared \
fi
################################################################################
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for log10 in -lm" >&5
+$as_echo_n "checking for log10 in -lm... " >&6; }
+if ${ac_cv_lib_m_log10+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log10 ();
+int
+main ()
+{
+return log10 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_log10=yes
+else
+ ac_cv_lib_m_log10=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log10" >&5
+$as_echo "$ac_cv_lib_m_log10" >&6; }
+if test "x$ac_cv_lib_m_log10" = xyes; then :
+ M_LIBS="-lm"
+else
+ hard_bailout
+fi
+
+
+################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5
$as_echo_n "checking for pthread_mutex_lock in -lpthread... " >&6; }
if ${ac_cv_lib_pthread_pthread_mutex_lock+:} false; then :
@@ -14153,6 +14198,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
+
################################################################################
ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile lib/cache_segtype/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdev
mapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan
_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
diff --git a/configure.in b/configure.in
index c3e55e9..2c89d8c 100644
--- a/configure.in
+++ b/configure.in
@@ -1538,6 +1538,10 @@ if [[ \( "$LVM1" = shared -o "$POOL" = shared -o "$CLUSTER" = shared \
fi
################################################################################
+AC_CHECK_LIB(m, log10,
+ [M_LIBS="-lm"], hard_bailout)
+
+################################################################################
AC_CHECK_LIB([pthread], [pthread_mutex_lock],
[PTHREAD_LIBS="-lpthread"], hard_bailout)
@@ -1984,6 +1988,7 @@ AC_SUBST(OCF)
AC_SUBST(OCFDIR)
AC_SUBST(PKGCONFIG)
AC_SUBST(POOL)
+AC_SUBST(M_LIBS)
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PYTHON)
AC_SUBST(PYTHON_BINDINGS)
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index 880b40c..1b924ce 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -55,7 +55,7 @@ include $(top_builddir)/make.tmpl
CFLAGS += $(UDEV_CFLAGS) $(VALGRIND_CFLAGS)
-LIBS += $(SELINUX_LIBS) $(UDEV_LIBS) $(PTHREAD_LIBS)
+LIBS += $(SELINUX_LIBS) $(UDEV_LIBS) $(PTHREAD_LIBS) $(M_LIBS)
device-mapper: all
diff --git a/make.tmpl.in b/make.tmpl.in
index 731dab7..e4f8835 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -54,6 +54,7 @@ LDDEPS += @LDDEPS@
LIB_SUFFIX = @LIB_SUFFIX@
LVMINTERNAL_LIBS = -llvm-internal $(DAEMON_LIBS) $(UDEV_LIBS) $(DL_LIBS) $(BLKID_LIBS)
DL_LIBS = @DL_LIBS@
+M_LIBS = @M_LIBS@
PTHREAD_LIBS = @PTHREAD_LIBS@
READLINE_LIBS = @READLINE_LIBS@
SELINUX_LIBS = @SELINUX_LIBS@
8 years, 8 months
dev-prajnoha-pv-ext-flag-used - cleanup: compare fgets pointer
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a7abade088b508...
Commit: a7abade088b5085eed248ab4369fa70263a40bfc
Parent: abb24370e9bee7e218c333a23c574fed0b4d95ff
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 18 15:48:05 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 18 16:05:04 2015 +0200
cleanup: compare fgets pointer
Check pointer for not being NULL.
---
tools/lvconvert.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 0897e09..37ae197 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2430,7 +2430,7 @@ static int _lvconvert_pool_repair(struct cmd_context *cmd,
* Scan only the 1st. line for transation id.
* Watch out, if the thin_dump format changes
*/
- if ((fgets(meta_path, sizeof(meta_path), f) > 0) &&
+ if (fgets(meta_path, sizeof(meta_path), f) &&
(trans_id_str = strstr(meta_path, "transaction=\"")) &&
(sscanf(trans_id_str + 13, FMTu64, &trans_id) == 1) &&
(trans_id != first_seg(pool_lv)->transaction_id) &&
8 years, 8 months
dev-prajnoha-pv-ext-flag-used - cleanup: move var declaration
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=abb24370e9bee7...
Commit: abb24370e9bee7e218c333a23c574fed0b4d95ff
Parent: 6e1feb0f736f4ebd819f25eb53f7f7ab74bb0678
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 18 15:47:07 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 18 16:05:04 2015 +0200
cleanup: move var declaration
---
daemons/clvmd/clvmd.c | 4 ++--
libdaemon/server/daemon-server.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index 99d01d0..c6d51bd 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -855,12 +855,12 @@ static void main_loop(int cmd_timeout)
int quorate = clops->is_quorate();
int client_count = 0;
int max_fd = 0;
+ struct local_client *lastfd = &local_client_head;
+ struct local_client *nextfd = local_client_head.next;
/* Wait on the cluster FD and all local sockets/pipes */
local_client_head.fd = clops->get_main_cluster_fd();
FD_ZERO(&in);
- struct local_client *lastfd = &local_client_head;
- struct local_client *nextfd = local_client_head.next;
for (thisfd = &local_client_head; thisfd; thisfd = thisfd->next) {
client_count++;
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 4f34aaf..d9d60d1 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -539,6 +539,7 @@ void daemon_start(daemon_state s)
log_state _log = { { 0 } };
thread_state _threads = { .next = NULL };
unsigned timeout_count = 0;
+ fd_set in;
/*
* Switch to C locale to avoid reading large locale-archive file used by
@@ -623,7 +624,6 @@ void daemon_start(daemon_state s)
while (!_shutdown_requested && !failed) {
_reset_timeout(s);
- fd_set in;
FD_ZERO(&in);
FD_SET(s.socket_fd, &in);
if (select(FD_SETSIZE, &in, NULL, NULL, _get_timeout(s)) < 0 && errno != EINTR)
8 years, 8 months
dev-prajnoha-pv-ext-flag-used - cleanup: preserve constness of some pointers
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6e1feb0f736f4e...
Commit: 6e1feb0f736f4ebd819f25eb53f7f7ab74bb0678
Parent: ef7264807ff44c029360e697dd391ab870bb4481
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 18 15:39:04 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 18 16:05:04 2015 +0200
cleanup: preserve constness of some pointers
---
libdm/libdm-report.c | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 84b1294..b948073 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -257,7 +257,7 @@ static int _selected_disp(struct dm_report *rh,
const void *data,
void *private __attribute__((unused)))
{
- struct row *row = (struct row *)data;
+ const struct row *row = (const struct row *)data;
return dm_report_field_int(rh, field, &row->selected);
}
@@ -1387,11 +1387,11 @@ static int _dbl_less_or_equal(double d1, double d2)
return _dbl_less(d1, d2) || _dbl_equal(d1, d2);
}
-#define _uint64 *(uint64_t *)
-#define _uint64arr(var,index) ((uint64_t *)var)[index]
+#define _uint64 *(const uint64_t *)
+#define _uint64arr(var,index) ((const uint64_t *)var)[index]
#define _str (const char *)
-#define _dbl *(double *)
-#define _dblarr(var,index) ((double *)var)[index]
+#define _dbl *(const double *)
+#define _dblarr(var,index) ((const double *)var)[index]
static int _do_check_value_is_strictly_reserved(unsigned type, const void *res_val, int res_range,
const void *val, struct field_selection *fs)
@@ -1790,7 +1790,7 @@ static int _compare_selection_field(struct dm_report *rh,
r = _cmp_field_int(rh, f->props->field_num, field_id, *(const uint64_t *) f->sort_value, fs);
break;
case DM_REPORT_FIELD_TYPE_SIZE:
- r = _cmp_field_double(rh, f->props->field_num, field_id, *(double *) f->sort_value, fs);
+ r = _cmp_field_double(rh, f->props->field_num, field_id, *(const double *) f->sort_value, fs);
break;
case DM_REPORT_FIELD_TYPE_STRING:
r = _cmp_field_string(rh, f->props->field_num, field_id, (const char *) f->sort_value, fs);
@@ -2446,8 +2446,8 @@ static const char *_tok_value_regex(struct dm_report *rh,
static int _str_list_item_cmp(const void *a, const void *b)
{
- const struct dm_str_list **item_a = (const struct dm_str_list **) a;
- const struct dm_str_list **item_b = (const struct dm_str_list **) b;
+ const struct dm_str_list * const *item_a = (const struct dm_str_list * const *) a;
+ const struct dm_str_list * const *item_b = (const struct dm_str_list * const *) b;
return strcmp((*item_a)->str, (*item_b)->str);
}
@@ -3357,7 +3357,7 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
memcpy(s, v, len);
s[len] = '\0';
- fs->value->v.r = dm_regex_create(rh->selection->mem, (const char **) &s, 1);
+ fs->value->v.r = dm_regex_create(rh->selection->mem, (const char * const *) &s, 1);
dm_free(s);
if (!fs->value->v.r) {
log_error("dm_report: failed to create regex "
@@ -3377,7 +3377,7 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
if (rvw->value) {
fs->value->v.s = (const char *) rvw->value;
if (rvw->reserved->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE)
- fs->value->next->v.s = (((const char **) rvw->value)[1]);
+ fs->value->next->v.s = (((const char * const *) rvw->value)[1]);
dm_pool_free(rh->selection->mem, s);
} else {
fs->value->v.s = s;
@@ -3389,9 +3389,9 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
break;
case DM_REPORT_FIELD_TYPE_NUMBER:
if (rvw->value) {
- fs->value->v.i = *(uint64_t *) rvw->value;
+ fs->value->v.i = *(const uint64_t *) rvw->value;
if (rvw->reserved->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE)
- fs->value->next->v.i = (((uint64_t *) rvw->value)[1]);
+ fs->value->next->v.i = (((const uint64_t *) rvw->value)[1]);
} else {
if (((fs->value->v.i = strtoull(s, NULL, 10)) == ULLONG_MAX) &&
(errno == ERANGE)) {
@@ -3407,16 +3407,16 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
break;
case DM_REPORT_FIELD_TYPE_SIZE:
if (rvw->value) {
- fs->value->v.d = *(double *) rvw->value;
+ fs->value->v.d = *(const double *) rvw->value;
if (rvw->reserved->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE)
- fs->value->next->v.d = (((double *) rvw->value)[1]);
+ fs->value->next->v.d = (((const double *) rvw->value)[1]);
} else {
fs->value->v.d = strtod(s, NULL);
if (errno == ERANGE) {
log_error(_out_of_range_msg, s, field_id);
goto error;
}
- if (custom && (factor = *((uint64_t *)custom)))
+ if (custom && (factor = *((const uint64_t *)custom)))
fs->value->v.d *= factor;
fs->value->v.d /= 512; /* store size in sectors! */
if (_check_value_is_strictly_reserved(rh, field_num, DM_REPORT_FIELD_TYPE_SIZE, &fs->value->v.d, NULL)) {
@@ -3428,9 +3428,9 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
break;
case DM_REPORT_FIELD_TYPE_PERCENT:
if (rvw->value) {
- fs->value->v.i = *(uint64_t *) rvw->value;
+ fs->value->v.i = *(const uint64_t *) rvw->value;
if (rvw->reserved->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE)
- fs->value->next->v.i = (((uint64_t *) rvw->value)[1]);
+ fs->value->next->v.i = (((const uint64_t *) rvw->value)[1]);
} else {
fs->value->v.d = strtod(s, NULL);
if ((errno == ERANGE) || (fs->value->v.d < 0) || (fs->value->v.d > 100)) {
@@ -3455,9 +3455,9 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
break;
case DM_REPORT_FIELD_TYPE_TIME:
if (rvw->value) {
- fs->value->v.t = *(time_t *) rvw->value;
+ fs->value->v.t = *(const time_t *) rvw->value;
if (rvw->reserved->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE)
- fs->value->next->v.t = (((time_t *) rvw->value)[1]);
+ fs->value->next->v.t = (((const time_t *) rvw->value)[1]);
} else {
tval = (struct time_value *) custom;
fs->value->v.t = tval->t1;
8 years, 8 months
dev-prajnoha-pv-ext-flag-used - cleanup: log_debug format matches args
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ef7264807ff44c...
Commit: ef7264807ff44c029360e697dd391ab870bb4481
Parent: bc395067921fdd96c386e6d5b4ea613a39efea33
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 18 15:28:56 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 18 16:05:04 2015 +0200
cleanup: log_debug format matches args
---
tools/dmsetup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index b944402..45d4173 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -562,7 +562,7 @@ static int _start_timerfd_timer(void)
interval_timer.it_value.tv_sec = secs;
interval_timer.it_value.tv_nsec = nsecs;
- log_debug("Setting interval timer to: "FMTu64"s "FMTu64"ns", secs, nsecs);
+ log_debug("Setting interval timer to: " FMTu64 "s %ldns", (uint64_t)secs, nsecs);
if (timerfd_settime(_timer_fd, 0, &interval_timer, NULL)) {
log_error("Could not set interval timer: %s", strerror(errno));
return 0;
8 years, 8 months
dev-prajnoha-pv-ext-flag-used - man: update dmstats.8.in examples
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bc395067921fdd...
Commit: bc395067921fdd96c386e6d5b4ea613a39efea33
Parent: 28b4fa3e270711e7f7ee45642b28a7c7127ea982
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Sun Aug 16 19:30:16 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Tue Aug 18 14:40:45 2015 +0100
man: update dmstats.8.in examples
---
man/dmstats.8.in | 48 ++++++++++++++++++++++--------------------------
1 files changed, 22 insertions(+), 26 deletions(-)
diff --git a/man/dmstats.8.in b/man/dmstats.8.in
index a6b2ff5..5c5f41c 100644
--- a/man/dmstats.8.in
+++ b/man/dmstats.8.in
@@ -591,7 +591,7 @@ Create a whole-device region with one area on vg00/lvol1
.br
# dmstats create vg00/lvol1
.br
-Created region: 0
+vg00/lvol1: Created new region with 1 area(s) as region ID 0
.br
.br
@@ -601,7 +601,7 @@ Create a 32M region 1G into device d0
.br
# dmstats create --start 1G --length 32M d0
.br
-Created region: 2
+d0: Created new region with 1 area(s) as region ID 0
.br
@@ -610,17 +610,17 @@ Create a whole-device region with 8 areas on every device
.br
# dmstats create --areas 8
.br
-Created region: 0
+vg00/lvol1: Created new region with 8 area(s) as region ID 0
.br
-Created region: 0
+vg00/lvol2: Created new region with 8 area(s) as region ID 0
.br
-Created region: 0
+vg00/lvol3: Created new region with 8 area(s) as region ID 0
.br
-Created region: 2
+vg01/lvol0: Created new region with 8 area(s) as region ID 2
.br
-Created region: 0
+vg01/lvol1: Created new region with 8 area(s) as region ID 0
.br
-Created region: 0
+vg00/lvol2: Created new region with 8 area(s) as region ID 1
.br
.br
@@ -637,7 +637,7 @@ using dmsetup
.br
# dmsetup stats create --areasize 10G vg00/lvol1
.br
-Created region: 1
+vg00/lvol1: Created new region with 5 area(s) as region ID 1
.br
.br
@@ -645,7 +645,7 @@ Create a 1GiB region with 16 areas at the start of vg00/lvol1
.br
# dmstats create --start 0 --len 1G --areas=16 vg00/lvol1
.br
-Created region: 2
+vg00/lvol1: Created new region with 16 area(s) as region ID 0
.br
.br
@@ -653,13 +653,13 @@ List the statistics regions registered on vg00/lvol1
.br
# dmstats list vg00/lvol1
.br
-RegionID RegStart RegLen AreaSize ProgramID AuxData
+Name RgID RStart RSize #Areas ASize ProgID
.br
-0 0 104857600 20971520 dmstats
+vg00-lvol1 0 0 61.00g 1 61.00g dmstats
.br
-1 0 104857600 20971520 dmstats
+vg00-lvol1 1 61.00g 19.20g 1 19.20g dmstats
.br
-2 0 2097152 131072 dmstats
+vg00-lvol1 2 80.20g 2.14g 1 2.14g dmstats
.br
.br
@@ -668,19 +668,15 @@ Display five statistics reports for vg00/lvol1 at an interval of one second
.br
# dmstats report --interval 1 --count 5 vg00/lvol1
.br
-Name RgID ArID RRqM/s WRqM/s R/s W/s RSz/s WSz/s AvRqSz QSize SvcTm Util% AWait
+# dmstats report
.br
-vg00-lvol1 0 0 0.00 0.00 8.00 0.00 48.00k 0 6.00k 0.00 5.50 4.40 6.62
+Name RgID ArID AStart ASize RRqM/s WRqM/s R/s W/s RSz/s WSz/s AvRqSz QSize Util% AWait RdAWa WrAWa
.br
-vg00-lvol1 0 1 0.00 0.00 22.00 0.00 624.00k 0 28.00k 0.00 5.23 11.50 5.36
+vg_hex-lv_home 0 0 0 61.00g 0.00 0.00 0.00 218.00 0 1.04m 4.50k 2.97 81.70 13.62 0.00 13.62
.br
-vg00-lvol1 0 2 0.00 0.00 353.00 0.00 1.84m 0 5.00k 0.00 1.34 47.40 1.33
+vg_hex-lv_home 1 0 61.00g 19.20g 0.00 0.00 0.00 5.00 0 548.00k 109.50k 0.14 11.00 27.40 0.00 27.40
.br
-vg00-lvol1 0 3 0.00 0.00 73.00 0.00 592.00k 0 8.00k 0.00 2.10 15.30 2.10
-.br
-vg00-lvol1 0 4 0.00 0.00 5.00 0.00 52.00k 0 10.00k 0.00 4.00 2.00 4.00
-.br
-[...]
+vg_hex-lv_home 2 0 80.20g 2.14g 0.00 0.00 0.00 14.00 0 1.15m 84.00k 0.39 18.70 27.71 0.00 27.71
.br
.br
@@ -689,11 +685,11 @@ Create one region for reach target contained in device vg00/lvol1
.br
# dmstats create --segments vg00/lvol1
.br
-Created region: 0
+Created new region with 1 area(s) as region ID 0
.br
-Created region: 1
+Created new region with 1 area(s) as region ID 1
.br
-Created region: 2
+Created new region with 1 area(s) as region ID 2
.br
.br
8 years, 8 months
dev-prajnoha-pv-ext-flag-used - Revert "lvmcache: check for too long pvid"
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=28b4fa3e270711...
Commit: 28b4fa3e270711e7f7ee45642b28a7c7127ea982
Parent: b19380998739b9971d27845a70a78511c2335cb0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 18 15:21:48 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 18 15:22:13 2015 +0200
Revert "lvmcache: check for too long pvid"
This reverts commit 70db1d523db330cbdfc39163c30dc00cf16a1fdc.
Since we use 'strncpy' even for case where it exactly matches
the buffer size and \0 is not expected to be added there.
---
lib/cache/lvmcache.c | 7 +------
lib/format_text/text_label.c | 8 +++-----
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 530bcd3..cfa1d5f 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1178,12 +1178,7 @@ static int _lvmcache_update_pvid(struct lvmcache_info *info, const char *pvid)
return 1;
if (*info->dev->pvid)
dm_hash_remove(_pvid_hash, info->dev->pvid);
-
- if (!dm_strncpy(info->dev->pvid, pvid, sizeof(info->dev->pvid))){
- log_error("_lvmcache_update: too long pvid: %s.", pvid);
- return 0;
- }
-
+ strncpy(info->dev->pvid, pvid, sizeof(info->dev->pvid));
if (!dm_hash_insert(_pvid_hash, pvid, info)) {
log_error("_lvmcache_update: pvid insertion failed: %s", pvid);
return 0;
diff --git a/lib/format_text/text_label.c b/lib/format_text/text_label.c
index 5835bc2..4ad2ccd 100644
--- a/lib/format_text/text_label.c
+++ b/lib/format_text/text_label.c
@@ -94,11 +94,9 @@ static int _text_write(struct label *label, void *buf)
* PV header base
*/
/* FIXME Move to where label is created */
- if (!dm_strncpy(label->type, LVM2_LABEL, sizeof(label->type)) ||
- !dm_strncpy((char *)lh->type, label->type, sizeof(label->type))) {
- log_error(INTERNAL_ERROR "LVM2 label %s does not fit.", LVM2_LABEL);
- return 0;
- }
+ strncpy(label->type, LVM2_LABEL, sizeof(label->type));
+
+ strncpy((char *)lh->type, label->type, sizeof(label->type));
pvhdr = (struct pv_header *) ((char *) buf + xlate32(lh->offset_xl));
info = (struct lvmcache_info *) label->info;
8 years, 8 months
dev-prajnoha-pv-ext-flag-used - debug: vgdisplay trace failing result code
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b19380998739b9...
Commit: b19380998739b9971d27845a70a78511c2335cb0
Parent: a8fd88463e662b769073e7b06d1a5acfd07fbc13
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 18 11:46:13 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 18 15:00:08 2015 +0200
debug: vgdisplay trace failing result code
Add stack on error path.
---
tools/vgdisplay.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/vgdisplay.c b/tools/vgdisplay.c
index 5e5ceda..0127e7c 100644
--- a/tools/vgdisplay.c
+++ b/tools/vgdisplay.c
@@ -22,7 +22,8 @@ static int vgdisplay_single(struct cmd_context *cmd, const char *vg_name,
if (arg_count(cmd, activevolumegroups_ARG) && !lvs_in_vg_activated(vg))
return ECMD_PROCESSED;
- vg_check_status(vg, EXPORTED_VG);
+ if (!vg_check_status(vg, EXPORTED_VG))
+ stack;
if (arg_count(cmd, colon_ARG)) {
vgdisplay_colons(vg);
8 years, 8 months
dev-prajnoha-pv-ext-flag-used - cleanup: trace error from lvmcache_update_vgname_and_id
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a8fd88463e662b...
Commit: a8fd88463e662b769073e7b06d1a5acfd07fbc13
Parent: 3a3e17d603698967e5febb84036923dc7e8da674
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 18 13:48:53 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 18 15:00:08 2015 +0200
cleanup: trace error from lvmcache_update_vgname_and_id
Check result value from lvmcache_update_vgname_and_id().
---
lib/format_text/format-text.c | 5 +++--
lib/label/label.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 1d7dc3c..4544f26 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -453,8 +453,9 @@ static struct raw_locn *_find_vg_rlocn(struct device_area *dev_area,
"not match expected name %s.", vgname);
bad:
- if ((info = lvmcache_info_from_pvid(dev_area->dev->pvid, 0)))
- lvmcache_update_vgname_and_id(info, &vgsummary_orphan);
+ if ((info = lvmcache_info_from_pvid(dev_area->dev->pvid, 0)) &&
+ !lvmcache_update_vgname_and_id(info, &vgsummary_orphan))
+ stack;
return NULL;
}
diff --git a/lib/label/label.c b/lib/label/label.c
index 4510400..bc3c653 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -105,7 +105,8 @@ static void _update_lvmcache_orphan(struct lvmcache_info *info)
memcpy(&vgsummary_orphan.vgid, lvmcache_fmt(info)->orphan_vg_name, strlen(lvmcache_fmt(info)->orphan_vg_name));
- lvmcache_update_vgname_and_id(info, &vgsummary_orphan);
+ if (!lvmcache_update_vgname_and_id(info, &vgsummary_orphan))
+ stack;
}
static struct labeller *_find_labeller(struct device *dev, char *buf,
8 years, 8 months
dev-prajnoha-pv-ext-flag-used - cleanup: check pthread result codes
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3a3e17d6036989...
Commit: 3a3e17d603698967e5febb84036923dc7e8da674
Parent: 40af31729fc3400809e618b5cb5b2ff7c116b6f2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 18 13:42:52 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 18 15:00:08 2015 +0200
cleanup: check pthread result codes
---
daemons/lvmpolld/lvmpolld-core.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/daemons/lvmpolld/lvmpolld-core.c b/daemons/lvmpolld/lvmpolld-core.c
index 1402373..7d2a98b 100644
--- a/daemons/lvmpolld/lvmpolld-core.c
+++ b/daemons/lvmpolld/lvmpolld-core.c
@@ -585,12 +585,16 @@ static int spawn_detached_thread(struct lvmpolld_lv *pdlv)
int r;
pthread_attr_t attr;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+ if (pthread_attr_init(&attr) != 0)
+ return 0;
+
+ if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) != 0)
+ return 0;
r = pthread_create(&pdlv->tid, &attr, fork_and_poll, (void *)pdlv);
- pthread_attr_destroy(&attr);
+ if (pthread_attr_destroy(&attr) != 0)
+ return 0;
return !r;
}
8 years, 8 months