From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 5/5] mountd: Report the absolute path used to load the junction plug-in
Date: Mon, 03 Dec 2012 12:18:08 -0500 [thread overview]
Message-ID: <20121203171808.1390.33578.stgit@lebasque.1015granger.net> (raw)
In-Reply-To: <20121203171549.1390.64007.stgit@lebasque.1015granger.net>
As a debugging feature, report the absolute pathname of the plug-in
library that mountd loads to resolve junctions.
Since mountd passes a relative path to dlopen(3), dlopen(3) must
search for the right library. Displaying the absolute pathname of
the object that it found verifies that mountd loaded the correct
plug-in.
Note: dlinfo(3) is provided by libdl, but there doesn't seem to be a
man page on Fedora 16 for dlinfo(3). Instead, see:
http://www.unix.com/man-page/all/3/dlinfo/
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
utils/mountd/cache.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index c264e14..3853bb6 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -826,6 +826,7 @@ lookup_export(char *dom, char *path, struct addrinfo *ai)
#ifdef HAVE_NFS_PLUGIN_H
#include <dlfcn.h>
+#include <link.h>
#include <nfs-plugin.h>
/*
@@ -1090,6 +1091,7 @@ static struct exportent *lookup_junction(char *dom, const char *pathname,
struct addrinfo *ai)
{
struct exportent *exp;
+ struct link_map *map;
void *handle;
handle = dlopen("libnfsjunct.so", RTLD_NOW);
@@ -1097,6 +1099,11 @@ static struct exportent *lookup_junction(char *dom, const char *pathname,
xlog(D_GENERAL, "%s: dlopen: %s", __func__, dlerror());
return NULL;
}
+
+ if (dlinfo(handle, RTLD_DI_LINKMAP, &map) == 0)
+ xlog(D_GENERAL, "%s: loaded plug-in %s",
+ __func__, map->l_name);
+
(void)dlerror(); /* Clear any error */
exp = invoke_junction_ops(handle, dom, pathname, ai);
next prev parent reply other threads:[~2012-12-03 17:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-03 17:17 [PATCH 0/5] mountd clean-ups for nfs-utils 1.2.8 Chuck Lever
2012-12-03 17:17 ` [PATCH 1/5] mountd: auth.c no longer needs #include xmalloc.h Chuck Lever
2012-12-03 17:17 ` [PATCH 2/5] mountd: cache.c " Chuck Lever
2012-12-03 17:17 ` [PATCH 3/5] libexport.a: rmtab.c " Chuck Lever
2012-12-03 17:17 ` [PATCH 4/5] libexport.a: xtab.c " Chuck Lever
2012-12-03 17:18 ` Chuck Lever [this message]
2012-12-12 15:40 ` [PATCH 0/5] mountd clean-ups for nfs-utils 1.2.8 Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121203171808.1390.33578.stgit@lebasque.1015granger.net \
--to=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).