1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

clvmd: set finished flag with mutex

Setting this variable needs to be protected with mutex.
This commit is contained in:
Zdenek Kabelac 2014-04-09 10:36:25 +02:00
parent cc0096ebdd
commit 6115c0d112
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.107 - Version 2.02.107 -
================================== ==================================
Protect manipulation with finished flag with mutex in clvmd.
Shift mutex creation and destroy for localsock in clvmd to correct place. Shift mutex creation and destroy for localsock in clvmd to correct place.
Fix usage of --test option in clvmd. Fix usage of --test option in clvmd.
Skip more libraries to be mlocked in memory. Skip more libraries to be mlocked in memory.

View File

@ -1149,8 +1149,6 @@ static int cleanup_zombie(struct local_client *thisfd)
DEBUGLOG("EOF on local socket: inprogress=%d\n", DEBUGLOG("EOF on local socket: inprogress=%d\n",
thisfd->bits.localsock.in_progress); thisfd->bits.localsock.in_progress);
thisfd->bits.localsock.finished = 1;
if ((pipe_client = thisfd->bits.localsock.pipe_client)) if ((pipe_client = thisfd->bits.localsock.pipe_client))
pipe_client = pipe_client->bits.pipe.client; pipe_client = pipe_client->bits.pipe.client;
@ -1161,6 +1159,7 @@ static int cleanup_zombie(struct local_client *thisfd)
if (pthread_mutex_trylock(&thisfd->bits.localsock.mutex)) if (pthread_mutex_trylock(&thisfd->bits.localsock.mutex))
return 1; return 1;
thisfd->bits.localsock.state = POST_COMMAND; thisfd->bits.localsock.state = POST_COMMAND;
thisfd->bits.localsock.finished = 1;
pthread_cond_signal(&thisfd->bits.localsock.cond); pthread_cond_signal(&thisfd->bits.localsock.cond);
pthread_mutex_unlock(&thisfd->bits.localsock.mutex); pthread_mutex_unlock(&thisfd->bits.localsock.mutex);
@ -1173,6 +1172,7 @@ static int cleanup_zombie(struct local_client *thisfd)
DEBUGLOG("Waiting for pre&post thread (%p)\n", pipe_client); DEBUGLOG("Waiting for pre&post thread (%p)\n", pipe_client);
pthread_mutex_lock(&thisfd->bits.localsock.mutex); pthread_mutex_lock(&thisfd->bits.localsock.mutex);
thisfd->bits.localsock.state = PRE_COMMAND; thisfd->bits.localsock.state = PRE_COMMAND;
thisfd->bits.localsock.finished = 1;
pthread_cond_signal(&thisfd->bits.localsock.cond); pthread_cond_signal(&thisfd->bits.localsock.cond);
pthread_mutex_unlock(&thisfd->bits.localsock.mutex); pthread_mutex_unlock(&thisfd->bits.localsock.mutex);