master - lvmetad: check for pointers not NULL
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=99def8f4391295...
Commit: 99def8f43912958bb8567a123b9725c0e3389048
Parent: f66fe2c444a4a8c9dccf16ad8bf470a96de1305d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Nov 9 09:25:12 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 10:19:19 2015 +0100
lvmetad: check for pointers not NULL
Check for arg_vgid_lookup and arg_name_lookup not being NULL.
Drop checking arg_vgid and arg_name for NULL since they
are already dereference earlier - thus mostly must be NOT NULL.
(If that would be possible larger rework of this function would be
required).
---
daemons/lvmetad/lvmetad-core.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 78af69b..eb343ab 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -1378,7 +1378,7 @@ static int update_metadata(lvmetad_state *s, const char *arg_name, const char *a
* A lookup of the name arg was successful in finding arg_vgid_lookup,
* but that resulting vgid doesn't match the arg_vgid.
*/
- if (arg_vgid_lookup && arg_vgid && strcmp(arg_vgid_lookup, arg_vgid)) {
+ if (arg_vgid_lookup && strcmp(arg_vgid_lookup, arg_vgid)) {
if (arg_name_lookup) {
/*
* This shouldn't happen.
@@ -1419,7 +1419,7 @@ static int update_metadata(lvmetad_state *s, const char *arg_name, const char *a
* A lookup of the vgid arg was successful in finding arg_name_lookup,
* but that resulting name doesn't match the arg_name.
*/
- if (arg_name_lookup && arg_name && strcmp(arg_name_lookup, arg_name)) {
+ if (arg_name_lookup && strcmp(arg_name_lookup, arg_name)) {
if (arg_vgid_lookup) {
/*
* This shouldn't happen.
@@ -1459,7 +1459,7 @@ static int update_metadata(lvmetad_state *s, const char *arg_name, const char *a
* An existing VG has unchanged name and vgid.
*/
if (!new_vgid && !new_name) {
- if (strcmp(arg_name_lookup, arg_name)) {
+ if (arg_name_lookup && strcmp(arg_name_lookup, arg_name)) {
/* This shouldn't happen. */
ERROR(s, "update_metadata arg_vgid %s arg_name %s mismatch arg_name_lookup %s",
arg_vgid, arg_name, arg_name_lookup);
@@ -1467,7 +1467,7 @@ static int update_metadata(lvmetad_state *s, const char *arg_name, const char *a
goto update;
}
- if (strcmp(arg_vgid_lookup, arg_vgid)) {
+ if (arg_vgid_lookup && strcmp(arg_vgid_lookup, arg_vgid)) {
/*
* This shouldn't usually happen, but could when
* disks are moved (or filters are changed?)
8 years, 5 months
master - lvmetad: require meta_lookup
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f66fe2c444a4a8...
Commit: f66fe2c444a4a8c9dccf16ad8bf470a96de1305d
Parent: 91bde0f4a105fb0d2ad8407b63942f2790447846
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Nov 9 09:24:13 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 10:19:19 2015 +0100
lvmetad: require meta_lookup
Coverity: do not call update_pvid_to_vgid() with
meta_lookup == NULL since it is dereferencing it.
---
daemons/lvmetad/lvmetad-core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 1de2ad3..78af69b 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -931,7 +931,7 @@ static int remove_metadata(lvmetad_state *s, const char *vgid, int update_pvids)
unlock_vgid_to_metadata(s);
/* update_pvid_to_vgid will clear/free the pvid_to_vgid hash */
- if (update_pvids)
+ if (update_pvids && meta_lookup)
update_pvid_to_vgid(s, meta_lookup, "#orphan", 0);
/* free the unmapped data */
8 years, 5 months
master - lvmetad: check for allocation fail
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=91bde0f4a105fb...
Commit: 91bde0f4a105fb0d2ad8407b63942f2790447846
Parent: 297d6773afbddd747bc1c56fd01182b9ca798f60
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Nov 8 19:38:19 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 10:19:19 2015 +0100
lvmetad: check for allocation fail
Coverity: missing check for root != NULL as this pointer is
later dereferenced in add_last_node().
---
WHATS_NEW | 1 +
daemons/lvmetad/lvmetad-core.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a30786a..d0a1476 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.135 -
====================================
+ Add missing test for failing node allocation in lvmetad.
Correct configure messages when enabling/disabling lvmlockd.
Version 2.02.134 - 9th November 2015
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 8e911cd..1de2ad3 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -504,7 +504,9 @@ static response pv_list(lvmetad_state *s, request r)
return res; /* FIXME error reporting */
/* The response field */
- res.cft->root = make_text_node(res.cft, "response", "OK", NULL, NULL);
+ if (!(res.cft->root = make_text_node(res.cft, "response", "OK", NULL, NULL)))
+ return res; /* FIXME doomed */
+
cn_pvs = make_config_node(res.cft, "physical_volumes", NULL, res.cft->root);
lock_pvid_to_pvmeta(s);
8 years, 5 months
master - dmsetup: add missing checks for dm_stats_create() ret value
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=297d6773afbddd...
Commit: 297d6773afbddd747bc1c56fd01182b9ca798f60
Parent: e90c5d206043af53e868c785707dabf070fa5747
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Nov 9 09:45:53 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 10:19:19 2015 +0100
dmsetup: add missing checks for dm_stats_create() ret value
Coverity likes to see a check for dms not being NULL, so
add those missing ones...
---
WHATS_NEW_DM | 1 +
tools/dmsetup.c | 10 +++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 9e6a849..c735194 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.111 -
====================================
+ Add checks for failing dm_stats_create() in dmsetup.
Add missing fifo close when failed to initialize client connection.
Version 1.02.110 - 30th October 2015
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index a5cbef5..d6c0ad7 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -4834,7 +4834,9 @@ static int _stats_create(CMD_ARGS)
if (_switches[AUX_DATA_ARG])
aux_data = _string_args[AUX_DATA_ARG];
- dms = dm_stats_create(DM_STATS_PROGRAM_ID);
+ if (!(dms = dm_stats_create(DM_STATS_PROGRAM_ID)))
+ return_0;
+
if (!_bind_stats_device(dms, name))
goto_bad;
@@ -4906,7 +4908,8 @@ static int _stats_delete(CMD_ARGS)
region_id = (uint64_t) _int_args[REGION_ID_ARG];
- dms = dm_stats_create(program_id);
+ if (!(dms = dm_stats_create(program_id)))
+ return_0;
if (!_bind_stats_device(dms, name))
goto_out;
@@ -4968,7 +4971,8 @@ static int _stats_print(CMD_ARGS)
region_id = (uint64_t) _int_args[REGION_ID_ARG];
- dms = dm_stats_create(DM_STATS_PROGRAM_ID);
+ if (!(dms = dm_stats_create(DM_STATS_PROGRAM_ID)))
+ return_0;
if (!_bind_stats_device(dms, name))
goto_out;
8 years, 5 months
master - dmsetup: check for NULL from dm_task_get_ioctl_timestamp
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e90c5d206043af...
Commit: e90c5d206043af53e868c785707dabf070fa5747
Parent: 9df3069083cd49f75e0ec54fc1e699b057129934
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Nov 8 19:27:22 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 10:19:19 2015 +0100
dmsetup: check for NULL from dm_task_get_ioctl_timestamp
Coverity: ensure NULL is not passed to dm_timestamp_delta().
---
tools/dmsetup.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 036f58c..a5cbef5 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -401,15 +401,18 @@ static int _task_run(struct dm_task *dmt)
{
int r;
uint64_t delta;
+ struct dm_timestamp *ts;
if (_initial_timestamp)
dm_task_set_record_timestamp(dmt);
r = dm_task_run(dmt);
- if (_initial_timestamp) {
- delta = dm_timestamp_delta(dm_task_get_ioctl_timestamp(dmt), _initial_timestamp);
- log_debug("Timestamp: %7" PRIu64 ".%09" PRIu64 " seconds", delta / NSEC_PER_SEC, delta % NSEC_PER_SEC);
+ if (_initial_timestamp &&
+ (ts = dm_task_get_ioctl_timestamp(dmt))) {
+ delta = dm_timestamp_delta(ts, _initial_timestamp);
+ log_debug("Timestamp: %7" PRIu64 ".%09" PRIu64 " seconds",
+ delta / NSEC_PER_SEC, delta % NSEC_PER_SEC);
}
return r;
8 years, 5 months
master - clvmd: check for pthread_create status
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9df3069083cd49...
Commit: 9df3069083cd49f75e0ec54fc1e699b057129934
Parent: 2c8d6f5c90d5be62b48ba2881f2a6631091dc5af
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Nov 9 09:23:27 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 10:19:18 2015 +0100
clvmd: check for pthread_create status
Coverity: likes to see checked function result.
---
daemons/clvmd/clvmd.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index 53daa8c..96cb697 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -604,7 +604,10 @@ int main(int argc, char *argv[])
local_client_head.fd, &local_client_head, newfd->fd, newfd);
/* Don't let anyone else to do work until we are started */
- pthread_create(&lvm_thread, &stack_attr, lvm_thread_fn, &lvm_params);
+ if (pthread_create(&lvm_thread, &stack_attr, lvm_thread_fn, &lvm_params)) {
+ log_sys_error("pthread_create", "");
+ goto out;
+ }
/* Don't start until the LVM thread is ready */
pthread_barrier_wait(&lvm_start_barrier);
8 years, 5 months
master - dmeventd: open fifo in one function
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2c8d6f5c90d5be...
Commit: 2c8d6f5c90d5be62b48ba2881f2a6631091dc5af
Parent: e1b111b02accb4145b82b8b47ce57ed93b1a7184
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Nov 7 21:12:15 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 10:18:53 2015 +0100
dmeventd: open fifo in one function
Put calls related to fifo opening into a single function.
Fix Time-Of-Check-Time-Of-Use and use fstat()
and fchmod() on already opened fd instead of
checking first path and then risking to open something
different.
---
daemons/dmeventd/dmeventd.c | 85 ++++++++++++++++++++-----------------------
1 files changed, 40 insertions(+), 45 deletions(-)
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 42c724b..6c04c1b 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -1355,78 +1355,73 @@ static int _get_timeout(struct message_data *message_data)
return (msg->data && msg->size) ? 0 : -ENOMEM;
}
-/* Open fifos used for client communication. */
-static int _open_fifos(struct dm_event_fifos *fifos)
+static int _open_fifo(const char *path)
{
struct stat st;
+ int fd = -1;
- /* Create client fifo. */
- (void) dm_prepare_selinux_context(fifos->client_path, S_IFIFO);
- if ((mkfifo(fifos->client_path, 0600) == -1) && errno != EEXIST) {
- log_sys_error("client mkfifo", fifos->client_path);
- (void) dm_prepare_selinux_context(NULL, 0);
- goto fail;
- }
-
- /* Create server fifo. */
- (void) dm_prepare_selinux_context(fifos->server_path, S_IFIFO);
- if ((mkfifo(fifos->server_path, 0600) == -1) && errno != EEXIST) {
- log_sys_error("server mkfifo", fifos->server_path);
+ /* Create fifo. */
+ (void) dm_prepare_selinux_context(path, S_IFIFO);
+ if ((mkfifo(path, 0600) == -1) && errno != EEXIST) {
+ log_sys_error("mkfifo", path);
(void) dm_prepare_selinux_context(NULL, 0);
goto fail;
}
(void) dm_prepare_selinux_context(NULL, 0);
- /* Warn about wrong permissions if applicable */
- if ((!stat(fifos->client_path, &st)) && (st.st_mode & 0777) != 0600)
- log_warn("WARNING: Fixing wrong permissions on %s: %s.\n",
- fifos->client_path, strerror(errno));
-
- if ((!stat(fifos->server_path, &st)) && (st.st_mode & 0777) != 0600)
- log_warn("WARNING: Fixing wrong permissions on %s: %s.\n",
- fifos->server_path, strerror(errno));
-
- /* If they were already there, make sure permissions are ok. */
- if (chmod(fifos->client_path, 0600)) {
- log_sys_error("chmod", fifos->client_path);
+ /* Need to open read+write or we will block or fail */
+ if ((fd = open(path, O_RDWR)) < 0) {
+ log_sys_error("open", path);
goto fail;
}
- if (chmod(fifos->server_path, 0600)) {
- log_sys_error("chmod", fifos->server_path);
+ /* Warn about wrong permissions if applicable */
+ if (fstat(fd, &st)) {
+ log_sys_error("fstat", path);
goto fail;
}
- /* Need to open read+write or we will block or fail */
- if ((fifos->server = open(fifos->server_path, O_RDWR)) < 0) {
- log_sys_error("server open", fifos->server_path);
- goto fail;
+ if ((st.st_mode & 0777) != 0600) {
+ log_warn("WARNING: Fixing wrong permissions on %s: %s.",
+ path, strerror(errno));
+
+ if (fchmod(fd, 0600)) {
+ log_sys_error("fchmod", path);
+ goto fail;
+ }
}
- if (fcntl(fifos->server, F_SETFD, FD_CLOEXEC) < 0) {
- log_sys_error("fcntl(FD_CLOEXEC)", fifos->server_path);
+ if (fcntl(fd, F_SETFD, FD_CLOEXEC)) {
+ log_sys_error("fcntl(FD_CLOEXEC)", path);
goto fail;
}
- /* Need to open read+write for select() to work. */
- if ((fifos->client = open(fifos->client_path, O_RDWR)) < 0) {
- log_sys_error("client open", fifos->client_path);
+ return fd;
+
+fail:
+ if ((fd >= 0) && close(fd))
+ log_sys_error("close", path);
+
+ return -1;
+}
+
+/* Open fifos used for client communication. */
+static int _open_fifos(struct dm_event_fifos *fifos)
+{
+ /* Create client fifo. */
+ if ((fifos->client = _open_fifo(fifos->client_path)) < 0)
goto fail;
- }
- if (fcntl(fifos->client, F_SETFD, FD_CLOEXEC) < 0) {
- log_sys_error("fcntl(FD_CLOEXEC)", fifos->client_path);
+ /* Create server fifo. */
+ if ((fifos->server = _open_fifo(fifos->server_path)) < 0)
goto fail;
- }
return 1;
-fail:
- if (fifos->server >= 0 && close(fifos->server))
- log_sys_error("server close", fifos->server_path);
+fail:
if (fifos->client >= 0 && close(fifos->client))
- log_sys_error("client close", fifos->client_path);
+ log_sys_error("close", fifos->client_path);
return 0;
}
8 years, 5 months
master - dmeventd: reorder tou
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e1b111b02accb4...
Commit: e1b111b02accb4145b82b8b47ce57ed93b1a7184
Parent: 8b857bfdc60668c3cdeeb6c11ffe32def0371a39
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Nov 7 21:50:27 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 10:00:33 2015 +0100
dmeventd: reorder tou
---
daemons/dmeventd/libdevmapper-event.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c
index 9b3b424..85eab5a 100644
--- a/daemons/dmeventd/libdevmapper-event.c
+++ b/daemons/dmeventd/libdevmapper-event.c
@@ -412,17 +412,15 @@ static int _start_daemon(char *dmeventd_path, struct dm_event_fifos *fifos)
char default_dmeventd_path[] = DMEVENTD_PATH;
char *args[] = { dmeventd_path ? : default_dmeventd_path, NULL };
- if (stat(fifos->client_path, &statbuf))
- goto start_server;
-
- if (!S_ISFIFO(statbuf.st_mode)) {
- log_error("%s is not a fifo.", fifos->client_path);
- return 0;
- }
-
/* Anyone listening? If not, errno will be ENXIO */
fifos->client = open(fifos->client_path, O_WRONLY | O_NONBLOCK);
if (fifos->client >= 0) {
+ if ((fstat(fifos->client, &statbuf) < 0) ||
+ !S_ISFIFO(statbuf.st_mode)) {
+ log_error("%s is not a fifo.", fifos->client_path);
+ return 0;
+ }
+
/* server is running and listening */
if (close(fifos->client))
log_sys_debug("close", fifos->client_path);
@@ -433,7 +431,6 @@ static int _start_daemon(char *dmeventd_path, struct dm_event_fifos *fifos)
return 0;
}
- start_server:
/* server is not running */
if ((args[0][0] == '/') && stat(args[0], &statbuf)) {
8 years, 5 months
master - libdevmapper-event: fix fifo leak on error path
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8b857bfdc60668...
Commit: 8b857bfdc60668c3cdeeb6c11ffe32def0371a39
Parent: 459b3db61e14a9ac28fc9fd4d029accd6dee6330
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Nov 8 17:10:38 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 10:00:13 2015 +0100
libdevmapper-event: fix fifo leak on error path
Coverity: when _init_client() fails, client fifo could have
been already openned and needs to be closed on error path.
---
WHATS_NEW_DM | 1 +
daemons/dmeventd/libdevmapper-event.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 113a4bb..9e6a849 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.111 -
====================================
+ Add missing fifo close when failed to initialize client connection.
Version 1.02.110 - 30th October 2015
====================================
diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c
index ee4a35c..9b3b424 100644
--- a/daemons/dmeventd/libdevmapper-event.c
+++ b/daemons/dmeventd/libdevmapper-event.c
@@ -587,8 +587,8 @@ static int _do_event(int cmd, char *dmeventd_path, struct dm_event_daemon_messag
};
if (!_init_client(dmeventd_path, &fifos)) {
- stack;
- return -ESRCH;
+ ret = -ESRCH;
+ goto_out;
}
ret = daemon_talk(&fifos, msg, DM_EVENT_CMD_HELLO, NULL, NULL, 0, 0);
@@ -598,7 +598,7 @@ static int _do_event(int cmd, char *dmeventd_path, struct dm_event_daemon_messag
if (!ret)
ret = daemon_talk(&fifos, msg, cmd, dso_name, dev_name, evmask, timeout);
-
+out:
/* what is the opposite of init? */
fini_fifos(&fifos);
8 years, 5 months
master - configure: report whether to build lvmlockd
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=459b3db61e14a9...
Commit: 459b3db61e14a9ac28fc9fd4d029accd6dee6330
Parent: af6adec7cc1e4229a88cc9d7951a51d0d22c5032
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Nov 2 20:04:50 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 9 09:58:27 2015 +0100
configure: report whether to build lvmlockd
Report configured status for build with lvmlockd.
---
WHATS_NEW | 1 +
configure | 24 ++++++++----------------
configure.in | 16 ++++------------
3 files changed, 13 insertions(+), 28 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5e89eca..a30786a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.135 -
====================================
+ Correct configure messages when enabling/disabling lvmlockd.
Version 2.02.134 - 9th November 2015
====================================
diff --git a/configure b/configure
index 31dc750..c566466 100755
--- a/configure
+++ b/configure
@@ -3130,7 +3130,6 @@ case "$host_os" in
DEVMAPPER=yes
LVMETAD=no
LVMPOLLD=no
- LVMLOCKD=no
LOCKDSANLOCK=no
LOCKDDLM=no
ODIRECT=yes
@@ -11368,6 +11367,8 @@ $as_echo "$LVMPOLLD" >&6; }
BUILD_LVMPOLLD=$LVMPOLLD
################################################################################
+BUILD_LVMLOCKD=no
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build lockdsanlock" >&5
$as_echo_n "checking whether to build lockdsanlock... " >&6; }
# Check whether --enable-lockd-sanlock was given.
@@ -11382,13 +11383,6 @@ BUILD_LOCKDSANLOCK=$LOCKDSANLOCK
if test "$BUILD_LOCKDSANLOCK" = yes; then
-$as_echo "#define LOCKDSANLOCK_SUPPORT 1" >>confdefs.h
-
-fi
-
-################################################################################
-if test "$BUILD_LOCKDSANLOCK" = yes; then
-
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOCKD_SANLOCK" >&5
$as_echo_n "checking for LOCKD_SANLOCK... " >&6; }
@@ -11459,6 +11453,9 @@ else
$as_echo "yes" >&6; }
HAVE_LOCKD_SANLOCK=yes
fi
+
+$as_echo "#define LOCKDSANLOCK_SUPPORT 1" >>confdefs.h
+
BUILD_LVMLOCKD=yes
fi
@@ -11477,13 +11474,6 @@ BUILD_LOCKDDLM=$LOCKDDLM
if test "$BUILD_LOCKDDLM" = yes; then
-$as_echo "#define LOCKDDLM_SUPPORT 1" >>confdefs.h
-
-fi
-
-################################################################################
-if test "$BUILD_LOCKDDLM" = yes; then
-
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOCKD_DLM" >&5
$as_echo_n "checking for LOCKD_DLM... " >&6; }
@@ -11554,11 +11544,13 @@ else
$as_echo "yes" >&6; }
HAVE_LOCKD_DLM=yes
fi
+
+$as_echo "#define LOCKDDLM_SUPPORT 1" >>confdefs.h
+
BUILD_LVMLOCKD=yes
fi
################################################################################
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build lvmlockd" >&5
$as_echo_n "checking whether to build lvmlockd... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_LVMLOCKD" >&5
diff --git a/configure.in b/configure.in
index c240b4b..68bd341 100644
--- a/configure.in
+++ b/configure.in
@@ -39,7 +39,6 @@ case "$host_os" in
DEVMAPPER=yes
LVMETAD=no
LVMPOLLD=no
- LVMLOCKD=no
LOCKDSANLOCK=no
LOCKDDLM=no
ODIRECT=yes
@@ -1145,6 +1144,8 @@ AC_MSG_RESULT($LVMPOLLD)
BUILD_LVMPOLLD=$LVMPOLLD
################################################################################
+BUILD_LVMLOCKD=no
+
dnl -- Build lockdsanlock
AC_MSG_CHECKING(whether to build lockdsanlock)
AC_ARG_ENABLE(lockd-sanlock,
@@ -1155,14 +1156,10 @@ AC_MSG_RESULT($LOCKDSANLOCK)
BUILD_LOCKDSANLOCK=$LOCKDSANLOCK
-if test "$BUILD_LOCKDSANLOCK" = yes; then
- AC_DEFINE([LOCKDSANLOCK_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd sanlock option.])
-fi
-
-################################################################################
dnl -- Look for sanlock libraries
if test "$BUILD_LOCKDSANLOCK" = yes; then
PKG_CHECK_MODULES(LOCKD_SANLOCK, libsanlock_client, [HAVE_LOCKD_SANLOCK=yes], $bailout)
+ AC_DEFINE([LOCKDSANLOCK_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd sanlock option.])
BUILD_LVMLOCKD=yes
fi
@@ -1177,20 +1174,15 @@ AC_MSG_RESULT($LOCKDDLM)
BUILD_LOCKDDLM=$LOCKDDLM
-if test "$BUILD_LOCKDDLM" = yes; then
- AC_DEFINE([LOCKDDLM_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd dlm option.])
-fi
-
-################################################################################
dnl -- Look for dlm libraries
if test "$BUILD_LOCKDDLM" = yes; then
PKG_CHECK_MODULES(LOCKD_DLM, libdlm, [HAVE_LOCKD_DLM=yes], $bailout)
+ AC_DEFINE([LOCKDDLM_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd dlm option.])
BUILD_LVMLOCKD=yes
fi
################################################################################
dnl -- Build lvmlockd
-
AC_MSG_CHECKING(whether to build lvmlockd)
AC_MSG_RESULT($BUILD_LVMLOCKD)
8 years, 5 months