]> sourceware.org Git - lvm2.git/commitdiff
Fix off-by-one error in cluster_locking that could case read hangs.
authorPatrick Caulfield <pcaulfie@redhat.com>
Fri, 7 Jan 2005 14:22:49 +0000 (14:22 +0000)
committerPatrick Caulfield <pcaulfie@redhat.com>
Fri, 7 Jan 2005 14:22:49 +0000 (14:22 +0000)
WHATS_NEW
daemons/clvmd/clvmd.c
lib/locking/cluster_locking.c

index 144e39060529df9bb59304014f5f740159534a1e..3b029f24f766ecc3017f093898dac231549f8486 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -5,6 +5,7 @@ Version 2.00.33 -
   gulm clvmd now doesn't ignore the first node in cluster.conf
   Improve clvmd failure message if it's already running.
   Allow user to kill clvmd during initialisation.
+  Fix off-by-one error in cluster_locking that could cause read hangs.
 
 Version 2.00.32 - 22nd December 2004
 ====================================
index 6346fdf2915d3fa9f096577034e31254118dfedc..9a86f6f11a7534a2f40965e9be4166f3f263dbc4 100644 (file)
@@ -1313,6 +1313,7 @@ static void *pre_and_post_thread(void *arg)
 
                DEBUGLOG("Got post command condition...\n");
 
+               status = 0;
                do_post_command(client);
 
                write(pipe_fd, &status, sizeof(int));
index d9cab2d7ed2f3188da11595b0e310fc1ed8acb17..4faa73f06c813ac78a1d3fad39f193d0ebdd87f8 100644 (file)
@@ -139,8 +139,7 @@ static int _send_request(char *inbuf, int inlen, char **retbuf)
 
        /* Read the returned values */
        off = 1;                /* we've already read the first byte */
-
-       while (off < outheader->arglen && len > 0) {
+       while (off <= outheader->arglen && len > 0) {
                len = read(_clvmd_sock, outheader->args + off,
                           buflen - off - offsetof(struct clvm_header, args));
                if (len > 0)
@@ -150,7 +149,7 @@ static int _send_request(char *inbuf, int inlen, char **retbuf)
        /* Was it an error ? */
        if (outheader->status < 0) {
                errno = -outheader->status;
-               log_error("cluster send request failed: %s", strerror(errno));
+               log_error("cluster request failed: %s", strerror(errno));
                return 0;
        }
 
This page took 0.041574 seconds and 5 git commands to generate.