From 61a45c7b3a8570ee1fe54669bdfeadb731d3e712 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 11 Oct 2011 09:23:48 +0000 Subject: Add FIXMEs for init_test Usage of thread unprotected init_test is not correct and needs probably lvm lock since it part of lvm library. Current implementation may probably fail with test mode and actually create something unexpectedly (and vice versa). --- daemons/clvmd/clvmd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'daemons') diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c index 9973baca..9e97eb64 100644 --- a/daemons/clvmd/clvmd.c +++ b/daemons/clvmd/clvmd.c @@ -1514,9 +1514,9 @@ static void process_remote_command(struct clvm_header *msg, int msglen, int fd, if (replyargs != NULL) { /* Run the command */ - status = - do_command(NULL, msg, msglen, &replyargs, buflen, - &replylen); + /* FIXME: usage of init_test() is unprotected */ + status = do_command(NULL, msg, msglen, &replyargs, + buflen, &replylen); } else { status = ENOMEM; } @@ -1651,6 +1651,7 @@ static __attribute__ ((noreturn)) void *pre_and_post_thread(void *arg) /* Loop around doing PRE and POST functions until the client goes away */ while (!client->bits.localsock.finished) { /* Execute the code */ + /* FIXME: usage of init_test() is unprotected as in do_command() */ status = do_pre_command(client); if (status) @@ -1733,6 +1734,7 @@ static int process_local_command(struct clvm_header *msg, int msglen, if (replybuf == NULL) return -1; + /* FIXME: usage of init_test() is unprotected */ status = do_command(client, msg, msglen, &replybuf, buflen, &replylen); if (status) -- cgit