core : Use correct path in dlopen for socket.so
authorAtin Mukherjee <amukherj@redhat.com>
Thu, 19 Nov 2015 06:30:23 +0000 (12:00 +0530)
committerJeff Darcy <jdarcy@redhat.com>
Thu, 19 Nov 2015 15:18:30 +0000 (07:18 -0800)
This patch fixes the path for socket.so file while loading the so dynamically.
Also for config.memory-accounting & config.transport voltype is changed to
glusterd to fix the warning message coming from xlator_volopt_dynload

Change-Id: I0f7964814586f2018d4922b23c683f4e1eb3098e
BUG: 1283485
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/12656
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
libglusterfs/src/Makefile.am
libglusterfs/src/xlator.c
xlators/mgmt/glusterd/src/glusterd-volume-set.c

index 1b3a5572c8b70791e7b190a485163c502e33531b..46e2e021134377c7b7ebe81d475f7ff6ee9b12f1 100644 (file)
@@ -5,6 +5,7 @@ libglusterfs_la_CFLAGS = $(GF_CFLAGS) $(GF_DARWIN_LIBGLUSTERFS_CFLAGS) \
 
 libglusterfs_la_CPPFLAGS = $(GF_CPPFLAGS) -D__USE_FILE_OFFSET64 \
        -DXLATORDIR=\"$(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator\" \
+       -DXLATORPARENTDIR=\"$(libdir)/glusterfs/$(PACKAGE_VERSION)\" \
        -I$(top_srcdir)/rpc/rpc-lib/src/ -I$(CONTRIBDIR)/rbtree \
        -I$(CONTRIBDIR)/libexecinfo ${ARGP_STANDALONE_CPPFLAGS} \
        -DSBIN_DIR=\"$(sbindir)\" -I$(CONTRIBDIR)/timer-wheel
index ed120d23a8ffc18c92504b0b2f6837caa25ad965..0712742360a72e3c8c22bfcb9c3a425914690d8f 100644 (file)
@@ -123,7 +123,12 @@ xlator_volopt_dynload (char *xlator_type, void **dl_handle,
 
         GF_VALIDATE_OR_GOTO ("xlator", xlator_type, out);
 
-        ret = gf_asprintf (&name, "%s/%s.so", XLATORDIR, xlator_type);
+        /* socket.so doesn't fall under the default xlator directory, hence we
+         * need this check */
+        if (!strstr(xlator_type, "rpc-transport"))
+                ret = gf_asprintf (&name, "%s/%s.so", XLATORDIR, xlator_type);
+        else
+                ret = gf_asprintf (&name, "%s/%s.so", XLATORPARENTDIR, xlator_type);
         if (-1 == ret) {
                 goto out;
         }
index 6535245587b7f15978200ad75e6a96cc8c360698..b085e4dbbe33b1c01ed222923373159227b3e5e2 100644 (file)
@@ -1889,13 +1889,13 @@ struct volopt_map_entry glusterd_volopt_map[] = {
           .op_version  = 3
         },
         { .key        = "config.memory-accounting",
-          .voltype    = "configuration",
+          .voltype    = "mgmt/glusterd",
           .option     = "!config",
           .op_version = 2,
           .flags      = OPT_FLAG_CLIENT_OPT
         },
         { .key         = "config.transport",
-          .voltype     = "configuration",
+          .voltype     = "mgmt/glusterd",
           .option      = "!config",
           .op_version  = 2
         },