[Gluster-devel] [Gluster Build System (Code Review)] Change in glusterfs[master]: remove useless-if-before-free -- with-braces

Jim Meyering jim at meyering.net
Thu Jul 12 11:37:31 UTC 2012


Hello,

Is the leak-detection part of the autotest script reliable?
A no-semantic-change (NSC) patch appears to be making that script
complain about a file descriptor leak:

    Gluster Build System has posted comments on this change.

    Change subject: remove useless-if-before-free -- with-braces
    ......................................................................
    Patch Set 4: Fails
    Build Failed
    http://build.gluster.com/job/glusterfs/3841/ : FAILURE

The console output shows this:

    ...
    + killall -15 glusterfs glusterfsd glusterd glusterd
    glusterd: no process killed
    + true
    + killall -9 glusterfs glusterfsd glusterd glusterd
    glusterd: no process killed
    + true
    + umount -l /mnt
    + rm -rf /var/lib/glusterd /etc/glusterd /build/export
    + kill %1
    Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information
    Finished: FAILURE

Here is the NSC patch that is supposedly inducing this leak:

>From 35aee55929e17b87aa827a8506ff7f8e4dcdef2e Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Wed, 11 Jul 2012 16:38:53 +0200
Subject: [PATCH 2/7] remove useless-if-before-free -- with-braces

Signed-off-by: Jim Meyering <meyering at redhat.com>
Change-Id: Ibc31f2ae46b855f14c8807294a5db005fd75a080
---
 rpc/rpc-transport/rdma/src/rdma.c              | 4 +---
 xlators/protocol/server/src/server-handshake.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index 3d4dfe3..111aeec 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -196,9 +196,7 @@ gf_rdma_new_post (gf_rdma_device_t *device, int32_t len,
         ret = 0;
 out:
         if (ret != 0) {
-                if (post->buf != NULL) {
-                        free (post->buf);
-                }
+                free (post->buf);

                 GF_FREE (post);
                 post = NULL;
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index e61fe9b..2cba564 100644
--- a/xlators/protocol/server/src/server-handshake.c
+++ b/xlators/protocol/server/src/server-handshake.c
@@ -736,9 +736,7 @@ fail:
         server_submit_reply (NULL, req, &rsp, NULL, 0, NULL,
                              (xdrproc_t)xdr_gf_set_lk_ver_rsp);

-        if (args.uid != NULL) {
-                free (args.uid);
-        }
+        free (args.uid);

         return 0;
 }
--
1.7.11.1.165.g299666c




More information about the Gluster-devel mailing list